Clean up calendar header

This commit is contained in:
Jon Staab
2025-03-17 09:53:14 -07:00
parent 75905e4652
commit 1d56a2193d
6 changed files with 29 additions and 28 deletions
+5 -3
View File
@@ -13,7 +13,9 @@
</script>
<div
class="flex h-14 w-14 flex-col items-center justify-center gap-1 rounded-box border border-solid border-base-content p-2 sm:h-24 sm:w-24">
<span class="sm:text-lg">{Intl.DateTimeFormat(LOCALE, {month: "short"}).format(startDate)}</span>
<span class="sm:text-4xl">{Intl.DateTimeFormat(LOCALE, {day: "numeric"}).format(startDate)}</span>
class="hidden h-32 w-32 min-w-32 flex-col items-center justify-center gap-1 rounded-box bg-base-300 p-2 sm:flex">
<strong>{Intl.DateTimeFormat(LOCALE, {month: "short"}).format(startDate)}</strong>
<span class="text-4xl">{Intl.DateTimeFormat(LOCALE, {day: "numeric"}).format(startDate)}</span>
<span class="text-xs opacity-75"
>{Intl.DateTimeFormat(LOCALE, {weekday: "long"}).format(startDate)}</span>
</div>
@@ -17,8 +17,13 @@
const isSingleDay = $derived(startDateDisplay === endDateDisplay)
</script>
<p class="text-xl">{meta.title || meta.name}</p>
<div class="flex items-center gap-2 text-sm">
<Icon icon="clock-circle" size={4} />
{formatTimestampAsTime(start)}{isSingleDay ? formatTimestampAsTime(end) : formatTimestamp(end)}
<div class="flex flex-grow flex-wrap justify-between gap-2">
<p class="text-xl">{meta.title || meta.name}</p>
<div class="flex items-center gap-2 text-sm">
<Icon icon="clock-circle" size={4} />
<span class="sm:hidden">{formatTimestampAsDate(start)}</span>
{formatTimestampAsTime(start)}{isSingleDay
? formatTimestampAsTime(end)
: formatTimestamp(end)}
</div>
</div>
+1 -3
View File
@@ -15,9 +15,7 @@
</script>
<Link class="col-3 card2 bg-alt w-full cursor-pointer" href={makeCalendarPath(url, event.id)}>
<div class="flex items-center justify-between gap-2">
<CalendarEventHeader {event} />
</div>
<CalendarEventHeader {event} />
<div class="flex w-full flex-col items-end justify-between gap-2 sm:flex-row">
<span class="whitespace-nowrap py-1 text-sm opacity-75">
Posted by <ProfileLink pubkey={event.pubkey} />
+10 -8
View File
@@ -12,13 +12,15 @@
const meta = $derived(fromPairs(event.tags) as Record<string, string>)
</script>
<span>
Posted by <ProfileLink pubkey={event.pubkey} />
</span>
{#if meta.location}
<span></span>
<div class="flex min-w-0 flex-col gap-1 text-sm opacity-75">
<span class="flex items-center gap-1">
<Icon icon="map-point" size={4} />
{meta.location}
<Icon icon="user-circle" size={4} />
Posted by <ProfileLink pubkey={event.pubkey} />
</span>
{/if}
{#if meta.location}
<span class="ellipsize flex items-center gap-1 whitespace-nowrap">
<Icon icon="map-point" size={4} />
{meta.location}
</span>
{/if}
</div>
+1 -3
View File
@@ -12,9 +12,7 @@
<div class="flex items-start gap-4">
<CalendarEventDate event={props.event} />
<div class="flex flex-grow flex-col">
<div class="flex flex-grow flex-wrap justify-between gap-2">
<CalendarEventHeader event={props.event} />
</div>
<CalendarEventHeader event={props.event} />
<div class="flex py-2 opacity-50">
<div class="h-px flex-grow bg-base-content opacity-25"></div>
</div>
@@ -83,13 +83,9 @@
<div class="card2 bg-alt col-3 z-feature">
<div class="flex items-start gap-4">
<CalendarEventDate event={$event} />
<div class="flex flex-grow flex-col">
<div class="flex flex-grow justify-between gap-2">
<CalendarEventHeader event={$event} />
</div>
<div class="flex items-center gap-2 text-sm opacity-75">
<CalendarEventMeta event={$event} />
</div>
<div class="flex min-w-0 flex-grow flex-col gap-1">
<CalendarEventHeader event={$event} />
<CalendarEventMeta event={$event} />
<div class="flex py-2 opacity-50">
<div class="h-px flex-grow bg-base-content opacity-25"></div>
</div>