diff --git a/estela-web/.env.development.example b/estela-web/.env.development.example index 165b18db..cb84f3f0 100644 --- a/estela-web/.env.development.example +++ b/estela-web/.env.development.example @@ -1 +1,2 @@ -REACT_APP_API_BASE_URL=http://localhost:8000 \ No newline at end of file +REACT_APP_API_BASE_URL=http://localhost:8000 +REGISTER_PAGE_ENABLED=true diff --git a/estela-web/src/constants.ts b/estela-web/src/constants.ts index 50ec5ad3..411a304d 100644 --- a/estela-web/src/constants.ts +++ b/estela-web/src/constants.ts @@ -1 +1,2 @@ export const API_BASE_URL = process.env.REACT_APP_API_BASE_URL; +export const REGISTER_PAGE_ENABLED = process.env.REGISTER_PAGE_ENABLED === "true"; diff --git a/estela-web/src/pages/LoginPage/index.tsx b/estela-web/src/pages/LoginPage/index.tsx index 1e063053..892feeea 100644 --- a/estela-web/src/pages/LoginPage/index.tsx +++ b/estela-web/src/pages/LoginPage/index.tsx @@ -9,6 +9,7 @@ import { ApiAuthLoginRequest, Token } from "../../services/api"; import { handleInvalidDataError } from "../../utils"; import { UserContext, UserContextProps } from "../../context"; import { EstelaBanner } from "../../components"; +import { REGISTER_PAGE_ENABLED } from "../../constants"; const { Content } = Layout; const { Text } = Typography; @@ -105,14 +106,16 @@ export class LoginPage extends Component { > Log in - -

If you don't have an account. You can

-

- - register here - -

-
+ {REGISTER_PAGE_ENABLED && ( + +

If you don't have an account. You can

+

+ + register here + +

+
+ )} diff --git a/estela-web/src/routes/index.tsx b/estela-web/src/routes/index.tsx index 6668a143..c351c893 100644 --- a/estela-web/src/routes/index.tsx +++ b/estela-web/src/routes/index.tsx @@ -1,6 +1,8 @@ import React from "react"; import { Switch, Route, Redirect } from "react-router-dom"; +import { REGISTER_PAGE_ENABLED } from "../constants"; + import { ActivatedAccountPage } from "../pages/ActivatedAccountPage"; import { LoginPage } from "../pages/LoginPage"; import { RegisterPage } from "../pages/RegisterPage"; @@ -34,10 +36,19 @@ export const MainRoutes: React.FC = () => { - + - + {REGISTER_PAGE_ENABLED && }