env files

master
Tudor Stanciu 2021-07-04 15:12:09 +03:00
parent 8ff7b13fb7
commit faba61a3bc
4 changed files with 58 additions and 47 deletions

2
.env Normal file
View File

@ -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

3
.env.production Normal file
View File

@ -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

View File

@ -16,7 +16,7 @@ export default function App() {
var { isAuthenticated } = useUserState(); var { isAuthenticated } = useUserState();
return ( return (
<HashRouter> <HashRouter basename={process.env.PUBLIC_URL || ""}>
<Switch> <Switch>
<Route exact path="/" render={() => <Redirect to="/app/dashboard" />} /> <Route exact path="/" render={() => <Redirect to="/app/dashboard" />} />
<Route <Route
@ -31,8 +31,6 @@ export default function App() {
</HashRouter> </HashRouter>
); );
// #######################################################################
function PrivateRoute({ component, ...rest }) { function PrivateRoute({ component, ...rest }) {
return ( return (
<Route <Route

View File

@ -14,7 +14,7 @@ import {
} from "@material-ui/icons"; } from "@material-ui/icons";
import Dot from "./components/Dot"; import Dot from "./components/Dot";
const menu = [ let menu = [
{ {
id: 0, id: 0,
label: "Dashboard", label: "Dashboard",
@ -75,50 +75,58 @@ const menu = [
label: "FAQ", label: "FAQ",
link: "https://toodle.ddns.net/forum", link: "https://toodle.ddns.net/forum",
icon: <FAQIcon /> icon: <FAQIcon />
},
{ id: 12, type: "divider" },
{
id: 13,
label: "Template",
children: [
{
id: 14,
label: "Typography",
link: "/app/typography",
icon: <TypographyIcon />
},
{ id: 15, label: "Tables", link: "/app/tables", icon: <TableIcon /> },
{
id: 16,
label: "UI Elements",
link: "/app/ui",
icon: <UIElementsIcon />,
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: <Dot size="small" color="warning" />
},
{
id: 18,
label: "Starred",
link: "",
icon: <Dot size="small" color="primary" />
},
{
id: 19,
label: "Background",
link: "",
icon: <Dot size="small" color="secondary" />
}
]
} }
]; ];
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: <TypographyIcon />
},
{ id: 15, label: "Tables", link: "/app/tables", icon: <TableIcon /> },
{
id: 16,
label: "UI Elements",
link: "/app/ui",
icon: <UIElementsIcon />,
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: <Dot size="small" color="warning" />
},
{
id: 18,
label: "Starred",
link: "",
icon: <Dot size="small" color="primary" />
},
{
id: 19,
label: "Background",
link: "",
icon: <Dot size="small" color="secondary" />
}
]
}
);
}
export default menu; export default menu;