Skip to content

Commit 42f4d3b

Browse files
committed
Refactor event details display on the event page to conditionally render date and location elements
1 parent 5bfa9c5 commit 42f4d3b

1 file changed

Lines changed: 37 additions & 33 deletions

File tree

devconnect/src/pages/destino/[event].tsx

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -110,39 +110,43 @@ ${currentUrl}`
110110
</div>
111111
<div className="flex flex-col min-[480px]:flex-row gap-2 items-start min-[480px]:items-center min-[480px]:justify-between mb-2">
112112
<div className="flex flex-col gap-1">
113-
<span className="inline-flex items-center gap-1 text-gray-500 text-base font-medium">
114-
<svg
115-
className="w-4 h-4 text-gray-400"
116-
fill="none"
117-
stroke="currentColor"
118-
strokeWidth="2"
119-
viewBox="0 0 24 24"
120-
>
121-
<path
122-
strokeLinecap="round"
123-
strokeLinejoin="round"
124-
d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
125-
/>
126-
</svg>
127-
{moment(eventData?.date).format('MMMM D, YYYY')}
128-
</span>
129-
<span className="inline-flex items-center gap-1 text-gray-500 text-base font-medium">
130-
<svg
131-
className="w-4 h-4 text-gray-400"
132-
fill="none"
133-
stroke="currentColor"
134-
strokeWidth="2"
135-
viewBox="0 0 24 24"
136-
>
137-
<path
138-
strokeLinecap="round"
139-
strokeLinejoin="round"
140-
d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
141-
/>
142-
<path strokeLinecap="round" strokeLinejoin="round" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" />
143-
</svg>
144-
{eventData?.location}
145-
</span>
113+
{eventData?.date && (
114+
<span className="inline-flex items-center gap-1 text-gray-500 text-base font-medium">
115+
<svg
116+
className="w-4 h-4 text-gray-400"
117+
fill="none"
118+
stroke="currentColor"
119+
strokeWidth="2"
120+
viewBox="0 0 24 24"
121+
>
122+
<path
123+
strokeLinecap="round"
124+
strokeLinejoin="round"
125+
d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
126+
/>
127+
</svg>
128+
{moment(eventData?.date).format('MMMM D, YYYY')}
129+
</span>
130+
)}
131+
{eventData?.location && (
132+
<span className="inline-flex items-center gap-1 text-gray-500 text-base font-medium">
133+
<svg
134+
className="w-4 h-4 text-gray-400"
135+
fill="none"
136+
stroke="currentColor"
137+
strokeWidth="2"
138+
viewBox="0 0 24 24"
139+
>
140+
<path
141+
strokeLinecap="round"
142+
strokeLinejoin="round"
143+
d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
144+
/>
145+
<path strokeLinecap="round" strokeLinejoin="round" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" />
146+
</svg>
147+
{eventData?.location}
148+
</span>
149+
)}
146150
</div>
147151
<div className="bg-black text-xs px-3 py-1 rounded-full shadow">
148152
<span className={styles['rainbow-text']}>

0 commit comments

Comments
 (0)