Skip to content

Commit b18ae6b

Browse files
committed
fix: 🐛 make customer, description and participation optional fields
1 parent 54ab347 commit b18ae6b

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

src/pages/portfolio.js

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,37 @@ let PortfolioPage = ({
5757
</h2>
5858
</header>
5959

60-
<h3>Customer</h3>
61-
62-
<p>{project.customer}</p>
63-
64-
<h3>Description</h3>
65-
66-
<div
67-
dangerouslySetInnerHTML={{
68-
__html: project.description.childContentfulRichText.html,
69-
}}
70-
/>
71-
72-
<h3>Participation</h3>
73-
74-
<ul>
75-
{project.participation.map(p => (
76-
<li key={p}>{p}</li>
77-
))}
78-
</ul>
60+
{project.customer && (
61+
<>
62+
<h3>Customer</h3>
63+
64+
<p>{project.customer}</p>
65+
</>
66+
)}
67+
68+
{project.description && (
69+
<>
70+
<h3>Description</h3>
71+
72+
<div
73+
dangerouslySetInnerHTML={{
74+
__html: project.description.childContentfulRichText.html,
75+
}}
76+
/>
77+
</>
78+
)}
79+
80+
{project.participation && (
81+
<>
82+
<h3>Participation</h3>
83+
84+
<ul>
85+
{project.participation.map(p => (
86+
<li key={p}>{p}</li>
87+
))}
88+
</ul>
89+
</>
90+
)}
7991

8092
<h3>Technologies</h3>
8193

0 commit comments

Comments
 (0)