@@ -6,27 +6,31 @@ interface Pricing {
6
6
title : string
7
7
date : string
8
8
price : string
9
+ dateIsExpired : Date
9
10
}
10
11
11
12
const pricing : Pricing [ ] = [
12
13
{
13
14
title : "Early Bird" ,
14
15
date : "Through May 31, 2023" ,
15
16
price : "$599" ,
17
+ dateIsExpired : new Date ( "2023-06-01" ) ,
16
18
} ,
17
19
{
18
20
title : "Standard" ,
19
21
date : "Jun 1 - Sep 4, 2023" ,
20
22
price : "$799" ,
23
+ dateIsExpired : new Date ( "2023-09-05" ) ,
21
24
} ,
22
25
{
23
26
title : "Late/Onsite" ,
24
27
date : "Sep 5 Through Event" ,
25
28
price : "$899" ,
29
+ dateIsExpired : new Date ( "2023-10-01" ) ,
26
30
} ,
27
31
]
28
32
29
- const includes = [
33
+ const includes : { title : string } [ ] = [
30
34
{
31
35
title : "All conference content" ,
32
36
} ,
@@ -47,36 +51,63 @@ const includes = [
47
51
} ,
48
52
]
49
53
50
- const PricingConf = ( ) => {
54
+ const PricingConf : React . FC = ( ) => {
55
+ const today = new Date ( )
56
+
57
+ const isExpired = ( expiredDate : Date ) : boolean => expiredDate < today
58
+
59
+ const renderPriceCard = ( pricing : Pricing , index : number ) => {
60
+ const expired = isExpired ( pricing . dateIsExpired )
61
+
62
+ const cardStyles = `block mx-auto w-64 p-6 overflow-hidden bg-[#2E343C] shadow-xl rounded-2xl focus:outline-none hover:drop-shadow-lg hover:scale-[102%] hover:no-underline focus:no-underline transition ease-in-out`
63
+ const expiredCardStyles = `block mx-auto w-64 p-6 overflow-hidden bg-[#474c52] shadow-xl rounded-2xl focus:outline-none hover:drop-shadow-lg hover:scale-[102%] hover:no-underline focus:no-underline transition ease-in-out cursor-not-allowed`
64
+
65
+ return (
66
+ < a
67
+ key = { index }
68
+ href = "https://cvent.me/4zbxz9"
69
+ target = "_blank"
70
+ className = { expired ? expiredCardStyles : cardStyles }
71
+ >
72
+ { expired && (
73
+ < div className = "flex justify-center mb-3" >
74
+ < div className = "inline-flex items-center rounded-md bg-gray-50 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10" >
75
+ Expired
76
+ </ div >
77
+ </ div >
78
+ ) }
79
+ < div
80
+ className = {
81
+ expired
82
+ ? "text-center text-3xl text-gray-300 font-bold mb-2 line-through"
83
+ : "text-center text-3xl text-white font-bold mb-2"
84
+ }
85
+ >
86
+ { pricing . title }
87
+ </ div >
88
+ < div className = "text-white text-center text-sm" > { pricing . date } </ div >
89
+ < div
90
+ className = {
91
+ expired
92
+ ? "text-[--rhodamine] opacity-60 mt-4 p-4 rounded-full text-center text-4xl font-extrabold line-through"
93
+ : "text-[--rhodamine] mt-4 p-4 rounded-full text-center text-4xl font-extrabold"
94
+ }
95
+ >
96
+ { pricing . price }
97
+ </ div >
98
+ </ a >
99
+ )
100
+ }
101
+
51
102
return (
52
- // Invisible padding so anchor links align to the header menu
53
103
< div id = "attend" className = "-mt-16 pt-16" >
54
104
< div className = "bg-[#171E26] container mb-6" >
55
105
< div className = "flex flex-col text-center w-full" >
56
106
< h1 className = "text-4xl text-white font-bold" > Attend</ h1 >
57
107
</ div >
58
108
< div className = "mx-auto max-w-[80ch]" >
59
109
< div className = "w-full grid grid-rows-1 md:grid-cols-3 gap-8 mt-8" >
60
- { pricing . map ( ( pricing , i ) => (
61
- < a
62
- key = { i }
63
- href = "https://cvent.me/4zbxz9"
64
- target = "_blank"
65
- className = "block mx-auto w-64 p-6 overflow-hidden bg-[#2E343C] shadow-xl rounded-2xl focus:outline-none hover:drop-shadow-lg hover:scale-[102%] hover:no-underline focus:no-underline transition ease-in-out"
66
- >
67
- < div >
68
- < div className = "text-center text-3xl text-white font-bold mb-2" >
69
- { pricing . title }
70
- </ div >
71
- < div className = "text-white text-center text-sm" >
72
- { pricing . date }
73
- </ div >
74
- < div className = "text-[--rhodamine] mt-4 p-4 rounded-full text-center text-4xl font-extrabold" >
75
- { pricing . price }
76
- </ div >
77
- </ div >
78
- </ a >
79
- ) ) }
110
+ { pricing . map ( renderPriceCard ) }
80
111
</ div >
81
112
< div className = "my-8 flex justify-center" >
82
113
< ButtonConf href = "https://cvent.me/4zbxz9" >
0 commit comments