|
| 1 | +import Countdown from "react-countdown"; |
| 2 | +import React, { FC } from "react"; |
| 3 | +import { SectionWrapper } from "@components/SectionWrapper/SectionWrapper"; |
| 4 | +import TimeCountDown from "./components/TimeCountdown"; |
| 5 | +import { useWindowSize } from "react-use"; |
| 6 | +import { useDateInterval } from "@hooks/useDateInterval"; |
| 7 | +// @ts-expect-error some quirky import |
| 8 | +import { motion } from "motion/react"; |
| 9 | +import { |
| 10 | + StyledDevBcnLogo, |
| 11 | + StyledHomeImage, |
| 12 | + StyledLogoDiv, |
| 13 | + StyledSubtitle, |
| 14 | + StyledTitle, |
| 15 | + StyledTitleContainer, |
| 16 | + StyleHomeContainer, |
| 17 | +} from "./Style.Home"; |
| 18 | +import ActionButtons from "../ActionButtons/ActionButtons"; |
| 19 | +import { Color } from "@styles/colors"; |
| 20 | +import InfoButtons from "../InfoButtons/InfoButtons"; |
| 21 | +import { formatDateRange } from "./DateUtil"; |
| 22 | +import { Link } from "react-router"; |
| 23 | +import edition from "@data/2026.json"; |
| 24 | +import CountDownCompleted from "./components/CountDownCompleted"; |
| 25 | + |
| 26 | +const HomeWTC: FC<React.PropsWithChildren<unknown>> = () => { |
| 27 | + const { width } = useWindowSize(); |
| 28 | + const { isTicketsDisabled, isSponsorDisabled, isCfpDisabled } = |
| 29 | + useDateInterval(new Date(), edition); |
| 30 | + |
| 31 | + return ( |
| 32 | + <StyledHomeImage> |
| 33 | + <SectionWrapper color="transparent"> |
| 34 | + <StyleHomeContainer> |
| 35 | + <StyledLogoDiv |
| 36 | + initial={{ opacity: 0, scale: 0.5 }} |
| 37 | + animate={{ opacity: 1, scale: 1 }} |
| 38 | + transition={{ duration: 0.8 }} |
| 39 | + > |
| 40 | + <StyledDevBcnLogo src="images/logo.png" alt="DevBcn logo" /> |
| 41 | + </StyledLogoDiv> |
| 42 | + <StyledTitleContainer color={Color.TRANSPARENT} |
| 43 | + initial={{ opacity: 0, y: 50 }} |
| 44 | + animate={{ opacity: 1, y: 0 }} |
| 45 | + transition={{ duration: 0.6, delay: 0.3 }} |
| 46 | + > |
| 47 | + <StyledTitle |
| 48 | + initial={{ opacity: 0 }} |
| 49 | + animate={{ opacity: 1 }} |
| 50 | + transition={{ duration: 0.5, delay: 0.6 }} |
| 51 | + > |
| 52 | + The Barcelona Developers Conference {edition?.edition} |
| 53 | + </StyledTitle> |
| 54 | + <StyledSubtitle fontWeight={600} |
| 55 | + initial={{ opacity: 0 }} |
| 56 | + animate={{ opacity: 1 }} |
| 57 | + transition={{ duration: 0.5, delay: 0.8 }} |
| 58 | + > |
| 59 | + {edition?.trackNumber} tracks with the following topics: <br /> |
| 60 | + {edition?.tracks} |
| 61 | + </StyledSubtitle> |
| 62 | + <StyledSubtitle shadow={true} |
| 63 | + initial={{ opacity: 0 }} |
| 64 | + animate={{ opacity: 1 }} |
| 65 | + transition={{ duration: 0.5, delay: 1 }} |
| 66 | + > |
| 67 | + <small> |
| 68 | + Past events: <Link to="/2025">2025 edition</Link> |{" "} |
| 69 | + <Link to="/2024">2024 edition</Link> |{" "} |
| 70 | + <Link to="/2023">2023 edition</Link> |
| 71 | + </small> |
| 72 | + </StyledSubtitle> |
| 73 | + </StyledTitleContainer> |
| 74 | + <motion.img |
| 75 | + src="/images/devBcn-sponsorship.png" |
| 76 | + alt="DevBcn sponsorship value" |
| 77 | + width="635" |
| 78 | + height="125" |
| 79 | + style={{ aspectRatio: "127:25", maxWidth: "100%" }} |
| 80 | + initial={{ opacity: 0, x: -50 }} |
| 81 | + animate={{ opacity: 1, x: 0 }} |
| 82 | + transition={{ duration: 0.7, delay: 1.2 }} |
| 83 | + /> |
| 84 | + <StyledTitleContainer |
| 85 | + color={Color.TRANSPARENT} |
| 86 | + initial={{ opacity: 0, y: 30 }} |
| 87 | + animate={{ opacity: 1, y: 0 }} |
| 88 | + transition={{ duration: 0.6, delay: 1.5 }} |
| 89 | + > |
| 90 | + <StyledSubtitle fontWeight={600}> |
| 91 | + {edition?.startDay && |
| 92 | + edition.endDay && |
| 93 | + formatDateRange( |
| 94 | + new Date(edition.startDay), |
| 95 | + new Date(edition.endDay), |
| 96 | + )} |
| 97 | + </StyledSubtitle> |
| 98 | + <StyledSubtitle fontWeight={600}> |
| 99 | + World Trade Center, Barcelona |
| 100 | + </StyledSubtitle> |
| 101 | + </StyledTitleContainer> |
| 102 | + <motion.div |
| 103 | + initial={{ opacity: 0, scale: 0.9 }} |
| 104 | + animate={{ opacity: 1, scale: 1 }} |
| 105 | + transition={{ duration: 0.8, delay: 1.8 }} |
| 106 | + > |
| 107 | + <Countdown |
| 108 | + date={edition?.startDay} |
| 109 | + onComplete={CountDownCompleted} |
| 110 | + renderer={TimeCountDown} |
| 111 | + /> |
| 112 | + </motion.div> |
| 113 | + {edition?.actionButtons && ( |
| 114 | + <ActionButtons |
| 115 | + isTicketsDisabled={isTicketsDisabled} |
| 116 | + isCfpDisabled={isCfpDisabled} |
| 117 | + isSponsorDisabled={isSponsorDisabled} |
| 118 | + ticketsStartDay={edition.tickets.startDay} |
| 119 | + cfpStartDay={edition.cfp.startDay} |
| 120 | + cfpLink={edition.cfp.link} |
| 121 | + edition={edition.edition} |
| 122 | + /> |
| 123 | + )} |
| 124 | + {edition?.showInfoButtons && <InfoButtons />} |
| 125 | + </StyleHomeContainer> |
| 126 | + </SectionWrapper> |
| 127 | + </StyledHomeImage> |
| 128 | + ); |
| 129 | +}; |
| 130 | + |
| 131 | +export default HomeWTC; |
0 commit comments