diff --git a/packages/apps/esm-login-app/__mocks__/config.mock.ts b/packages/apps/esm-login-app/__mocks__/config.mock.ts index 16b2bc691..c125a1ca8 100644 --- a/packages/apps/esm-login-app/__mocks__/config.mock.ts +++ b/packages/apps/esm-login-app/__mocks__/config.mock.ts @@ -1,4 +1,4 @@ -import { ConfigSchema } from '../src/config-schema'; +import { type ConfigSchema } from '../src/config-schema'; export const mockConfig: ConfigSchema = { provider: { @@ -19,5 +19,8 @@ export const mockConfig: ConfigSchema = { links: { loginSuccess: '${openmrsSpaBase}/home', }, + footer: { + additionalLogos: [], + }, showPasswordOnSeparateScreen: true, }; diff --git a/packages/apps/esm-login-app/src/config-schema.ts b/packages/apps/esm-login-app/src/config-schema.ts index b550a92fc..cfe544a30 100644 --- a/packages/apps/esm-login-app/src/config-schema.ts +++ b/packages/apps/esm-login-app/src/config-schema.ts @@ -68,6 +68,29 @@ export const configSchema = { _description: 'The alternative text for the logo image, displayed when the image cannot be loaded or on hover.', }, }, + footer: { + additionalLogos: { + _type: Type.Array, + _elements: { + _type: Type.Object, + _properties: { + src: { + _type: Type.String, + _required: true, + _description: 'The source URL of the logo image', + _validations: [validators.isUrl] + }, + alt: { + _type: Type.String, + _required: true, + _description: 'The alternative text for the logo image' + } + } + }, + _default: [], + _description: 'An array of logos to be displayed in the footer next to the OpenMRS logo.', + } + }, showPasswordOnSeparateScreen: { _type: Type.Boolean, _default: true, @@ -95,5 +118,11 @@ export interface ConfigSchema { alt: string; src: string; }; + footer: { + additionalLogos: Array<{ + src: string; + alt: string; + }>; + }; showPasswordOnSeparateScreen: boolean; } diff --git a/packages/apps/esm-login-app/src/footer.component.tsx b/packages/apps/esm-login-app/src/footer.component.tsx new file mode 100644 index 000000000..130753f67 --- /dev/null +++ b/packages/apps/esm-login-app/src/footer.component.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +import { interpolateUrl, useConfig } from '@openmrs/esm-framework'; +import { useTranslation } from 'react-i18next'; +import { type ConfigSchema } from './config-schema'; +import styles from './login/login.scss'; + +const Footer: React.FC = () => { + const {t} = useTranslation(); + const config = useConfig(); + const logos = config.footer.additionalLogos || []; + + return ( +
+

{t('poweredBy', 'Powered by')}

+
+ + + + {logos.map((logo, index) => ( + {logo.alt + ))} +
+
+ ); +}; + +export default Footer; \ No newline at end of file diff --git a/packages/apps/esm-login-app/src/login/login.component.tsx b/packages/apps/esm-login-app/src/login/login.component.tsx index 51a263ed46..6213fcd94 100644 --- a/packages/apps/esm-login-app/src/login/login.component.tsx +++ b/packages/apps/esm-login-app/src/login/login.component.tsx @@ -14,6 +14,7 @@ import { } from '@openmrs/esm-framework'; import { type ConfigSchema } from '../config-schema'; import Logo from '../logo.component'; +import Footer from '../footer.component'; import styles from './login.scss'; export interface LoginReferrer { @@ -265,14 +266,7 @@ const Login: React.FC = () => { )} -
-

{t('poweredBy', 'Powered by')}

-
- - - -
-
+