Skip to content

Commit 3ba3885

Browse files
committed
Move end time into cards in blocks with different end times
1 parent 144ef1a commit 3ba3885

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/app/conf/2025/schedule/_components/schedule-list.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ export function ScheduleList({
223223
blockEnd.getTime() === nextBlockStart?.getTime() &&
224224
!isBreak
225225

226+
const endTimesDiffer = sessions.some(
227+
session =>
228+
new Date(session.event_end).getTime() !==
229+
blockEnd.getTime(),
230+
)
231+
226232
return (
227233
<div
228234
key={`concurrent sessions on ${sessionDate}`}
@@ -231,7 +237,10 @@ export function ScheduleList({
231237
<div className="mr-px flex flex-col max-lg:ml-px lg:flex-row">
232238
<div className="relative border-neu-50 bg-neu-50 dark:bg-neu-0 max-lg:-mx-px max-lg:my-px max-lg:border-x lg:mr-px">
233239
<span className="typography-body-sm mt-3 inline-block w-28 whitespace-nowrap pb-0.5 pl-4 lg:mr-6 lg:pb-4 lg:pl-0">
234-
{formatBlockTime(sessionDate, blockEnd)}
240+
{formatBlockTime(
241+
sessionDate,
242+
endTimesDiffer ? undefined : blockEnd,
243+
)}
235244
</span>
236245
</div>
237246
<div className="relative flex w-full flex-col items-end gap-px lg:flex-row lg:items-start">
@@ -242,6 +251,7 @@ export function ScheduleList({
242251
year={year}
243252
eventsColors={eventsColors}
244253
blockEnd={blockEnd}
254+
durationVisible={endTimesDiffer}
245255
/>
246256
))}
247257
</div>

src/app/conf/2025/schedule/_components/schedule-session-card.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ export function ScheduleSessionCard({
3030
year,
3131
eventsColors,
3232
blockEnd,
33+
durationVisible,
3334
}: {
3435
session: ScheduleSession
3536
year: `202${number}`
3637
eventsColors: Record<string, string>
3738
blockEnd: Date
39+
durationVisible: boolean
3840
}) {
3941
let eventType = session.event_type
4042

@@ -140,10 +142,7 @@ export function ScheduleSessionCard({
140142
{session.venue}
141143
</span>
142144
)}
143-
<SessionDuration
144-
session={session}
145-
blockTimeFraction={blockTimeFraction}
146-
/>
145+
{durationVisible && <SessionDuration session={session} />}
147146
<AddToCalendarLink
148147
eventTitle={eventTitle}
149148
session={session}
@@ -160,13 +159,9 @@ export function ScheduleSessionCard({
160159

161160
function SessionDuration({
162161
session,
163-
blockTimeFraction,
164162
}: {
165163
session: ScheduleSession
166-
blockTimeFraction: number
167164
}): React.ReactNode {
168-
if (blockTimeFraction >= 1) return null
169-
170165
const durationMs =
171166
new Date(session.event_end).getTime() -
172167
new Date(session.event_start).getTime()

0 commit comments

Comments
 (0)