import { Card, Box, Flex, Grid, Heading, Image, Text } from 'theme-ui'
import Meta from '@hackclub/meta'
import Head from 'next/head'
import Nav from '../components/nav'
import BGImg from '../components/background-image'
import Footer from '../components/footer'
import ForceTheme from '../components/force-theme'
import StickerForm from '../components/stickers/request-form'
import fs from 'fs'
import path from 'path'
import { startCase } from 'lodash'
const color = '#EC37AD'
function customStartCase(st) {
return st
.replace(/\.(svg|png)$/, '')
.replace(/[_-]+/g, ' ')
.replace(/\b\w/g, char => char.toUpperCase());
}
const StickersPage = ({ stickers = [] }) => [
({
color: 'primary',
...theme.util.gxText(color, 'red'),
mt: [3, 4]
})}
>
Unparalleled stickers.
Every Hack Club gets free, high-quality stickers.
Gotta collect ‘em all.
{stickers.map(st => (
{customStartCase(st)}
))}
{/*
Request a free envelope
*/}
,
]
export default StickersPage
export const getStaticProps = () => {
const stickersDir = path.join(process.cwd(), 'public', 'stickers')
const stickers = fs
.readdirSync(stickersDir)
.filter(sticker => sticker !== 'hero.jpg')
return { props: { stickers } }
}