Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logo misalignment #5028

Merged
merged 4 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/yellow-singers-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wso2is/console": patch
"@wso2is/theme": patch
---

Fix logo misalignment
68 changes: 26 additions & 42 deletions apps/console/src/features/core/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -406,53 +406,37 @@ export const Header: FunctionComponent<HeaderPropsInterface> = (
return true;
};

const LOGO_IMAGE = () => {
return (
<Image
src={ resolveAppLogoFilePath(
window[ "AppUtils" ].getConfig().ui.appLogoPath,
`${ window[ "AppUtils" ].getConfig().clientOrigin
}/` +
`${ StringUtils.removeSlashesFromPath(
window[ "AppUtils" ].getConfig()
.appBase
) !== ""
? StringUtils.removeSlashesFromPath(
window[ "AppUtils" ].getConfig()
.appBase
) + "/"
: ""
}libs/themes/` +
config.ui.theme.name
) }
alt="logo"
/>
);
};

return (
<OxygenHeader
className="is-header"
brand={ {
logo: {
desktop: (
<Image
src={ resolveAppLogoFilePath(
window[ "AppUtils" ].getConfig().ui.appLogoPath,
`${ window[ "AppUtils" ].getConfig().clientOrigin
}/` +
`${ StringUtils.removeSlashesFromPath(
window[ "AppUtils" ].getConfig()
.appBase
) !== ""
? StringUtils.removeSlashesFromPath(
window[ "AppUtils" ].getConfig()
.appBase
) + "/"
: ""
}libs/themes/` +
config.ui.theme.name
) }
alt="logo"
/>
),
mobile: (
<Image
src={ resolveAppLogoFilePath(
window[ "AppUtils" ].getConfig().ui.appLogoPath,
`${ window[ "AppUtils" ].getConfig().clientOrigin
}/` +
`${ StringUtils.removeSlashesFromPath(
window[ "AppUtils" ].getConfig()
.appBase
) !== ""
? StringUtils.removeSlashesFromPath(
window[ "AppUtils" ].getConfig()
.appBase
) + "/"
: ""
}libs/themes/` +
config.ui.theme.name
) }
alt="logo"
/>
)
desktop: (<LOGO_IMAGE />),
mobile: (<LOGO_IMAGE />)
},
onClick: () => history.push(config.deployment.appHomePath),
title: config.ui.appName
Expand Down
2 changes: 2 additions & 0 deletions modules/theme/src/themes/default/elements/header.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ h6.ui.header .sub.header {
.is-header {
&.oxygen-header .oxygen-brand {
width: auto;
min-width: calc(var(--oxygen-customComponents-Navbar-properties-width) - 90px);
}

&.oxygen-header .oxygen-brand-logo {
Expand All @@ -104,5 +105,6 @@ h6.ui.header .sub.header {

&.oxygen-header.with-hamburger .oxygen-header-toolbar .oxygen-brand {
margin-left: 0 !important;
margin-right: 18px;
}
}
Loading