Skip to content

Commit

Permalink
fix(routes/show-info): render description as HTML
Browse files Browse the repository at this point in the history
This patch updates the show info section on the show page to render the
show description as HTML. I imported all the Vogue article HTML as the
show descriptions, and thus this change was required.

This patch also hides the "Location:" info item when it does not exist.

Fixes: e6a4cf7 ("fix: set show location to `NULL` if unknown")
  • Loading branch information
nicholaschiang committed Jul 25, 2023
1 parent a11ba75 commit 9ed0077
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/routes/shows.$showId/show-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ export function ShowInfo() {
const show = useLoaderData<typeof loader>()
return (
<Section header='Show info' id='show-info'>
<article>{show.description}</article>
<article
className='prose dark:prose-invert max-w-none'
dangerouslySetInnerHTML={{ __html: show.description }}
/>
<dl className='mt-2'>
<InfoItem label='Date'>
{new Date(show.date).toLocaleDateString(undefined, {
dateStyle: 'long',
})}
</InfoItem>
<InfoItem label='Location'>{show.location ?? 'Unknown'}</InfoItem>
{show.location != null && (
<InfoItem label='Location'>{show.location}</InfoItem>
)}
<InfoItem label='Looks'>{show.looks.length}</InfoItem>
<InfoItem
label={show.brands.length === 1 ? 'Brand' : 'Brands'}
Expand Down

0 comments on commit 9ed0077

Please sign in to comment.