1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

Fix: insights beta badge (#6568)

Reuses the beta badge from insights
<img width="1448" alt="Screenshot 2024-03-14 at 18 01 42"
src="https://github.com/Unleash/unleash/assets/104830839/c85b6838-c120-471b-9ff3-440c4208dc53">

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2024-03-15 09:25:23 +02:00 committed by GitHub
parent dfdd9f0dd3
commit 26ad9fc3f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -127,34 +127,19 @@ const StyledAdvancedNavButton = styled('button')(({ theme }) => ({
cursor: 'pointer', cursor: 'pointer',
})); }));
const StyledSpan = styled('span')({
height: '16px',
paddingBottom: 16,
});
const StyledBadge = styled(Badge)({
height: '16px',
maxHeight: '16px',
padding: 0.25,
marginBottom: 0,
});
const styledIconProps = (theme: Theme) => ({ const styledIconProps = (theme: Theme) => ({
color: theme.palette.neutral.main, color: theme.palette.neutral.main,
}); });
const StyledLink = styled(Link)(({ theme }) => focusable(theme)); const StyledLink = styled(Link)(({ theme }) => focusable(theme));
const StyledLinkWithBetaBagde = ({ const StyledLinkWithBetaBadge = ({
title, title,
to, to,
}: { title: string; to: string }) => ( }: { title: string; to: string }) => (
<StyledLink to={to} sx={{ margin: 0 }}> <StyledLink to={to} sx={{ margin: 0 }}>
<div> <div>
<span>{title}</span>{' '} <span>{title}</span> <Badge color='success'>Beta</Badge>
<StyledSpan>
<StyledBadge color='success'>Beta</StyledBadge>
</StyledSpan>
</div> </div>
</StyledLink> </StyledLink>
); );
@ -279,7 +264,7 @@ const Header: VFC = () => {
<ConditionallyRender <ConditionallyRender
condition={insightsDashboard} condition={insightsDashboard}
show={ show={
<StyledLinkWithBetaBagde <StyledLinkWithBetaBadge
to={'/insights'} to={'/insights'}
title={'Insights'} title={'Insights'}
/> />