mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-05 00:40:38 +01:00
fix: hide non-ot form navbar
This commit is contained in:
1 parent
7e076a1e34
commit
57b58775c6
1 file changed
+19
-2
@@ -29,6 +29,7 @@ import { homeTool, TOOLS } from '../../constants/tools';
|
|||||||
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
|
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
|
||||||
import { imgur, ImgurSize } from '../../core/blitzkit/imgur';
|
import { imgur, ImgurSize } from '../../core/blitzkit/imgur';
|
||||||
import { patreonLoginUrl } from '../../core/blitzkit/patreonLoginUrl';
|
import { patreonLoginUrl } from '../../core/blitzkit/patreonLoginUrl';
|
||||||
|
import { assertSecret } from '../../core/blitzkit/secret';
|
||||||
import { PatreonIcon } from '../../icons/Patreon';
|
import { PatreonIcon } from '../../icons/Patreon';
|
||||||
import { WargamingIcon } from '../../icons/Wargaming';
|
import { WargamingIcon } from '../../icons/Wargaming';
|
||||||
import strings from '../../lang/en-US.json';
|
import strings from '../../lang/en-US.json';
|
||||||
@@ -98,8 +99,15 @@ export default function Navbar() {
|
|||||||
className={styles.tools}
|
className={styles.tools}
|
||||||
>
|
>
|
||||||
{TOOLS.map((tool, index) => {
|
{TOOLS.map((tool, index) => {
|
||||||
|
const unavailableOnBranch = tool.branches?.every(
|
||||||
|
(branch) =>
|
||||||
|
branch !==
|
||||||
|
assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH),
|
||||||
|
);
|
||||||
const selected = pathname.startsWith(`/tools/${tool.id}`);
|
const selected = pathname.startsWith(`/tools/${tool.id}`);
|
||||||
|
|
||||||
|
if (unavailableOnBranch) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment key={tool.title}>
|
<Fragment key={tool.title}>
|
||||||
{index > 0 && <Separator orientation="vertical" size="1" />}
|
{index > 0 && <Separator orientation="vertical" size="1" />}
|
||||||
@@ -282,7 +290,15 @@ export default function Navbar() {
|
|||||||
p="3"
|
p="3"
|
||||||
pt="0"
|
pt="0"
|
||||||
>
|
>
|
||||||
{tools.map((tool) => (
|
{tools.map((tool) => {
|
||||||
|
const unavailableOnBranch = tool.branches?.every(
|
||||||
|
(branch) =>
|
||||||
|
branch !== assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (unavailableOnBranch) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
key={tool.id}
|
key={tool.id}
|
||||||
onClick={() => setShowHamburgerMenu(false)}
|
onClick={() => setShowHamburgerMenu(false)}
|
||||||
@@ -330,7 +346,8 @@ export default function Navbar() {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Link>
|
</Link>
|
||||||
</Flex>
|
</Flex>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
Reference in new issue
Block a user