@@ -3,6 +3,7 @@ import { useState, useEffect, useRef, useCallback, useMemo } from "react"
33import type { RealtimeChannel } from "@supabase/supabase-js"
44import styled from "styled-components"
55import { motion } from "framer-motion"
6+ import Link from "next/link"
67import { PotionBackground } from "../components/PotionBackground"
78import { ErrorBoundary } from "../components/ErrorBoundary"
89import { Button } from "../components/Button"
@@ -66,6 +67,12 @@ export default function Doorbell() {
6667 setRingCount ( ( prev ) => prev + 1 )
6768 }
6869
70+ const handleCheckin = ( ) => {
71+ if ( nearestEvent ?. url ) {
72+ window . open ( nearestEvent . url , "_blank" )
73+ }
74+ }
75+
6976 useEffect ( ( ) => {
7077 const client = supabaseClient
7178 if ( ! client ) {
@@ -117,19 +124,19 @@ export default function Doorbell() {
117124 < Heading > Welcome to</ Heading >
118125 < Logo src = "/images/sd-devx-brand.png" alt = "DEVxSD" />
119126 </ HeadingSection >
120- < ParagraphSection >
121- < Paragraph > Ring the doorbell to enter the event.</ Paragraph >
122- </ ParagraphSection >
127+ < TermsSection >
128+ < TermsMessage >
129+ By attending the event, you agree to the event’s{ " " }
130+ < TermsLink href = "/event-terms" target = "_blank" rel = "noopener noreferrer" >
131+ Terms of Service
132+ </ TermsLink >
133+ .
134+ </ TermsMessage >
135+ </ TermsSection >
123136 { nearestEvent && (
124137 < ButtonSection >
125- < Button
126- href = { nearestEvent . url }
127- variant = "primary"
128- size = "default"
129- target = "_blank"
130- rel = "noopener noreferrer"
131- >
132- Get Your Ticket
138+ < Button variant = "primary" size = "default" onClick = { handleCheckin } >
139+ Check In
133140 </ Button >
134141 </ ButtonSection >
135142 ) }
@@ -203,7 +210,7 @@ const Hero = styled.section`
203210 flex-direction: column;
204211 align-items: center;
205212 justify-content: center;
206- gap: 3rem ;
213+ gap: 2rem ;
207214`
208215
209216const HeadingSection = styled . section `
@@ -228,15 +235,21 @@ const Logo = styled.img`
228235 margin: 0 auto;
229236`
230237
231- const ParagraphSection = styled . section `
238+ const TermsSection = styled . section `
239+ display: flex;
240+ flex-direction: column;
241+ align-items: center;
242+ justify-content: center;
243+ gap: 1rem;
232244 padding: 0 3rem;
233245`
234246
235- const Paragraph = styled . p `
236- font-size: 1.25rem ;
247+ const TermsMessage = styled . p `
248+ font-size: 1rem ;
237249 text-align: center;
238- max-width: 1024px ;
250+ max-width: 420px ;
239251 margin: 0;
252+ color: rgba(255, 255, 255, 0.7);
240253`
241254
242255const ButtonSection = styled . section `
@@ -278,7 +291,6 @@ const CallSection = styled.section`
278291 justify-content: center;
279292 gap: 1rem;
280293 padding: 0 3rem;
281- margin-top: 2rem;
282294`
283295
284296const CallMessage = styled . p `
@@ -288,6 +300,16 @@ const CallMessage = styled.p`
288300 color: white;
289301`
290302
303+ const TermsLink = styled ( Link ) `
304+ color: white;
305+ text-decoration: underline;
306+ transition: opacity 0.2s ease;
307+
308+ &:hover {
309+ opacity: 0.7;
310+ }
311+ `
312+
291313// Constants //
292314
293315type RingPayload = {
0 commit comments