diff --git a/.env b/.env new file mode 100644 index 0000000..3fce25c --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password} +REACT_APP_ENABLE_TEMPLATE_CONTENT=True \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..aa4b1e0 --- /dev/null +++ b/.env.production @@ -0,0 +1,3 @@ +PUBLIC_URL=/cdn-admin/ +REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password} +REACT_APP_ENABLE_TEMPLATE_CONTENT=False \ No newline at end of file diff --git a/src/components/App.js b/src/components/App.js index 3da89e7..f7c3ba7 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -16,7 +16,7 @@ export default function App() { var { isAuthenticated } = useUserState(); return ( - + } /> ); - // ####################################################################### - function PrivateRoute({ component, ...rest }) { return ( - }, - { id: 12, type: "divider" }, - { - id: 13, - label: "Template", - children: [ - { - id: 14, - label: "Typography", - link: "/app/typography", - icon: - }, - { id: 15, label: "Tables", link: "/app/tables", icon: }, - { - id: 16, - label: "UI Elements", - link: "/app/ui", - icon: , - children: [ - { label: "Icons", link: "/app/ui/icons" }, - { label: "Charts", link: "/app/ui/charts" }, - { label: "Maps", link: "/app/ui/maps" } - ] - }, - { - id: 17, - label: "My recent", - link: "", - icon: - }, - { - id: 18, - label: "Starred", - link: "", - icon: - }, - { - id: 19, - label: "Background", - link: "", - icon: - } - ] } ]; +const enableTemplateContent = + process.env.REACT_APP_ENABLE_TEMPLATE_CONTENT === "True"; + +if (enableTemplateContent) { + menu.push( + { id: 12, type: "divider" }, + { + id: 13, + label: "Template", + children: [ + { + id: 14, + label: "Typography", + link: "/app/typography", + icon: + }, + { id: 15, label: "Tables", link: "/app/tables", icon: }, + { + id: 16, + label: "UI Elements", + link: "/app/ui", + icon: , + children: [ + { label: "Icons", link: "/app/ui/icons" }, + { label: "Charts", link: "/app/ui/charts" }, + { label: "Maps", link: "/app/ui/maps" } + ] + }, + { + id: 17, + label: "My recent", + link: "", + icon: + }, + { + id: 18, + label: "Starred", + link: "", + icon: + }, + { + id: 19, + label: "Background", + link: "", + icon: + } + ] + } + ); +} + export default menu;