diff --git a/src/app/components/Hero/constants.ts b/src/app/components/Hero/constants.ts new file mode 100644 index 000000000..16626da8e --- /dev/null +++ b/src/app/components/Hero/constants.ts @@ -0,0 +1,4 @@ +export const BRANCH_NAMES: Record = { + dev: 'Beta', + opentest: 'Opentest', +}; diff --git a/src/app/components/Hero.tsx b/src/app/components/Hero/index.tsx similarity index 91% rename from src/app/components/Hero.tsx rename to src/app/components/Hero/index.tsx index 4d0f7ef2d..d4115d096 100644 --- a/src/app/components/Hero.tsx +++ b/src/app/components/Hero/index.tsx @@ -1,10 +1,6 @@ import { Code, Flex, Heading, Text } from '@radix-ui/themes'; -import { imgur } from '../../core/blitzkit/imgur'; - -const BRANCH_NAMES: Record = { - dev: 'Beta', - opentest: 'Opentest', -}; +import { imgur } from '../../../core/blitzkit/imgur'; +import { BRANCH_NAMES } from './constants'; export function Hero() { const isBranchNamed = diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 46b317aa4..c0f31f6d0 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -10,6 +10,7 @@ import { import { Box, Button, + Code, Dialog, Flex, Grid, @@ -22,6 +23,7 @@ import { } from '@radix-ui/themes'; import { usePathname } from 'next/navigation'; import { Fragment, useState } from 'react'; +import { BRANCH_NAMES } from '../../app/components/Hero/constants'; import { REGIONS } from '../../constants/regions'; import { homeTool, TOOLS } from '../../constants/tools'; import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID'; @@ -40,6 +42,9 @@ export default function Navbar() { const logins = App.use((state) => state.logins); const mutateApp = App.useMutation(); const tools = [homeTool, ...TOOLS]; + const isBranchNamed = + process.env.NEXT_PUBLIC_ASSET_BRANCH && + BRANCH_NAMES[process.env.NEXT_PUBLIC_ASSET_BRANCH]; return ( @@ -73,6 +78,14 @@ export default function Navbar() { onClick={() => setShowHamburgerMenu(false)} > BlitzKit + {isBranchNamed && ( + <> + {' '} + + {BRANCH_NAMES[process.env.NEXT_PUBLIC_ASSET_BRANCH!]} + + + )}