Skip to content

Commit ee01a38

Browse files
authored
Attend page: Dynamic design for Attend Pricing (#1457)
1 parent e3352ab commit ee01a38

File tree

3 files changed

+65
-23
lines changed

3 files changed

+65
-23
lines changed

src/assets/css/style.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
@import "_css/faq.less";
1010
@import "_css/foundation.less";
1111
@import "_css/brand.less";
12+

src/components/Conf/Pricing/index.tsx

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@ interface Pricing {
66
title: string
77
date: string
88
price: string
9+
dateIsExpired: Date
910
}
1011

1112
const pricing: Pricing[] = [
1213
{
1314
title: "Early Bird",
1415
date: "Through May 31, 2023",
1516
price: "$599",
17+
dateIsExpired: new Date("2023-06-01"),
1618
},
1719
{
1820
title: "Standard",
1921
date: "Jun 1 - Sep 4, 2023",
2022
price: "$799",
23+
dateIsExpired: new Date("2023-09-05"),
2124
},
2225
{
2326
title: "Late/Onsite",
2427
date: "Sep 5 Through Event",
2528
price: "$899",
29+
dateIsExpired: new Date("2023-10-01"),
2630
},
2731
]
2832

29-
const includes = [
33+
const includes: { title: string }[] = [
3034
{
3135
title: "All conference content",
3236
},
@@ -47,36 +51,63 @@ const includes = [
4751
},
4852
]
4953

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+
51102
return (
52-
// Invisible padding so anchor links align to the header menu
53103
<div id="attend" className="-mt-16 pt-16">
54104
<div className="bg-[#171E26] container mb-6">
55105
<div className="flex flex-col text-center w-full">
56106
<h1 className="text-4xl text-white font-bold">Attend</h1>
57107
</div>
58108
<div className="mx-auto max-w-[80ch]">
59109
<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)}
80111
</div>
81112
<div className="my-8 flex justify-center">
82113
<ButtonConf href="https://cvent.me/4zbxz9">

src/pages/conf/faq.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,16 @@ const faq: Array<{ id: string; title: string; contents: ReactNode }> = [
657657
</a>{" "}
658658
and a member of our PR team will be in touch.
659659
</p>
660+
661+
<h3>Group Discounts</h3>
662+
<p>
663+
If you have a group of 5 or more people, you can receive a 10%
664+
discount on all passes. All pass types must be the same, and all
665+
registrations must be processed under one group registration and must
666+
be paid with the same credit card. To create a group, select “Add
667+
Another Person” to your registration. When 5 or more people are added
668+
the 10% discount will be automatically applied.
669+
</p>
660670
</>
661671
),
662672
},

0 commit comments

Comments
 (0)