diff --git a/src/Common/hooks/useConfig.ts b/src/Common/hooks/useConfig.ts index 4e1cb806e3f..03d9dada9b9 100644 --- a/src/Common/hooks/useConfig.ts +++ b/src/Common/hooks/useConfig.ts @@ -14,14 +14,23 @@ export interface IConfig { site_url: string; analytics_server_url: string; - header_logo: ILogo; + /** + * The main logo of the app displayed on login and sidebar header. + */ main_logo: ILogo; - /** - * Logo and description for custom deployment. (This overrides the state logo) + * If present, the image will be displayed on the login page before the main logo. + */ + state_logo?: ILogo; + /** + * if present, this replaces the state logo on the login page only. */ custom_logo?: ILogo; + /** + * if present, this replaces the main logo on the login page only. + */ custom_logo_alt?: ILogo; + custom_description?: string; /** @@ -41,13 +50,15 @@ export interface IConfig { * SENTRY_ENVIRONMENT */ sentry_environment: string; + + /** + * The header banner is displayed on the top of + * the shift print form if the facility is kasp. + */ + header_logo: ILogo; kasp_enabled: boolean; kasp_string: string; kasp_full_string: string; - /** - * If present, the image will be displayed in the login page. - */ - state_logo?: ILogo; /** * URL of the sample format for asset import. */ diff --git a/src/Components/Auth/Login.tsx b/src/Components/Auth/Login.tsx index 8dcae9bafc0..62c9d632769 100644 --- a/src/Components/Auth/Login.tsx +++ b/src/Components/Auth/Login.tsx @@ -252,160 +252,161 @@ export const Login = (props: { forgot?: boolean }) => {
-
-
-
+
+
+
{(custom_logo || state_logo) && ( <> state logo -
+
)} care logo -
{" "} -
- {t("auth_login_title")}
-
-
- - -
- {isCaptchaEnabled && ( -
- - {errors.captcha} -
- )} -
- -
+
+
+
+ {t("auth_login_title")} +
+ +
+ + +
+ {isCaptchaEnabled && ( +
+ + {errors.captcha} +
+ )} - {loading ? ( -
- +
+ +
+ + {loading ? ( +
+ +
+ ) : ( + + )}
- ) : ( - - )} -
-
- - -
-
- care logo{" "} -
- -
- {t("forget_password")} -
-
-
- {t("forget_password_instruction")} - -
- {loading ? ( -
- -
- ) : ( - - )} + +
+ +
+ {t("forget_password")}
+ +
+ {t("forget_password_instruction")} + +
+ {loading ? ( +
+ +
+ ) : ( + + )} +
+
+ +
- - +
diff --git a/src/Components/Common/TopBar.tsx b/src/Components/Common/TopBar.tsx deleted file mode 100644 index 2dd9c55609d..00000000000 --- a/src/Components/Common/TopBar.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import useConfig from "../../Common/hooks/useConfig"; -import LanguageSelector from "./LanguageSelector"; - -const TopBar = () => { - const { main_logo } = useConfig(); - return ( -
-
-
- - care logo - -
-
- -
-
-
- ); -}; - -export default TopBar; diff --git a/src/Routers/SessionRouter.tsx b/src/Routers/SessionRouter.tsx index 8a4f2c2dd68..4e546d51b6c 100644 --- a/src/Routers/SessionRouter.tsx +++ b/src/Routers/SessionRouter.tsx @@ -2,7 +2,6 @@ import { Login, ResetPassword } from "../Components/Auth"; import { useRoutes } from "raviger"; import SessionExpired from "../Components/ErrorPages/SessionExpired"; import InvalidReset from "../Components/ErrorPages/InvalidReset"; -import TopBar from "../Components/Common/TopBar"; const routes = { "/": () => , @@ -14,21 +13,5 @@ const routes = { }; export default function SessionRouter() { - const content = useRoutes(routes) || ; - const path = - content && - content.props && - content.props.children && - content.props.children.props && - content.props.children.props.value; - const login = - !path || path === "/" || path === "/login" || path === "/login/"; - return ( -
- {!login && } -
- {content} -
-
- ); + return useRoutes(routes) || ; }