Skip to content

Commit

Permalink
feat: add github star button
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine-coulon committed Sep 5, 2023
1 parent bce3667 commit 45f7176
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"ninja-keys": "^1.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-github-btn": "^1.4.0",
"rxjs": "^7.8.1",
"timsort": "^0.3.0",
"uuid": "^8.3.2",
Expand Down
28 changes: 23 additions & 5 deletions apps/web/src/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Code,
} from "@mantine/core";
import { IconBrandGithub, IconMoonStars, IconSun } from "@tabler/icons-react";

import GitHubButton from "react-github-btn";
import { useAppStore } from "@/store/react-bindings";

export default function Header() {
Expand All @@ -27,8 +27,23 @@ export default function Header() {
return (
<MantineHeader height={60}>
<Group sx={{ height: "100%" }} px={20} position="apart">
<Group sx={{ height: "100%" }}>
<Image src={"./skott.svg"} width={125} fit="contain" radius="md" />
<Group sx={{ height: "100%", marginTop: "5px" }}>
<Image
src={"./skott.svg"}
width={125}
style={{ marginBottom: "5px" }}
fit="contain"
radius="md"
/>
<GitHubButton
href="https://github.com/antoine-coulon/skott"
data-icon="octicon-star"
data-size="large"
data-show-count="true"
aria-label="Star antoine-coulon/skott on GitHub"
>
Star
</GitHubButton>
</Group>

<Group position="apart">
Expand All @@ -43,11 +58,14 @@ export default function Header() {
variant="subtle"
color={isDarkMode ? "blue" : "dark"}
onClick={() => {
window.open("https://github.com/antoine-coulon/skott", "_blank");
window.open(
"https://github.com/antoine-coulon/skott/issues",
"_blank"
);
}}
>
<Group position="apart">
<Text>Source</Text>
<Text>Report issues</Text>
<ThemeIcon radius="lg" color="dark">
<IconBrandGithub />
</ThemeIcon>
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 45f7176

Please sign in to comment.