1
1
import { Button } from "@/app/conf/_design-system/button"
2
2
import { clsx } from "clsx"
3
+ import { GET_TICKETS_LINK } from "../../links"
3
4
4
5
export interface TicketPeriodProps {
5
6
price : string
6
- date : string
7
+ date : Date | [ Date , Date ]
7
8
disabled ?: boolean
8
9
name : string
9
10
}
@@ -17,24 +18,56 @@ export function TicketPeriod({
17
18
return (
18
19
< article
19
20
className = { clsx (
20
- "flex flex-col backdrop-blur-md [container-type:inline-size]" ,
21
- ! disabled
22
- ? "border border-pink-200 bg-pri-dark/[0.24]"
23
- : "border-r border-pink-200/50 bg-white/[0.12] last:border-r-0" ,
21
+ "@container/card flex flex-col border border-pri-lighter bg-pri-light/[0.24] backdrop-blur-md transition [&+&]:border-l-0" ,
22
+ disabled && "opacity-50" ,
24
23
) }
25
24
>
26
- < header className = "p-6" >
25
+ < header className = "border-b border-pri-lighter p-6" >
27
26
< h3 className = "text-white typography-h3" > { name } </ h3 >
28
27
</ header >
29
- < div className = "flex flex-col gap-6 p-6 pt-0 " >
28
+ < div className = "flex h-full flex-col justify-end gap-6 p-6" >
30
29
< div className = "flex items-end justify-between gap-2" >
31
- < span className = "text-white typography-h2" > { price } </ span >
32
- < span className = "text-white typography-body-md" > { date } </ span >
30
+ < span className = "@[356px]:typography-h2 text-white typography-h3" >
31
+ { price }
32
+ </ span >
33
+ { /* eslint-disable-next-line tailwindcss/no-custom-classname */ }
34
+ < span className = "ticket-period--date text-right text-white typography-body-md" >
35
+ { Array . isArray ( date ) ? (
36
+ < >
37
+ < Time date = { date [ 0 ] } />
38
+ { " - " }
39
+ < Time date = { date [ 1 ] } />
40
+ </ >
41
+ ) : (
42
+ < Time date = { date } />
43
+ ) }
44
+ </ span >
33
45
</ div >
34
- < Button variant = "primary" disabled = { disabled } className = "w-full" >
46
+ < Button
47
+ variant = "primary"
48
+ disabled = { disabled }
49
+ className = "light w-full"
50
+ href = { GET_TICKETS_LINK }
51
+ >
35
52
Get a ticket
36
53
</ Button >
37
54
</ div >
38
55
</ article >
39
56
)
40
57
}
58
+
59
+ function Time ( { date } : { date : Date } ) {
60
+ return (
61
+ < time
62
+ dateTime = { date . toISOString ( ) }
63
+ dangerouslySetInnerHTML = { {
64
+ __html : date
65
+ . toLocaleDateString ( "en-GB" , {
66
+ month : "long" ,
67
+ day : "numeric" ,
68
+ } )
69
+ . replace ( " " , " " ) ,
70
+ } }
71
+ />
72
+ )
73
+ }
0 commit comments