import Ticker from 'react-ticker'
import {
Box,
Card,
Text,
Heading,
Badge,
Container,
Image,
Link
} from 'theme-ui'
import { useState } from 'react'
import { keyframes } from '@emotion/react'
import Tilt from '../tilt'
import NextLink from 'next/link'
import PageVisibility from 'react-page-visibility'
import { formatAddress } from '../../lib/helpers'
export default function ScrollingHackathons({
eventData,
mode,
title,
...props
}) {
const [pageIsVisible, setPageIsVisible] = useState(true)
const handleVisibilityChange = isVisible => {
setPageIsVisible(isVisible)
}
return (
<>
{title ? (
Join other high-schoolers at an upcoming hackathon.
from{' '}
hackathons.hackclub.com
, last updated just now.
) : (
<>>
)}
{pageIsVisible && (
{() => (
{eventData.map(({ ...props }) => (
))}
)}
)}
>
)
}
const flashing = keyframes({
from: { opacity: 0 },
'50%': { opacity: 1 },
to: { opacity: 0 }
})
function Dot() {
return (
)
}
function EventCard({
name,
website,
start,
end,
city,
state,
country,
countryCode,
banner,
logo,
virtual,
hybrid,
footer
}) {
return (
{virtual ? 'Online' : hybrid ? 'Hybrid' : 'In-Person'}
{logo && (
)}
{name}
{footer ? (
footer
) : (
<>
{!virtual && (
{formatAddress(city, state, country, countryCode)}
)}
>
)}
{virtual
? 'https://schema.org/OnlineEventAttendanceMode'
: 'https://schema.org/OfflineEventAttendanceMode'}
{website}
{start}
{end}
)
}