Skip to content

Commit

Permalink
fix: 데이터 없을시 섹션 렌더링 안되도록 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-yn committed Apr 21, 2024
1 parent c3bd2d1 commit b9d8de1
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/containers/Contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const ContactContainer = async ({ title }: ContactSectionProps) => {
const { contact } = (await res.json()) as PageData;

if (!contact.email) return null;

return (
<Contact title={title} data={contact}>
<Contact.Title />
Expand Down
2 changes: 2 additions & 0 deletions src/containers/HistoryCarouselContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const HistoryCarouselContainer = () => {
},
);

if (!data.length) return null;

return <HistoryCarousel data={data} />;
};

Expand Down
1 change: 0 additions & 1 deletion src/containers/HistoryContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const HistoryContainer = async () => {
.flat();

if (!flattenHistories.length) return null;

return <History summary={summaryData} userAgent={userAgent} />;
};

Expand Down
1 change: 1 addition & 0 deletions src/containers/HistorySummaryContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const HistorySummaryContainer = ({ isMobile }: SummaryContainerProps) => {
)
: summary;

if (!summaryDisplayList.length) return null;
return (
<>
{summaryDisplayList.map((historySummary) => {
Expand Down
1 change: 0 additions & 1 deletion src/containers/Introduce.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const IntroduceContainer = async ({ title }: Props) => {
const { introduce } = (await res.json()) as PageData;

if (!introduce) return null;

return (
<Introduce
id={introduce.id}
Expand Down
1 change: 0 additions & 1 deletion src/containers/Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const ProjectContainer = async ({ title }: ProjectSectionProps) => {
const { projects } = (await res.json()) as PageData;

if (!projects.length) return null;

return (
<Project userAgent={userAgent} title={title} data={projects}>
<Project.Title />
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Skill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const SkillContainer = async ({ title }: Props) => {

const { skills } = (await res.json()) as PageData;
const flattenSkills = skills.map((skill) => skill.skills).flat();
if (!flattenSkills.length) return null;

if (!flattenSkills.length) return null;
return <Skill userAgent={userAgent} title={title} data={skills} />;
};

Expand Down

0 comments on commit b9d8de1

Please sign in to comment.