Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web-domains): 자기소개 정보 중 optional 데이터 대응 #163

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface MeetingMemberResponse {
birth: string;
job: string;
location: string;
hobbies: Array<string>;
mbti: string;
introduction: string;
hobbies?: Array<string>;
mbti?: string;
introduction?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Profile = (props: ProfileProps) => {
const age = birthFromProps && generateAge(birthFromProps);
const gender = generateGender(genderFromProps);

const infoBadges = [age, gender, mbti, location, job].filter(Boolean);
const infoBadges = [age, gender, mbti, location, job].filter((value) => value != null);

return (
<Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useGetMemberByParams } from '../hooks/useGetMemberByParams';
export const AboutMeContainer = () => {
const { data } = useGetMemberByParams();

const hasNoInfo = !data?.hobbies.length && !data?.introduction.length;
const hasNoInfo = data?.hobbies == null && (data?.introduction == null || data?.introduction === '');

if (hasNoInfo) return <EmptyView title="아직 입력한 정보가 없어요" style={{ height: '300px' }} />;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface AboutMeProps {
}

export const AboutMe = ({ info }: AboutMeProps) => {
const hasNoInfo = !info?.hobbies.length && !info?.introduction;
const hasNoInfo = info?.hobbies == null && (info?.introduction == null || info?.introduction === '');

if (hasNoInfo) return <EmptyView title="아직 입력한 정보가 없어요" style={{ height: '300px' }} />;

Expand Down
Loading