From 934c7a43bb05cc6c1d7497cec6675bb7e85c0d91 Mon Sep 17 00:00:00 2001 From: aynsix Date: Mon, 2 Dec 2024 20:00:43 +0300 Subject: [PATCH 1/2] use logo if exist --- dashboard/client/config-compiler.js | 1 + dashboard/client/src/Dashboard.tsx | 6 +++++- databox/client/config-compiler.js | 1 + databox/client/src/components/Layout/MainAppBar.tsx | 6 +++++- lib/js/core/src/types.ts | 1 + 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dashboard/client/config-compiler.js b/dashboard/client/config-compiler.js index 661d6e465..e99674ff0 100644 --- a/dashboard/client/config-compiler.js +++ b/dashboard/client/config-compiler.js @@ -71,6 +71,7 @@ window.config.muiTheme = ${stackConfig.theme.replace(/^export\s+const\s+themeOpt return { customHTML, + logo: stackConfig.logo, locales: config.available_locales, autoConnectIdP: env.AUTO_CONNECT_IDP, baseUrl: env.DASHBOARD_CLIENT_URL, diff --git a/dashboard/client/src/Dashboard.tsx b/dashboard/client/src/Dashboard.tsx index 2d0310662..2297f367b 100644 --- a/dashboard/client/src/Dashboard.tsx +++ b/dashboard/client/src/Dashboard.tsx @@ -65,7 +65,11 @@ export default function Dashboard({}: Props) { }, }} > - {STACK_NAME} + { + config.logo ? {STACK_NAME} + : STACK_NAME + } + {user ? ( } diff --git a/databox/client/config-compiler.js b/databox/client/config-compiler.js index 3519002d9..85f4fc6e1 100644 --- a/databox/client/config-compiler.js +++ b/databox/client/config-compiler.js @@ -61,6 +61,7 @@ window.config.muiTheme = ${stackConfig.theme.replace(/^export\s+const\s+themeOpt return { customHTML, + logo: stackConfig.logo, autoConnectIdP: env.AUTO_CONNECT_IDP, baseUrl: env.DATABOX_API_URL, uploaderApiBaseUrl: env.UPLOADER_API_URL, diff --git a/databox/client/src/components/Layout/MainAppBar.tsx b/databox/client/src/components/Layout/MainAppBar.tsx index e21e399ce..f0431318d 100644 --- a/databox/client/src/components/Layout/MainAppBar.tsx +++ b/databox/client/src/components/Layout/MainAppBar.tsx @@ -78,7 +78,11 @@ export default function MainAppBar({onToggleLeftPanel}: Props) { cursor: 'pointer', }} > - {t('common.databox', `Databox`)} + { + config.logo ? {t('common.databox', + : t('common.databox', `Databox`) + } + ; pusherKey?: Readonly; + logo: Readonly; } export type SentryConfig = Pick Date: Tue, 3 Dec 2024 12:17:30 +0300 Subject: [PATCH 2/2] add maxHeight maxWidth --- dashboard/client/src/Dashboard.tsx | 2 +- databox/client/src/components/Layout/MainAppBar.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/client/src/Dashboard.tsx b/dashboard/client/src/Dashboard.tsx index 2297f367b..e542695ec 100644 --- a/dashboard/client/src/Dashboard.tsx +++ b/dashboard/client/src/Dashboard.tsx @@ -66,7 +66,7 @@ export default function Dashboard({}: Props) { }} > { - config.logo ? {STACK_NAME} + config.logo ? {STACK_NAME} : STACK_NAME } diff --git a/databox/client/src/components/Layout/MainAppBar.tsx b/databox/client/src/components/Layout/MainAppBar.tsx index f0431318d..abc02defb 100644 --- a/databox/client/src/components/Layout/MainAppBar.tsx +++ b/databox/client/src/components/Layout/MainAppBar.tsx @@ -79,7 +79,7 @@ export default function MainAppBar({onToggleLeftPanel}: Props) { }} > { - config.logo ? {t('common.databox', + config.logo ? {t('common.databox', : t('common.databox', `Databox`) }