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,7 +75,14 @@ const menu = [
label: "FAQ", label: "FAQ",
link: "https://toodle.ddns.net/forum", link: "https://toodle.ddns.net/forum",
icon: <FAQIcon /> icon: <FAQIcon />
}, }
];
const enableTemplateContent =
process.env.REACT_APP_ENABLE_TEMPLATE_CONTENT === "True";
if (enableTemplateContent) {
menu.push(
{ id: 12, type: "divider" }, { id: 12, type: "divider" },
{ {
id: 13, id: 13,
@ -119,6 +126,7 @@ const menu = [
} }
] ]
} }
]; );
}
export default menu; export default menu;