@@ -4,37 +4,67 @@ import { useFavorites } from './store.hooks';
44import NoEventsImage from 'lib/components/event-schedule-new/images/404.png' ;
55import moment from 'moment' ;
66import Image from 'next/image' ;
7+ import Button from 'lib/components/voxel-button/button' ;
8+ import { useUnifiedConnection } from '@/hooks/useUnifiedConnection' ;
9+ import { useNow } from 'lib/hooks/useNow' ;
10+ import { useState } from 'react' ;
711
812export function WelcomeSection ( ) {
13+ // const { email } = useUnifiedConnection();
14+ const now = useNow ( ) ;
15+ const dummyEmail = 'example.eth' ;
16+ const buenosAiresTime = moment ( now ) . utc ( ) . subtract ( 3 , 'hours' ) ;
17+ const formattedDate = buenosAiresTime . format ( 'h:mm A' ) ;
18+
919 return (
10- < div className = "flex flex-col items-start justify-start gap-2" >
11- < div className = "text-2xl font-semibold bg-clip-text text-transparent bg-[linear-gradient(90.78deg,#F6B40E_2.23%,#FF85A6_25.74%,#74ACDF_86.85%)]" >
12- ¡Buen dia!
20+ < div className = "flex flex-col items-start justify-start gap-2 mb-4" >
21+ < div className = "flex justify-between w-full gap-2" >
22+ < div className = "text-2xl font-semibold bg-clip-text text-transparent bg-[linear-gradient(90.78deg,#F6B40E_2.23%,#FF85A6_25.74%,#74ACDF_86.85%)]" >
23+ ¡Buen dia!
24+ </ div >
25+ < div className = "font-semibold text-sm" >
26+ { formattedDate } Buenos Aires (GMT-3)
27+ </ div >
1328 </ div >
14- < div className = "text-2xl font-bold" > John Nethereum </ div >
15- < div > Welcome to the Ethereum World's Fair!</ div >
29+ < div className = "text-xl font-bold" > { dummyEmail } </ div >
30+ < div > Welcome to the Ethereum World's Fair! </ div >
1631 </ div >
1732 ) ;
1833}
1934
2035export function TodaysSchedule ( { atprotoEvents } : { atprotoEvents : any [ ] } ) {
2136 const [ favorites ] = useFavorites ( ) ;
37+ const [ selectedEvent , setSelectedEvent ] = useState < any > ( null ) ;
2238 const events = atprotoEvents . filter ( ( event ) =>
2339 favorites . includes ( event . id . toString ( ) )
2440 ) ;
2541
2642 const hasEventsToShow = events . length > 0 ;
2743
2844 return (
29- < div className = "flex flex-col items-start justify-start gap-2 p-4 bg-white border border-[rgba(234,234,234,1)]" >
30- < div className = "flex w-full items-start justify-between gap-2" >
45+ < div className = "flex flex-col items-start justify-start gap-2 p-4 pt-3 bg-white border border-[rgba(234,234,234,1)]" >
46+ < div className = "flex w-full items-center justify-between gap-2" >
3147 < p className = "font-semibold" > Today's Schedule</ p >
32- < p className = "text-xs" > { moment ( ) . format ( 'dddd, D MMMM' ) } </ p >
48+ { /* <p className="text-xs">{moment().format('dddd, D MMMM')}</p> */ }
3349 </ div >
34- < p className = "text-xs" >
50+ < p className = "text-xs mb-2 " >
3551 These are your recommended events for today. Build your own schedule by
3652 adding events to your favorites.
3753 </ p >
54+
55+ { selectedEvent && (
56+ < div className = "flex flex-col items-center justify-center gap-2 w-full" >
57+ < Event
58+ event = { selectedEvent }
59+ selectedEvent = { selectedEvent }
60+ setSelectedEvent = { setSelectedEvent }
61+ setExports = { ( ) => { } }
62+ className = "w-full"
63+ isDialog
64+ />
65+ </ div >
66+ ) }
67+
3868 { hasEventsToShow && (
3969 < div className = "flex flex-col items-stretch gap-2 w-full" >
4070 { events . map ( ( event ) => (
@@ -43,18 +73,26 @@ export function TodaysSchedule({ atprotoEvents }: { atprotoEvents: any[] }) {
4373 key = { event . id }
4474 event = { event }
4575 className = "w-full"
46- selectedEvent = { null }
47- setSelectedEvent = { ( ) => { } }
76+ selectedEvent = { selectedEvent }
77+ setSelectedEvent = { setSelectedEvent }
4878 setExports = { ( ) => { } }
4979 />
5080 ) ) }
5181 </ div >
5282 ) }
5383 { ! hasEventsToShow && (
54- < div className = "flex flex-col items-center justify-center gap-2 w-full" >
55- < Image src = { NoEventsImage } alt = "No events" className = "w-full" />
84+ < div className = "flex flex-col items-center justify-center gap-2 w-full " >
85+ < Image
86+ src = { NoEventsImage }
87+ alt = "No events"
88+ className = "w-full max-w-[400px]"
89+ />
5690 </ div >
5791 ) }
92+
93+ < Button size = "sm" className = "w-full md:w-auto self-start mt-2" >
94+ View full Schedule
95+ </ Button >
5896 </ div >
5997 ) ;
6098}
0 commit comments