-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UXIT-1680] Event Page · Include moderators and speakers #767
Changes from 9 commits
0dde682
c7e90a8
2bcaaed
c94c62b
594b9f9
7e47cd0
6cf7c70
966f6db
5933591
11b909e
2e8cb4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export type NonEmptyArray<T> = [T, ...Array<T>] | ||
export type NonEmptyReadonlyArray<T> = readonly [T, ...Array<T>] | ||
export type Object = Record<string, unknown> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
'use client' | ||
|
||
import { BasicCard } from '@/components/BasicCard' | ||
import { Heading } from '@/components/Heading' | ||
import { TextLink } from '@/components/TextLink' | ||
|
||
import type { Event } from '../../../schemas/ScheduleSchema' | ||
import { formatTime } from '../../utils/dateUtils' | ||
|
||
import { type ParticipantsProps, ScheduleParticipants } from './Participants' | ||
|
||
export function EventDetails(event: Event) { | ||
return ( | ||
<BasicCard> | ||
<div className="grid gap-6 lg:grid-cols-3"> | ||
<div className="flex gap-6 text-brand-300 lg:flex-col lg:gap-1"> | ||
<div className="text-sm font-bold"> | ||
<span>{formatTime(event.start)}</span> | ||
{event.end && <span> – {formatTime(event.end)}</span>} | ||
</div> | ||
<span className="text-sm">{event.location}</span> | ||
</div> | ||
<div className="lg:col-span-2"> | ||
<Heading tag="h3" variant="lg"> | ||
{event.title} | ||
</Heading> | ||
<div className="mt-2 space-y-2"> | ||
{event.description && ( | ||
<p className="max-w-readable">{event.description}</p> | ||
)} | ||
{event.moderators && event.moderators.length > 0 && ( | ||
<ScheduleParticipants | ||
title="Moderators" | ||
participants={ | ||
event.moderators as ParticipantsProps['participants'] | ||
} | ||
/> | ||
)} | ||
{event.speakers && event.speakers.length > 0 && ( | ||
<ScheduleParticipants | ||
title="Speakers" | ||
participants={ | ||
event.speakers as ParticipantsProps['participants'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment here :) |
||
} | ||
/> | ||
)} | ||
</div> | ||
{event.url && ( | ||
<div className="mt-4"> | ||
<TextLink href={event.url}>View Details</TextLink> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</BasicCard> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react' | ||
|
||
import type { NonEmptyArray } from '@/types/utils' | ||
|
||
import type { Participant } from '../../../schemas/ScheduleSchema' | ||
|
||
export type ParticipantsProps = { | ||
title: string | ||
participants: NonEmptyArray<Participant> | ||
} | ||
|
||
export function ScheduleParticipants({ | ||
title, | ||
participants, | ||
}: ParticipantsProps) { | ||
return ( | ||
<p className="text-sm"> | ||
<span className="font-semibold">{title}:</span>{' '} | ||
<span>{participants.map(formatParticipant).join('; ')}</span> | ||
</p> | ||
) | ||
} | ||
|
||
function formatParticipant({ name, company }: Participant) { | ||
return `${name}, ${company}` | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UX improvement suggestion. I find mixing commas and semicolons hard to read, it's difficult to tell if word is a person’s name or a company name when scanning the text. Would that format be possible? I couldn't find a Figma design for this part so maybe this is already good to go. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like that! Yes, apologies, should've mentioned that there's no Figma design yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the list of participants cannot be empty, then it would be better to reflect in the schema instead of using an
as
type assertion hereSo here we would have:
And in the
EventSchema
we would have:What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, Yes! That's perfect. Thank you.