Skip to content

Commit

Permalink
Add discord url to top bar
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiro committed Dec 1, 2024
1 parent ef53901 commit b7dac7e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# browser
NEXT_PUBLIC_API_URL=http://localhost:3000
NEXT_PUBLIC_SERVER_NAME="shibaac"
NEXT_PUBLIC_DISCORD_URL="https://discord.gg/invite/your_discord"

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

Expand Down
Binary file removed public/fonts/Roboto-Bold.ttf
Binary file not shown.
Binary file removed public/fonts/Roboto-Light.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions public/images/discord-logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface LinkProps extends ChakraLinkProps {

const Link = ({ href, text, children, ...props }: LinkProps) => {
return (
<ChakraLink as={NextLink} href={href} passHref color="violet.500" {...props}>
<ChakraLink as={NextLink} href={href} color="violet.500" {...props}>
{text ?? children}
</ChakraLink>
);
Expand Down
5 changes: 5 additions & 0 deletions src/layout/TopBar/TopBarSeparator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Box } from "@chakra-ui/react";

export const TopBarSeparator = () => {
return <Box bgColor="violet.400" w="1px" h="100%" />;
};
22 changes: 18 additions & 4 deletions src/layout/TopBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { Flex, Text, Box } from "@chakra-ui/react";
import { Flex, Text } from "@chakra-ui/react";
import { TopBarItem } from "./TopBarItem";
import { trpc } from "@util/trpc";
import Link from "@component/Link";
import { TopBarSeparator } from "./TopBarSeparator";
import { FaDiscord } from "react-icons/fa";

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

return (
<Flex justifyContent="center" bgColor="blackAlpha.600" h="40px" borderBottomWidth="1px" borderColor="violet.400">
<Flex alignItems="center" flexDir="row" gap="5px">
<Box bgColor="violet.400" w="1px" h="100%" />
<TopBarSeparator />
<Link href="/online">
<TopBarItem alignItems="center" flexDirection="row">
<Text fontSize="md" color={status?.online ? "green" : "red"}>
Expand All @@ -20,8 +22,20 @@ export const TopBar = () => {
</Text>
</TopBarItem>
</Link>

<Box bgColor="violet.400" w="1px" h="100%" />
<TopBarSeparator />
<Link href="/downloads" color="white">
<TopBarItem>
<Text fontSize="md">Download Client</Text>
</TopBarItem>
</Link>
<TopBarSeparator />
<Link href={process.env.NEXT_PUBLIC_DISCORD_URL ?? ""} isExternal color="white">
<TopBarItem alignItems="center" gap="5px">
<FaDiscord />
<Text fontSize="md">Join discord</Text>
</TopBarItem>
</Link>
<TopBarSeparator />
</Flex>
</Flex>
);
Expand Down

0 comments on commit b7dac7e

Please sign in to comment.