From c376ed6357157d762f190cdb270e87d03dbef9fe Mon Sep 17 00:00:00 2001 From: Toby Brown Date: Fri, 24 Nov 2023 20:19:05 +0000 Subject: [PATCH 1/7] new branch --- components/index/cards/onboard.js | 89 +++++++++++++++++++++++++++++++ pages/api/stars.js | 40 +++++++------- pages/index.js | 2 + 3 files changed, 113 insertions(+), 18 deletions(-) create mode 100644 components/index/cards/onboard.js diff --git a/components/index/cards/onboard.js b/components/index/cards/onboard.js new file mode 100644 index 00000000..b179600e --- /dev/null +++ b/components/index/cards/onboard.js @@ -0,0 +1,89 @@ +import { useEffect, useState } from "react"; +import { Box, Flex, Grid, Text } from "theme-ui"; +import CardModel from "./card-model"; +import Buttons from "./button"; + +export default function Onboard({ stars }) { + const [projects, setProjects] = useState(0); + + useEffect(() => { + fetch( + "https://api.github.com/search/issues?q=repo:hackclub/onboard+is:pr+is:merged+label:Submission", + ) + .then((response) => response.json()) + .then((data) => setProjects(data.total_count)); + }, []); + + return ( + + + OnBoard + + + + + {projects} projects built + + + Circuit boards are magical. You design one, we'll print it. + Completely free! Get a $100 grant to fuel the creation of your dream + project with OnBoard. + + + + + Get a grant + + + Learn PCB design now + + + See what other hackers have built + + + + + ); +} \ No newline at end of file diff --git a/pages/api/stars.js b/pages/api/stars.js index 3160caa3..9a5b5508 100644 --- a/pages/api/stars.js +++ b/pages/api/stars.js @@ -1,26 +1,27 @@ -import { graphql } from '@octokit/graphql' +import { graphql } from "@octokit/graphql"; export async function fetchStars() { if (!process.env.GITHUB_TOKEN) { console.warn( - 'Note - GITHUB_TOKEN not defined, stars will not be fetched from github' - ) + "Note - GITHUB_TOKEN not defined, stars will not be fetched from github", + ); return { - sprig: '?', - sinerider: '?', - sprigHardware: '?', - hackclub: '?', - hackathons: '?', - blot: '?' - } + sprig: "?", + sinerider: "?", + sprigHardware: "?", + hackclub: "?", + hackathons: "?", + blot: "?", + onboard: "?", + }; } const { organization } = await graphql( ` { organization(login: "hackclub") { - blot: repository(name: "blot") { - stargazerCount - } + blot: repository(name: "blot") { + stargazerCount + } sinerider: repository(name: "sinerider") { stargazerCount } @@ -36,16 +37,19 @@ export async function fetchStars() { sprigHardware: repository(name: "sprig-hardware") { stargazerCount } + onboard: repository(name: "onboard") { + stargazerCount + } } } `, { headers: { - authorization: `token ${process.env.GITHUB_TOKEN}` - } - } - ) - return organization + authorization: `token ${process.env.GITHUB_TOKEN}`, + }, + }, + ); + return organization; } export default async function Stars(req, res) { diff --git a/pages/index.js b/pages/index.js index 801db2c1..23af69ec 100644 --- a/pages/index.js +++ b/pages/index.js @@ -29,6 +29,7 @@ import GitHub from '../components/index/github' import Photo from '../components/photo' import Comma from '../components/comma' import Haxidraw from '../components/index/cards/haxidraw' +import Onboard from '../components/index/cards/onboard' /** @jsxImportSource theme-ui */ @@ -746,6 +747,7 @@ function Page({ gameImage={gameImage} gameImage1={gameImage1} /> + From e771c8643d09a66da27ab5c31aba133cfcd67693 Mon Sep 17 00:00:00 2001 From: Toby Brown Date: Sat, 25 Nov 2023 21:26:03 +0000 Subject: [PATCH 2/7] correcting formatting --- components/index/cards/onboard.js | 78 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/components/index/cards/onboard.js b/components/index/cards/onboard.js index b179600e..e46bd8b3 100644 --- a/components/index/cards/onboard.js +++ b/components/index/cards/onboard.js @@ -1,41 +1,41 @@ -import { useEffect, useState } from "react"; -import { Box, Flex, Grid, Text } from "theme-ui"; -import CardModel from "./card-model"; -import Buttons from "./button"; +import { useEffect, useState } from 'react' +import { Box, Flex, Grid, Text } from 'theme-ui' +import CardModel from './card-model' +import Buttons from './button' export default function Onboard({ stars }) { - const [projects, setProjects] = useState(0); + const [projects, setProjects] = useState(0) useEffect(() => { fetch( - "https://api.github.com/search/issues?q=repo:hackclub/onboard+is:pr+is:merged+label:Submission", + 'https://api.github.com/search/issues?q=repo:hackclub/onboard+is:pr+is:merged+label:Submission', ) .then((response) => response.json()) - .then((data) => setProjects(data.total_count)); - }, []); + .then((data) => setProjects(data.total_count)) + }, []) return ( OnBoard @@ -43,47 +43,47 @@ export default function Onboard({ stars }) { {projects} projects built - + Circuit boards are magical. You design one, we'll print it. Completely free! Get a $100 grant to fuel the creation of your dream project with OnBoard. Get a grant - - Learn PCB design now + + Learn how to design a PCB - + See what other hackers have built - ); + ) } \ No newline at end of file From fb1c45ce58ad227f17c9573705a72791942bce11 Mon Sep 17 00:00:00 2001 From: Toby Brown Date: Sat, 25 Nov 2023 22:11:40 +0000 Subject: [PATCH 3/7] polishing up --- components/index/cards/onboard.js | 11 +++++++---- pages/index.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/index/cards/onboard.js b/components/index/cards/onboard.js index e46bd8b3..ba5b9f41 100644 --- a/components/index/cards/onboard.js +++ b/components/index/cards/onboard.js @@ -3,6 +3,8 @@ import { Box, Flex, Grid, Text } from 'theme-ui' import CardModel from './card-model' import Buttons from './button' +/** @jsxImportSource theme-ui */ + export default function Onboard({ stars }) { const [projects, setProjects] = useState(0) @@ -59,9 +61,9 @@ export default function Onboard({ stars }) { > {projects} projects built - + Circuit boards are magical. You design one, we'll print it. - Completely free! Get a $100 grant to fuel the creation of your dream + Completely for free! Get a $100 grant to fuel the creation of your dream project with OnBoard. @@ -69,6 +71,7 @@ export default function Onboard({ stars }) { sx={{ flexDirection: 'column', mt: [3, 3, 4], placeSelf: 'start' }} > Get a grant - + Learn how to design a PCB - + See what other hackers have built diff --git a/pages/index.js b/pages/index.js index 23af69ec..55fcceeb 100644 --- a/pages/index.js +++ b/pages/index.js @@ -747,7 +747,7 @@ function Page({ gameImage={gameImage} gameImage1={gameImage1} /> - + From 4af080d7189fe120e65c999b4f6fc749532c32df Mon Sep 17 00:00:00 2001 From: Toby Brown Date: Sat, 25 Nov 2023 22:13:52 +0000 Subject: [PATCH 4/7] onboard, not sprig! --- pages/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/index.js b/pages/index.js index 55fcceeb..05a4d353 100644 --- a/pages/index.js +++ b/pages/index.js @@ -747,7 +747,7 @@ function Page({ gameImage={gameImage} gameImage1={gameImage1} /> - + From 401b0c7b1d8dbaca0b5f5a35dcc4ee9cf10311e3 Mon Sep 17 00:00:00 2001 From: Toby Brown Date: Mon, 27 Nov 2023 17:05:59 +0000 Subject: [PATCH 5/7] no more formatting! --- pages/api/stars.js | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/pages/api/stars.js b/pages/api/stars.js index 9a5b5508..471d99b4 100644 --- a/pages/api/stars.js +++ b/pages/api/stars.js @@ -1,43 +1,43 @@ -import { graphql } from "@octokit/graphql"; +import { graphql } from '@octokit/graphql' export async function fetchStars() { if (!process.env.GITHUB_TOKEN) { console.warn( - "Note - GITHUB_TOKEN not defined, stars will not be fetched from github", - ); + 'Note - GITHUB_TOKEN not defined, stars will not be fetched from github' + ) return { - sprig: "?", - sinerider: "?", - sprigHardware: "?", - hackclub: "?", - hackathons: "?", - blot: "?", - onboard: "?", - }; + sprig: '?', + sinerider: '?', + sprigHardware: '?', + hackclub: '?', + hackathons: '?', + blot: '?', + onboard: '?' + } } const { organization } = await graphql( ` { - organization(login: "hackclub") { - blot: repository(name: "blot") { + organization(login: 'hackclub') { + blot: repository(name: 'blot') { stargazerCount } - sinerider: repository(name: "sinerider") { + sinerider: repository(name: 'sinerider') { stargazerCount } - sprig: repository(name: "sprig") { + sprig: repository(name: 'sprig') { stargazerCount } - hackclub: repository(name: "hackclub") { + hackclub: repository(name: 'hackclub') { stargazerCount } - hackathons: repository(name: "hackathons") { + hackathons: repository(name: 'hackathons') { stargazerCount } - sprigHardware: repository(name: "sprig-hardware") { + sprigHardware: repository(name: 'sprig-hardware') { stargazerCount } - onboard: repository(name: "onboard") { + onboard: repository(name: 'onboard') { stargazerCount } } @@ -45,11 +45,11 @@ export async function fetchStars() { `, { headers: { - authorization: `token ${process.env.GITHUB_TOKEN}`, - }, - }, - ); - return organization; + authorization: `token ${process.env.GITHUB_TOKEN}` + } + } + ) + return organization } export default async function Stars(req, res) { From 10f562ccd0b190f224e6808bb968067772b17e78 Mon Sep 17 00:00:00 2001 From: Toby Brown Date: Mon, 27 Nov 2023 17:16:53 +0000 Subject: [PATCH 6/7] fix --- pages/api/stars.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/api/stars.js b/pages/api/stars.js index 471d99b4..a506404d 100644 --- a/pages/api/stars.js +++ b/pages/api/stars.js @@ -18,26 +18,26 @@ export async function fetchStars() { const { organization } = await graphql( ` { - organization(login: 'hackclub') { - blot: repository(name: 'blot') { + organization(login: "hackclub") { + blot: repository(name: "blot") { stargazerCount } - sinerider: repository(name: 'sinerider') { + sinerider: repository(name: "sinerider") { stargazerCount } - sprig: repository(name: 'sprig') { + sprig: repository(name: "sprig") { stargazerCount } - hackclub: repository(name: 'hackclub') { + hackclub: repository(name: "hackclub") { stargazerCount } - hackathons: repository(name: 'hackathons') { + hackathons: repository(name: "hackathons") { stargazerCount } - sprigHardware: repository(name: 'sprig-hardware') { + sprigHardware: repository(name: "sprig-hardware") { stargazerCount } - onboard: repository(name: 'onboard') { + onboard: repository(name: "onboard") { stargazerCount } } From fb4b842eb809666972cdfd659fd67e5813eeda1e Mon Sep 17 00:00:00 2001 From: Toby Brown Date: Wed, 29 Nov 2023 18:17:47 +0000 Subject: [PATCH 7/7] mobile support --- components/index/cards/onboard.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/index/cards/onboard.js b/components/index/cards/onboard.js index ba5b9f41..353eaba4 100644 --- a/components/index/cards/onboard.js +++ b/components/index/cards/onboard.js @@ -1,5 +1,5 @@ -import { useEffect, useState } from 'react' -import { Box, Flex, Grid, Text } from 'theme-ui' +import {useEffect, useState} from 'react' +import {Box, Flex, Grid, Text} from 'theme-ui' import CardModel from './card-model' import Buttons from './button' @@ -38,6 +38,8 @@ export default function Onboard({ stars }) { maxWidth: 'copyPlus', textShadow: '0 0 30px rgba(42, 252, 88, 0.6)', color: '#87ffa1', + mt: ['38px', 0, 0], + position: 'relative', }} > OnBoard @@ -56,7 +58,7 @@ export default function Onboard({ stars }) { zIndex: 2, color: 'white', position: ['absolute', 'relative', 'relative'], - top: ['24px', 0, '5px'], + top: ['24px', 0, '5px'] }} > {projects} projects built