mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
removed sprig consoleCount for shawn
This commit is contained in:
parent
c8e61558c3
commit
524cdb5197
3 changed files with 1 additions and 44 deletions
|
|
@ -5,7 +5,7 @@ import Tilt from '../../tilt'
|
|||
|
||||
/** @jsxImportSource theme-ui */
|
||||
|
||||
export default function SprigConsole({ stars, consoleCount }) {
|
||||
export default function SprigConsole({ stars }) {
|
||||
return (
|
||||
<Box sx={{ position: 'relative' }}>
|
||||
<CardModel
|
||||
|
|
@ -47,23 +47,6 @@ export default function SprigConsole({ stars, consoleCount }) {
|
|||
}}
|
||||
alt="Sprig console"
|
||||
/>
|
||||
<Text
|
||||
as="p"
|
||||
variant="subheadline"
|
||||
sx={{
|
||||
px: 2,
|
||||
py: 1,
|
||||
width: 'fit-content',
|
||||
borderRadius: 'extra',
|
||||
color: 'white',
|
||||
border: 'rgba(255,255,255,0.2) dashed 1px',
|
||||
zIndex: 2,
|
||||
position: ['absolute', 'relative', 'relative'],
|
||||
top: ['24px', 0, '5px']
|
||||
}}
|
||||
>
|
||||
{420 - consoleCount} consoles left
|
||||
</Text>
|
||||
<Grid
|
||||
columns={[1, 1, '1.2fr 1fr', '1.2fr 1fr']}
|
||||
sx={{ zIndex: 2, position: 'relative' }}
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
export async function getConsoles() {
|
||||
let data = await fetch(
|
||||
'https://airbridge.hackclub.com/v0.1/Sprig%20Waitlist/Requests'
|
||||
).then(r => r.json())
|
||||
|
||||
function check(val) {
|
||||
return val === 'Pending' || val === 'Approved'
|
||||
}
|
||||
|
||||
const consoleCount = data
|
||||
? data.filter(console => check(console.fields.Status)).length
|
||||
: 100 // arbitrary fallback number
|
||||
|
||||
return consoleCount
|
||||
}
|
||||
|
||||
export default async function SprigConsoles(req, res) {
|
||||
const consoleCount = await getConsoles()
|
||||
res.json(consoleCount)
|
||||
}
|
||||
|
|
@ -38,7 +38,6 @@ function Page({
|
|||
slackData,
|
||||
gitHubData,
|
||||
gitHubDataLength,
|
||||
consoleCount,
|
||||
stars,
|
||||
// githubData2,
|
||||
dataPieces,
|
||||
|
|
@ -752,7 +751,6 @@ function Page({
|
|||
<SprigConsole
|
||||
delay={300}
|
||||
stars={stars.sprigHardware.stargazerCount}
|
||||
consoleCount={consoleCount}
|
||||
/>
|
||||
</Box>
|
||||
<Workshops delay={400} stars={stars.hackclub.stargazerCount} />
|
||||
|
|
@ -1205,9 +1203,6 @@ export async function getStaticProps() {
|
|||
|
||||
gameTitle = game.map(r => r.title)
|
||||
|
||||
// Sprig: get console count
|
||||
const { getConsoles } = require('./api/sprig-console')
|
||||
const consoleCount = await getConsoles()
|
||||
|
||||
// Hackathons: get latest hackathons
|
||||
let hackathonsData
|
||||
|
|
@ -1233,7 +1228,6 @@ export async function getStaticProps() {
|
|||
game,
|
||||
gameTitle,
|
||||
gitHubData,
|
||||
consoleCount,
|
||||
hackathonsData,
|
||||
bankData,
|
||||
slackData,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue