Skip to content

Commit

Permalink
Make most input fields optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ikjelle committed Oct 12, 2024
1 parent faafff6 commit 3d9e6bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
},
"role": {
"type": "string",
"required": true
"required": false
},
"email": {
"type": "email",
"required": true
"required": false
},
"extra": {
"type": "richtext"
},
"photo": {
"type": "media",
"multiple": false,
"required": true,
"required": false,
"allowedTypes": ["images"]
},
"order": {
Expand Down
20 changes: 11 additions & 9 deletions frontend/src/components/BoardmemberCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ export default function BoardmemberCard(props: Props) {
return (
<div className="flex flex-col md:flex-row gap-8 mb-8 shadow-inner bg-gray-50 p-4 rounded">
<div className="float-right relative md:min-w-[10rem] h-[10rem] rounded shadow-lg overflow-hidden">
<Image
src={boardmember.photo}
fill
sizes="10rem"
className="object-cover"
loader={imageLoader}
alt={`Foto van ${boardmember.name}`}
/>
{boardmember.photo && (
<Image
src={boardmember.photo}
fill
sizes="10rem"
className="object-cover"
loader={imageLoader}
alt={`Foto van ${boardmember.name}`}
/>
)}
</div>
<div>
<Subheader>{boardmember.name}</Subheader>
Expand All @@ -39,7 +41,7 @@ export default function BoardmemberCard(props: Props) {
className="group hover:underline"
href={`mailto:${boardmember.email}`}
>
<FaEnvelope />
{boardmember.email && <FaEnvelope />}
{boardmember.email}
</a>
</p>
Expand Down

0 comments on commit 3d9e6bb

Please sign in to comment.