From 5899fc0b0f9512c5a761aa37696c367f58f40ad9 Mon Sep 17 00:00:00 2001 From: Ella Date: Fri, 9 Dec 2022 21:50:47 -0500 Subject: [PATCH] Filter out invalid RSVPs --- components/winter/landing.js | 32 +++++++++++++++++++++++++++++++- pages/winter.js | 7 ++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/components/winter/landing.js b/components/winter/landing.js index 27b32eed..00b7d728 100644 --- a/components/winter/landing.js +++ b/components/winter/landing.js @@ -9,6 +9,35 @@ import Rsvp from './rsvp' import ScrollHint from '../scroll-hint' import useSWR from 'swr' import fetcher from '../../lib/fetcher' +import { keyframes } from '@emotion/react' + +const flashing = keyframes({ + from: { opacity: 0 }, + '50%': { opacity: 1 }, + to: { opacity: 0 } +}) + +function Dot() { + return ( + + ) +} export default function Landing({ rsvpCount }) { // useEffect(() => { @@ -84,7 +113,8 @@ export default function Landing({ rsvpCount }) { // fontSize: ['18px', '20px', '24px'] }} > - {rsvpCount} more RSVPs till the start of a hacker's + + {rsvpCount} more RSVPs till the start of a hacker's diff --git a/pages/winter.js b/pages/winter.js index dbe2598f..5eed2717 100644 --- a/pages/winter.js +++ b/pages/winter.js @@ -34,6 +34,10 @@ export function Winter() { fetcher, { refreshInterval: 1000 } ) + + const rsvpCount = rsvps + ? rsvps.filter(rsvp => rsvp.fields.Status === 'rsvp').length + : 100 // arbitrary fallback number return ( <> @@ -46,7 +50,8 @@ export function Winter() {