Skip to content

Commit b7dac7e

Browse files
committed
Add discord url to top bar
1 parent ef53901 commit b7dac7e

File tree

7 files changed

+26
-5
lines changed

7 files changed

+26
-5
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# browser
22
NEXT_PUBLIC_API_URL=http://localhost:3000
33
NEXT_PUBLIC_SERVER_NAME="shibaac"
4+
NEXT_PUBLIC_DISCORD_URL="https://discord.gg/invite/your_discord"
45

56
DATABASE_URL="mysql://root:secret@localhost:3306/shibaac"
67

public/fonts/Roboto-Bold.ttf

-160 KB
Binary file not shown.

public/fonts/Roboto-Light.ttf

-159 KB
Binary file not shown.

public/images/discord-logo-white.svg

+1
Loading

src/components/Link.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface LinkProps extends ChakraLinkProps {
99

1010
const Link = ({ href, text, children, ...props }: LinkProps) => {
1111
return (
12-
<ChakraLink as={NextLink} href={href} passHref color="violet.500" {...props}>
12+
<ChakraLink as={NextLink} href={href} color="violet.500" {...props}>
1313
{text ?? children}
1414
</ChakraLink>
1515
);

src/layout/TopBar/TopBarSeparator.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Box } from "@chakra-ui/react";
2+
3+
export const TopBarSeparator = () => {
4+
return <Box bgColor="violet.400" w="1px" h="100%" />;
5+
};

src/layout/TopBar/index.tsx

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import { Flex, Text, Box } from "@chakra-ui/react";
1+
import { Flex, Text } from "@chakra-ui/react";
22
import { TopBarItem } from "./TopBarItem";
33
import { trpc } from "@util/trpc";
44
import Link from "@component/Link";
5+
import { TopBarSeparator } from "./TopBarSeparator";
6+
import { FaDiscord } from "react-icons/fa";
57

68
export const TopBar = () => {
79
const status = trpc.status.status.useQuery().data;
810

911
return (
1012
<Flex justifyContent="center" bgColor="blackAlpha.600" h="40px" borderBottomWidth="1px" borderColor="violet.400">
1113
<Flex alignItems="center" flexDir="row" gap="5px">
12-
<Box bgColor="violet.400" w="1px" h="100%" />
14+
<TopBarSeparator />
1315
<Link href="/online">
1416
<TopBarItem alignItems="center" flexDirection="row">
1517
<Text fontSize="md" color={status?.online ? "green" : "red"}>
@@ -20,8 +22,20 @@ export const TopBar = () => {
2022
</Text>
2123
</TopBarItem>
2224
</Link>
23-
24-
<Box bgColor="violet.400" w="1px" h="100%" />
25+
<TopBarSeparator />
26+
<Link href="/downloads" color="white">
27+
<TopBarItem>
28+
<Text fontSize="md">Download Client</Text>
29+
</TopBarItem>
30+
</Link>
31+
<TopBarSeparator />
32+
<Link href={process.env.NEXT_PUBLIC_DISCORD_URL ?? ""} isExternal color="white">
33+
<TopBarItem alignItems="center" gap="5px">
34+
<FaDiscord />
35+
<Text fontSize="md">Join discord</Text>
36+
</TopBarItem>
37+
</Link>
38+
<TopBarSeparator />
2539
</Flex>
2640
</Flex>
2741
);

0 commit comments

Comments
 (0)