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

UI: Fix display of custom brand image #13355

Merged
merged 4 commits into from Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 54 additions & 0 deletions lib/ui/src/components/sidebar/Heading.stories.tsx
Expand Up @@ -131,3 +131,57 @@ export const customBrandImage = () => {
</ThemeProvider>
);
};

export const customBrandImageTall = () => {
const theme = useTheme() as Theme;
return (
<ThemeProvider
theme={{
...theme,
brand: {
title: 'My Title',
url: 'https://example.com',
image: 'https://via.placeholder.com/100x150',
},
}}
>
<Heading menu={menuItems} />
</ThemeProvider>
);
};

export const customBrandImageUnsizedSVG = () => {
const theme = useTheme() as Theme;
return (
<ThemeProvider
theme={{
...theme,
brand: {
title: 'My Title',
url: 'https://example.com',
image: 'https://s.cdpn.io/91525/potofgold.svg',
},
}}
>
<Heading menu={menuItems} />
</ThemeProvider>
);
};

export const noBrand = () => {
const theme = useTheme() as Theme;
return (
<ThemeProvider
theme={{
...theme,
brand: {
title: null,
url: null,
image: null,
},
}}
>
<Heading menu={menuItems} />
</ThemeProvider>
);
};
4 changes: 2 additions & 2 deletions lib/ui/src/components/sidebar/Heading.tsx
Expand Up @@ -13,7 +13,7 @@ const BrandArea = styled.div(({ theme }) => ({
fontSize: theme.typography.size.s2,
fontWeight: theme.typography.weight.bold,
color: theme.color.defaultText,
marginRight: 40,
marginRight: 20,
display: 'flex',
width: '100%',
alignItems: 'center',
Expand All @@ -22,8 +22,8 @@ const BrandArea = styled.div(({ theme }) => ({
'& > *': {
maxWidth: '100%',
height: 'auto',
width: 'auto',
display: 'block',
flex: '1 1 auto',
},
}));

Expand Down