Skip to content

Commit c9110b0

Browse files
committed
🎨 promotions tweak
1 parent c25067e commit c9110b0

3 files changed

Lines changed: 33 additions & 81 deletions

File tree

web/core/Carousel/Carousel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ const [scrollPosition, setScrollPosition] = useState<'start' | 'middle' | 'end'>
442442
h-fit
443443
overflow-x-auto
444444
snap-x
445-
pb-1`
445+
pb-2`
446446

447447
const commonSingleListContainerClassName = `
448448
grid

web/core/Promotion/Promotion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export const Promotion = forwardRef<HTMLAnchorElement, PromotionProps>(
101101
const _layoutDirection = type === 'extended' ? 'col' : layoutDirection
102102

103103
const paddingOnTypes: Record<PromotionType, string> = {
104-
compact: _layoutDirection === 'col' ? 'p-4' : 'py-4 pr-3 pl-4',
104+
compact: _layoutDirection === 'col' ? 'px-6 pt-6 pb-8' : 'py-4 pr-3 pl-4',
105105
extended: 'pt-6 md:pt-8 pb-6 px-6',
106106
}
107107
const layoutOnTypes: Record<PromotionType, string> = {

web/sections/cards/EventCard/EventCard.tsx

Lines changed: 31 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useFormatter, useTranslations } from 'next-intl'
77
import { forwardRef, type HTMLAttributes } from 'react'
88
import { twMerge } from 'tailwind-merge'
99
import FormattedDateTime, {
10+
DateIcon,
1011
TimeIcon,
1112
} from '@/core/FormattedDateTime/FormattedDateTime'
1213
import { BaseLink } from '@/core/Link/BaseLink'
@@ -77,9 +78,6 @@ const EventCard = forwardRef<HTMLDivElement, EventCardProps>(function EventCard(
7778
const { dayTime: endDayTime, overrideTimeLabel: endTimeLabel } =
7879
endDayAndTime || {}
7980
const plainTitle = title ? toPlainText(title as PortableTextBlock[]) : ''
80-
const t = useTranslations()
81-
82-
console.log('Event card startTimeLabel', startTimeLabel)
8381

8482
const variantClassName: Partial<Record<Variants, string>> = {
8583
default: '',
@@ -95,58 +93,7 @@ const EventCard = forwardRef<HTMLDivElement, EventCardProps>(function EventCard(
9593
className,
9694
)}
9795
>
98-
<div className='flex items-end text-xs'>
99-
{!startDayTime && (start || eventDate?.date) && (
100-
<FormattedDateTime
101-
variant='date'
102-
datetime={start ?? eventDate?.date}
103-
className='text-sm'
104-
timeClassName='leading-none'
105-
/>
106-
)}
107-
{(startDayTime || endDayTime) && (
108-
<>
109-
<time
110-
dateTime={startDayTime.toLocaleString()}
111-
className='leading-none'
112-
>
113-
{`${
114-
endDayTime
115-
? formatter
116-
.dateTime(new Date(startDayTime), {
117-
year: 'numeric',
118-
month: 'short',
119-
day: '2-digit',
120-
})
121-
.split(' ')
122-
.slice(0, 2)
123-
.join(' ')
124-
: formatter.dateTime(new Date(startDayTime), {
125-
year: 'numeric',
126-
month: 'long',
127-
day: '2-digit',
128-
})
129-
}`}
130-
</time>
131-
{endDayTime && (
132-
<>
133-
<span className='flex items-end px-1 leading-none'>-</span>
134-
<time
135-
dateTime={endDayTime.toLocaleString()}
136-
className='leading-none'
137-
>
138-
{formatter.dateTime(new Date(endDayTime), {
139-
year: 'numeric',
140-
month: 'short',
141-
day: '2-digit',
142-
})}
143-
</time>
144-
</>
145-
)}
146-
</>
147-
)}
148-
</div>
149-
<BaseLink href={slug} className='mt-4 mb-4 hover:underline'>
96+
<BaseLink href={slug} className='mb-6 hover:underline'>
15097
<Blocks
15198
value={title}
15299
as={hasSectionTitle ? 'h3' : 'h2'}
@@ -155,19 +102,22 @@ const EventCard = forwardRef<HTMLDivElement, EventCardProps>(function EventCard(
155102
/>
156103
</BaseLink>
157104

158-
<div className={`flex grow flex-col justify-end`}>
159-
{/* {!startDayTime && (start || eventDate?.date) && (
160-
<div className='h-full py-2'>
105+
<div
106+
className={`flex w-fit grow flex-col justify-end divide-y divide-autumn-storm-60 *:pt-2 *:pr-8 *:pb-2 *:first:pt-0 *:last:pb-0`}
107+
>
108+
{!startDayTime && (start || eventDate?.date) && (
109+
<div className=''>
161110
<FormattedDateTime
162111
variant='date'
163112
dateIcon={true}
164113
datetime={start ?? eventDate?.date}
165-
className='text-xs'
114+
className='text-sm'
115+
timeClassName='leading-none'
166116
/>
167117
</div>
168-
)} */}
169-
{/* {(startDayTime || endDayTime) && (
170-
<div className='flex h-full items-end gap-2 py-2 text-xs'>
118+
)}
119+
{(startDayTime || endDayTime) && (
120+
<div className='flex items-end gap-2 text-sm'>
171121
<DateIcon />
172122
<time
173123
dateTime={startDayTime.toLocaleString()}
@@ -193,7 +143,7 @@ const EventCard = forwardRef<HTMLDivElement, EventCardProps>(function EventCard(
193143
</time>
194144
{endDayTime && (
195145
<>
196-
<span className=''>-</span>
146+
<span className='leading-none'>-</span>
197147
<time
198148
dateTime={endDayTime.toLocaleString()}
199149
className='leading-none'
@@ -207,9 +157,9 @@ const EventCard = forwardRef<HTMLDivElement, EventCardProps>(function EventCard(
207157
</>
208158
)}
209159
</div>
210-
)} */}
160+
)}
211161
{startDayTime && startTimeLabel !== '-' && (
212-
<div className='flex items-end gap-2 py-2 text-xs'>
162+
<div className='flex items-end gap-2 text-sm'>
213163
<TimeIcon />
214164
{startTimeLabel
215165
? startTimeLabel
@@ -225,42 +175,44 @@ const EventCard = forwardRef<HTMLDivElement, EventCardProps>(function EventCard(
225175
)}
226176

227177
{!startDayAndTime && start && end && (
228-
<div className={`flex items-start gap-1 py-2`}>
178+
<div className={`flex items-end gap-1`}>
229179
<FormattedDateTime
230180
variant='time'
231181
timeIcon={true}
232182
datetime={start}
233-
className='text-xs'
183+
className='text-sm'
184+
timeClassName='leading-none'
234185
/>
235186
<span>-</span>
236187
<FormattedDateTime
237188
variant='time'
238189
datetime={end}
239190
showTimezone
240-
className='text-xs'
191+
className='text-sm'
192+
timeClassName='leading-none'
241193
/>
242194
</div>
243195
)}
244196
{location && (
245-
<div className={`flex items-center gap-2 py-2`}>
197+
<div className={`flex items-start gap-2`}>
246198
<Icon
247199
data={world}
248200
color={'currentColor'}
249201
className='text-2xs text-norwegian-woods-100'
250202
/>
251-
<div className='mt-1 flex text-sm'>{location}</div>
203+
<div className='mt-1 flex text-sm leading-none'>{location}</div>
252204
</div>
253205
)}
254-
{variant === 'single' && ingress && (
255-
<Blocks
256-
group='card'
257-
variant='ingress'
258-
value={ingress}
259-
blockClassName='pt-2 pb-3'
260-
/>
261-
)}
262206
</div>
263-
<div className='mt-auto'>
207+
{variant === 'single' && ingress && (
208+
<Blocks
209+
group='card'
210+
variant='ingress'
211+
value={ingress}
212+
blockClassName='pt-6'
213+
/>
214+
)}
215+
<div className='mt-auto pt-8'>
264216
<AddToCalendar
265217
eventDate={eventDate}
266218
startDateTime={startDayTime}

0 commit comments

Comments
 (0)