Skip to content

Commit

Permalink
PS-745 use logo instead of databox text (#499)
Browse files Browse the repository at this point in the history
* use logo if exist

* add maxHeight maxWidth

* fix icon alignement and add git-log link
  • Loading branch information
aynsix authored Dec 4, 2024
1 parent bf36a79 commit 944c51c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
1 change: 1 addition & 0 deletions dashboard/client/config-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
30 changes: 20 additions & 10 deletions dashboard/client/src/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,26 @@ export default function Dashboard({}: Props) {
},
}}
>
{STACK_NAME}
{user ? (
<Chip
icon={<SellIcon />}
label={STACK_VERSION}
color={'info'}
/>
) : (
''
)}
<div style={{ display: 'flex', alignItems: 'center' }}>
{
config.logo ? <img src={config.logo} alt={STACK_NAME} style={{ maxHeight:48, maxWidth:150 }}/>
: STACK_NAME
}

{user ? (
<Chip
icon={<SellIcon />}
label={STACK_VERSION}
color={'info'}
component="a"
href="/git-log.html"
target={'_blank'}
clickable
/>
) : (
''
)}
</div>
</Typography>
</DashboardBar>
)}
Expand Down
1 change: 1 addition & 0 deletions databox/client/config-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion databox/client/src/components/Layout/MainAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ export default function MainAppBar({onToggleLeftPanel}: Props) {
cursor: 'pointer',
}}
>
{t('common.databox', `Databox`)}
{
config.logo ? <img src={config.logo} alt={t('common.databox', `Databox`)} style={{ maxHeight:32, maxWidth:150 }}/>
: t('common.databox', `Databox`)
}

</Typography>

<Box
Expand Down
1 change: 1 addition & 0 deletions lib/js/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type WindowConfig = {
analytics?: AnalyticsConfig;
pusherHost?: Readonly<string>;
pusherKey?: Readonly<string>;
logo: Readonly<string>;
}

export type SentryConfig = Pick<WindowConfig,
Expand Down

0 comments on commit 944c51c

Please sign in to comment.