mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: labels
This commit is contained in:
1 parent
5da177e520
commit
71af5d2166
3 files changed
+19
-6
No files matched your search
@@ -0,0 +1,4 @@
|
|||||||
|
export const BRANCH_NAMES: Record<string, string> = {
|
||||||
|
dev: 'Beta',
|
||||||
|
opentest: 'Opentest',
|
||||||
|
};
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
import { Code, Flex, Heading, Text } from '@radix-ui/themes';
|
import { Code, Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
import { imgur } from '../../core/blitzkit/imgur';
|
import { imgur } from '../../../core/blitzkit/imgur';
|
||||||
|
import { BRANCH_NAMES } from './constants';
|
||||||
const BRANCH_NAMES: Record<string, string> = {
|
|
||||||
dev: 'Beta',
|
|
||||||
opentest: 'Opentest',
|
|
||||||
};
|
|
||||||
|
|
||||||
export function Hero() {
|
export function Hero() {
|
||||||
const isBranchNamed =
|
const isBranchNamed =
|
||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
|
Code,
|
||||||
Dialog,
|
Dialog,
|
||||||
Flex,
|
Flex,
|
||||||
Grid,
|
Grid,
|
||||||
@@ -22,6 +23,7 @@ import {
|
|||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
import { Fragment, useState } from 'react';
|
import { Fragment, useState } from 'react';
|
||||||
|
import { BRANCH_NAMES } from '../../app/components/Hero/constants';
|
||||||
import { REGIONS } from '../../constants/regions';
|
import { REGIONS } from '../../constants/regions';
|
||||||
import { homeTool, TOOLS } from '../../constants/tools';
|
import { homeTool, TOOLS } from '../../constants/tools';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
|
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
|
||||||
@@ -40,6 +42,9 @@ export default function Navbar() {
|
|||||||
const logins = App.use((state) => state.logins);
|
const logins = App.use((state) => state.logins);
|
||||||
const mutateApp = App.useMutation();
|
const mutateApp = App.useMutation();
|
||||||
const tools = [homeTool, ...TOOLS];
|
const tools = [homeTool, ...TOOLS];
|
||||||
|
const isBranchNamed =
|
||||||
|
process.env.NEXT_PUBLIC_ASSET_BRANCH &&
|
||||||
|
BRANCH_NAMES[process.env.NEXT_PUBLIC_ASSET_BRANCH];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex className={styles.navbar}>
|
<Flex className={styles.navbar}>
|
||||||
@@ -73,6 +78,14 @@ export default function Navbar() {
|
|||||||
onClick={() => setShowHamburgerMenu(false)}
|
onClick={() => setShowHamburgerMenu(false)}
|
||||||
>
|
>
|
||||||
BlitzKit
|
BlitzKit
|
||||||
|
{isBranchNamed && (
|
||||||
|
<>
|
||||||
|
{' '}
|
||||||
|
<Code color="gray" highContrast variant="solid">
|
||||||
|
{BRANCH_NAMES[process.env.NEXT_PUBLIC_ASSET_BRANCH!]}
|
||||||
|
</Code>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user