Skip to content

Commit

Permalink
bug: skip date rendering if error in EventDetails.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Voccia committed Oct 12, 2024
1 parent d9217d5 commit 824d60d
Showing 1 changed file with 45 additions and 22 deletions.
67 changes: 45 additions & 22 deletions app/components/EventDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,49 @@ export function EventDetails({
day: "numeric",
month: "long",
});

return (
<article className={`event-details medium event-details-${weight}`}>
<h3 className="event-details-date">{formatter.format(date)}</h3>
<p>{location}</p>
<ul className="event-details-topics">
{topics.map((topic) => (
<li className="event-details-topic" key={topic}>
{topic}
</li>
))}
</ul>
<a href={link} rel="noreferrer" target="_blank">
{linkText}
<Arrow
className="arrow-out"
label="External link indication arrow"
rotate={-45}
/>
</a>
</article>
);
try {
return (
<article className={`event-details medium event-details-${weight}`}>
<h3 className="event-details-date">{formatter.format(date)}</h3>
<p>{location}</p>
<ul className="event-details-topics">
{topics.map((topic) => (
<li className="event-details-topic" key={topic}>
{topic}
</li>
))}
</ul>
<a href={link} rel="noreferrer" target="_blank">
{linkText}
<Arrow
className="arrow-out"
label="External link indication arrow"
rotate={-45}
/>
</a>
</article>
);
} catch (ex) {
return (
<article className={`event-details medium event-details-${weight}`}>
<h3 className="event-details-date">UNKNOWN</h3>
<p>{location}</p>
<ul className="event-details-topics">
{topics.map((topic) => (
<li className="event-details-topic" key={topic}>
{topic}
</li>
))}
</ul>
<a href={link} rel="noreferrer" target="_blank">
{linkText}
<Arrow
className="arrow-out"
label="External link indication arrow"
rotate={-45}
/>
</a>
</article>
);
}
}

0 comments on commit 824d60d

Please sign in to comment.