Skip to content

Commit

Permalink
star count + copy update
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyab committed Nov 22, 2023
1 parent 284bb53 commit e9b1695
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
8 changes: 4 additions & 4 deletions components/index/cards/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function Onboard({ stars }) {
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
}}
github_link="https://github.com/hackclub/onboard"
github_link="https://github.com/hackclub/onboard/"
color="white"
highlight="#87ffa1"
stars={stars}
Expand All @@ -52,7 +52,7 @@ export default function Onboard({ stars }) {
color: "#87ffa1",
}}
>
Onboard
OnBoard
</Text>
<Grid columns={[1, 2]}>
<Box>
Expand All @@ -74,8 +74,8 @@ export default function Onboard({ stars }) {
>
{projects} projects built
</Text>
<Text as="p" variant="subtitle" sx={{ color: "white", maxWidth: "" }}>
Ever wanted to build your own USB hub or ? You can with OnBoard! Circuit boards are magical. You design one, we'll print it. Completely free!
<Text as="p" variant="subtitle" sx={{ color: "white" }}>
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.
</Text>
</Box>
<Flex sx={{ flexDirection: "column", mt: [3, 3, 4], placeSelf: "start" }}>
Expand Down
40 changes: 22 additions & 18 deletions pages/api/stars.js
Original file line number Diff line number Diff line change
@@ -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
}
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ function Page({
gameImage={gameImage}
gameImage1={gameImage1}
/>
<Onboard />
<Onboard stars={stars.onboard.stargazerCount} delay={200} />
<Haxidraw stars={stars.blot.stargazerCount} delay={100} />
<Sinerider delay={200} stars={stars.sinerider.stargazerCount} />
<Box as="section" id="sprig">
Expand Down

0 comments on commit e9b1695

Please sign in to comment.