Skip to content

Commit

Permalink
Use IS_DEV_OR_DEMO for playground as suggested in inventree#5359 (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
matmair committed Aug 15, 2023
1 parent d25e9e2 commit 4d9cd57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/frontend/src/defaults/links.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Trans } from '@lingui/macro';

import { DocumentationLinkItem } from '../components/items/DocumentationLinks';
import { IS_DEV_OR_DEMO } from '../main';

export const footerLinks = [
{
Expand All @@ -22,11 +23,13 @@ export const footerLinks = [
export const navTabs = [
{ text: <Trans>Home</Trans>, name: 'home' },
{ text: <Trans>Dashboard</Trans>, name: 'dashboard' },
{ text: <Trans>Playground</Trans>, name: 'playground' },
{ text: <Trans>Parts</Trans>, name: 'parts' },
{ text: <Trans>Stock</Trans>, name: 'stock' },
{ text: <Trans>Build</Trans>, name: 'build' }
];
if (IS_DEV_OR_DEMO) {
navTabs.push({ text: <Trans>Playground</Trans>, name: 'playground' });
}

export const docLinks = {
app: 'https://docs.inventree.org/en/latest/app/app/',
Expand Down
12 changes: 8 additions & 4 deletions src/frontend/src/defaults/menuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Trans, t } from '@lingui/macro';
import { Image, Text } from '@mantine/core';

import { MenuLinkItem } from '../components/items/MenuLinks';
import { IS_DEV_OR_DEMO } from '../main';

export const menuItems: MenuLinkItem[] = [
{
Expand All @@ -15,11 +16,14 @@ export const menuItems: MenuLinkItem[] = [
text: <Trans>Profile page</Trans>,
link: '/profile/user',
doctext: <Trans>User attributes and design settings.</Trans>
},
{
}
];

if (IS_DEV_OR_DEMO) {
menuItems.push({
id: 'playground',
text: <Trans>Playground</Trans>,
link: '/playground',
highlight: true
}
];
});
}

0 comments on commit 4d9cd57

Please sign in to comment.