Skip to content

Commit

Permalink
Show server name in tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiro committed Dec 1, 2024
1 parent 6ba9c1c commit 6bc37d0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# general
# browser
NEXT_PUBLIC_API_URL=http://localhost:3000
NEXT_PUBLIC_SERVER_NAME="shibaac"

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

Expand Down
5 changes: 2 additions & 3 deletions src/layout/Head.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";

import NextHead from "next/head";
import { NextSeo } from "next-seo";

Expand All @@ -8,7 +7,7 @@ export interface HeadProps {
description?: string;
}

const Head = ({ title = "shibaac", description = "Automatic Account Creator" }: HeadProps) => {
const Head = ({ title, description = "Automatic Account Creator" }: HeadProps) => {
return (
<>
<NextHead>
Expand All @@ -17,7 +16,7 @@ const Head = ({ title = "shibaac", description = "Automatic Account Creator" }:
<link rel="icon" href={`/favicon.ico`} key="favicon" />
</NextHead>
<NextSeo
title={title}
title={`${process.env.NEXT_PUBLIC_SERVER_NAME} - ${title}`}
description={description}
//anonical={properties.canonical}
openGraph={{
Expand Down
20 changes: 12 additions & 8 deletions src/layout/TopBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Flex, Text, Box } from "@chakra-ui/react";
import { TopBarItem } from "./TopBarItem";
import { trpc } from "@util/trpc";
import Link from "@component/Link";

export const TopBar = () => {
const status = trpc.status.status.useQuery().data;
Expand All @@ -9,14 +10,17 @@ export const TopBar = () => {
<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%" />
<TopBarItem alignItems="center" flexDirection="row">
<Text fontSize="md" color={status?.online ? "green" : "red"}>
{status?.onlineCount ?? "..."}
</Text>
<Text fontSize="md" ml="5px" color="white">
players online
</Text>
</TopBarItem>
<Link href="/online">
<TopBarItem alignItems="center" flexDirection="row">
<Text fontSize="md" color={status?.online ? "green" : "red"}>
{status?.onlineCount ?? "..."}
</Text>
<Text fontSize="md" ml="5px" color="white">
players online
</Text>
</TopBarItem>
</Link>

<Box bgColor="violet.400" w="1px" h="100%" />
</Flex>
</Flex>
Expand Down
2 changes: 1 addition & 1 deletion src/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Layout = ({ children }: PropsWithChildren) => {
return (
<>
<TopBar />
<Head />
<Head title="Home" />
<Box w={{ base: "95%", md: "95%", xl: "65%", "2xl": "35%" }} marginX={"auto"} marginY={{ base: "1em", md: 0 }}>
<Image width="230px" marginLeft="auto" marginRight="auto" marginBottom="15px" marginTop="15px" src="/images/header.png" alt="shibaac" />
<NavBar />
Expand Down

0 comments on commit 6bc37d0

Please sign in to comment.