master
alex 2024-01-24 18:55:53 +01:00
parent e391eb8eb3
commit ae0a37df1a
3 changed files with 48 additions and 53 deletions

View File

@ -5,26 +5,11 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta <meta name="description" content="Dashboard for ZeitAdler" />
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will <title>Dashboard - ZeitAdler</title>
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Dashboard</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>

View File

@ -1,5 +1,5 @@
import { Route, Routes } from "react-router-dom"; import { Route, Routes } from "react-router-dom";
import { Constants } from "../../utils"; import { Constants, isDevelopmentEnv } from "../../utils";
import { lazy } from "react"; import { lazy } from "react";
import { MySupsenseFallback } from "../MySupsenseFallback"; import { MySupsenseFallback } from "../MySupsenseFallback";
@ -85,6 +85,8 @@ export default function AppRoutes({ userSession, setUserSession }) {
} }
/> />
{isDevelopmentEnv() && (
<>
<Route <Route
path={Constants.ROUTE_PATHS.SUPPORT} path={Constants.ROUTE_PATHS.SUPPORT}
element={ element={
@ -102,6 +104,8 @@ export default function AppRoutes({ userSession, setUserSession }) {
</MySupsenseFallback> </MySupsenseFallback>
} }
/> />
</>
)}
<Route <Route
path={Constants.ROUTE_PATHS.USER_PROFILE} path={Constants.ROUTE_PATHS.USER_PROFILE}

View File

@ -16,7 +16,7 @@ import {
import { Divider, Menu } from "antd"; import { Divider, Menu } from "antd";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useLocation, useNavigate } from "react-router-dom"; import { useLocation, useNavigate } from "react-router-dom";
import { BreakpointLgWidth, Constants } from "../../utils"; import { BreakpointLgWidth, Constants, isDevelopmentEnv } from "../../utils";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useSideBarContext } from "../../Contexts/SideBarContext"; import { useSideBarContext } from "../../Contexts/SideBarContext";
import { useStoresContext } from "../../Contexts/StoresContext"; import { useStoresContext } from "../../Contexts/StoresContext";
@ -132,7 +132,10 @@ export function SideMenuContent({
}); });
} }
if (sideBarContext.permissions.includes("website")) { if (
isDevelopmentEnv() &&
sideBarContext.permissions.includes("website")
) {
groupStore.children.push({ groupStore.children.push({
label: t("sideMenu.store.website.title"), label: t("sideMenu.store.website.title"),
icon: <EditOutlined />, icon: <EditOutlined />,
@ -151,6 +154,7 @@ export function SideMenuContent({
const getSecondMenuItems = () => { const getSecondMenuItems = () => {
let items = []; let items = [];
if (isDevelopmentEnv()) {
items.push( items.push(
{ {
label: t("sideMenu.support"), label: t("sideMenu.support"),
@ -161,13 +165,15 @@ export function SideMenuContent({
label: t("sideMenu.feedback"), label: t("sideMenu.feedback"),
icon: <MessageOutlined />, icon: <MessageOutlined />,
key: Constants.ROUTE_PATHS.FEEDBACK, key: Constants.ROUTE_PATHS.FEEDBACK,
}, }
{ );
}
items.push({
label: sideBarContext.username, label: sideBarContext.username,
icon: <UserOutlined />, icon: <UserOutlined />,
key: Constants.ROUTE_PATHS.USER_PROFILE, key: Constants.ROUTE_PATHS.USER_PROFILE,
} });
);
return items; return items;
}; };