mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
chore: add beta badge to event timeline in new in unleash (#8377)
https://linear.app/unleash/issue/2-2750/add-beta-badge-to-event-timeline-in-the-new-in-unleash-section Adds a beta badge to the event timeline item in "New in Unleash". ![image](https://github.com/user-attachments/assets/3db04c83-e34b-439a-b9be-8214df78f165)
This commit is contained in:
parent
e1f3315f57
commit
01dfbcd74c
@ -84,6 +84,7 @@ type NewItem = {
|
|||||||
show: boolean;
|
show: boolean;
|
||||||
longDescription: ReactNode;
|
longDescription: ReactNode;
|
||||||
preview?: ReactNode;
|
preview?: ReactNode;
|
||||||
|
beta?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
interface INewInUnleashProps {
|
interface INewInUnleashProps {
|
||||||
@ -174,6 +175,7 @@ export const NewInUnleash = ({
|
|||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
|
beta: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -218,6 +220,7 @@ export const NewInUnleash = ({
|
|||||||
docsLink,
|
docsLink,
|
||||||
preview,
|
preview,
|
||||||
summary,
|
summary,
|
||||||
|
beta = false,
|
||||||
}) => (
|
}) => (
|
||||||
<NewInUnleashItem
|
<NewInUnleashItem
|
||||||
key={label}
|
key={label}
|
||||||
@ -243,6 +246,7 @@ export const NewInUnleash = ({
|
|||||||
longDescription={longDescription}
|
longDescription={longDescription}
|
||||||
docsLink={docsLink}
|
docsLink={docsLink}
|
||||||
summary={summary}
|
summary={summary}
|
||||||
|
beta={beta}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
)}
|
)}
|
||||||
|
@ -10,6 +10,8 @@ import {
|
|||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import Close from '@mui/icons-material/Close';
|
import Close from '@mui/icons-material/Close';
|
||||||
import { NewInUnleashTooltip } from './NewInUnleashTooltip';
|
import { NewInUnleashTooltip } from './NewInUnleashTooltip';
|
||||||
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
|
import { Badge } from 'component/common/Badge/Badge';
|
||||||
|
|
||||||
const StyledItemButton = styled(ListItemButton)(({ theme }) => ({
|
const StyledItemButton = styled(ListItemButton)(({ theme }) => ({
|
||||||
outline: `1px solid ${theme.palette.divider}`,
|
outline: `1px solid ${theme.palette.divider}`,
|
||||||
@ -26,6 +28,12 @@ const LabelWithSummary = styled('div')(({ theme }) => ({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const StyledItemTitle = styled('div')(({ theme }) => ({
|
||||||
|
display: 'flex',
|
||||||
|
gap: theme.spacing(1),
|
||||||
|
alignItems: 'center',
|
||||||
|
}));
|
||||||
|
|
||||||
const StyledItemButtonClose = styled(IconButton)(({ theme }) => ({
|
const StyledItemButtonClose = styled(IconButton)(({ theme }) => ({
|
||||||
padding: theme.spacing(0.25),
|
padding: theme.spacing(0.25),
|
||||||
}));
|
}));
|
||||||
@ -40,6 +48,7 @@ interface INewInUnleashItemProps {
|
|||||||
docsLink: string;
|
docsLink: string;
|
||||||
preview?: ReactNode;
|
preview?: ReactNode;
|
||||||
summary: string;
|
summary: string;
|
||||||
|
beta: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useTooltip = () => {
|
const useTooltip = () => {
|
||||||
@ -66,6 +75,7 @@ export const NewInUnleashItem = ({
|
|||||||
docsLink,
|
docsLink,
|
||||||
preview,
|
preview,
|
||||||
summary,
|
summary,
|
||||||
|
beta,
|
||||||
}: INewInUnleashItemProps) => {
|
}: INewInUnleashItemProps) => {
|
||||||
const { open, handleTooltipOpen, handleTooltipClose } = useTooltip();
|
const { open, handleTooltipOpen, handleTooltipClose } = useTooltip();
|
||||||
|
|
||||||
@ -90,13 +100,20 @@ export const NewInUnleashItem = ({
|
|||||||
onCheckItOut={onCheckItOut}
|
onCheckItOut={onCheckItOut}
|
||||||
docsLink={docsLink}
|
docsLink={docsLink}
|
||||||
preview={preview}
|
preview={preview}
|
||||||
|
beta={beta}
|
||||||
>
|
>
|
||||||
<StyledItemButton>
|
<StyledItemButton>
|
||||||
{icon}
|
{icon}
|
||||||
<LabelWithSummary>
|
<LabelWithSummary>
|
||||||
|
<StyledItemTitle>
|
||||||
<Typography fontWeight='bold' fontSize='small'>
|
<Typography fontWeight='bold' fontSize='small'>
|
||||||
{label}
|
{label}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={beta}
|
||||||
|
show={<Badge color='secondary'>Beta</Badge>}
|
||||||
|
/>
|
||||||
|
</StyledItemTitle>
|
||||||
<Typography fontSize='small'>{summary}</Typography>
|
<Typography fontSize='small'>{summary}</Typography>
|
||||||
</LabelWithSummary>
|
</LabelWithSummary>
|
||||||
<Tooltip title='Dismiss' arrow sx={{ marginLeft: 'auto' }}>
|
<Tooltip title='Dismiss' arrow sx={{ marginLeft: 'auto' }}>
|
||||||
|
@ -12,6 +12,8 @@ import {
|
|||||||
import type { Link as RouterLink } from 'react-router-dom';
|
import type { Link as RouterLink } from 'react-router-dom';
|
||||||
import OpenInNew from '@mui/icons-material/OpenInNew';
|
import OpenInNew from '@mui/icons-material/OpenInNew';
|
||||||
import { ReactComponent as UnleashLogo } from 'assets/img/logoWithWhiteText.svg';
|
import { ReactComponent as UnleashLogo } from 'assets/img/logoWithWhiteText.svg';
|
||||||
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
|
import { Badge } from 'component/common/Badge/Badge';
|
||||||
|
|
||||||
const Header = styled(Box)(({ theme }) => ({
|
const Header = styled(Box)(({ theme }) => ({
|
||||||
backgroundColor: theme.palette.primary.light,
|
backgroundColor: theme.palette.primary.light,
|
||||||
@ -67,7 +69,10 @@ const LongDescription = styled(Box)(({ theme }) => ({
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const Title = styled(Typography)(({ theme }) => ({
|
const StyledTitle = styled('div')(({ theme }) => ({
|
||||||
|
display: 'flex',
|
||||||
|
gap: theme.spacing(1),
|
||||||
|
alignItems: 'center',
|
||||||
padding: theme.spacing(1, 0, 2, 0),
|
padding: theme.spacing(1, 0, 2, 0),
|
||||||
lineHeight: 1.5,
|
lineHeight: 1.5,
|
||||||
}));
|
}));
|
||||||
@ -85,6 +90,7 @@ export const NewInUnleashTooltip: FC<{
|
|||||||
open: boolean;
|
open: boolean;
|
||||||
preview?: ReactNode;
|
preview?: ReactNode;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
|
beta: boolean;
|
||||||
}> = ({
|
}> = ({
|
||||||
children,
|
children,
|
||||||
title,
|
title,
|
||||||
@ -94,6 +100,7 @@ export const NewInUnleashTooltip: FC<{
|
|||||||
preview,
|
preview,
|
||||||
open,
|
open,
|
||||||
onClose,
|
onClose,
|
||||||
|
beta,
|
||||||
}) => (
|
}) => (
|
||||||
<HtmlTooltip
|
<HtmlTooltip
|
||||||
disableFocusListener
|
disableFocusListener
|
||||||
@ -119,7 +126,13 @@ export const NewInUnleashTooltip: FC<{
|
|||||||
)}
|
)}
|
||||||
</Header>
|
</Header>
|
||||||
<Body>
|
<Body>
|
||||||
<Title>{title}</Title>
|
<StyledTitle>
|
||||||
|
<Typography>{title}</Typography>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={beta}
|
||||||
|
show={<Badge color='secondary'>Beta</Badge>}
|
||||||
|
/>
|
||||||
|
</StyledTitle>
|
||||||
<LongDescription>{longDescription}</LongDescription>
|
<LongDescription>{longDescription}</LongDescription>
|
||||||
<ReadMore>
|
<ReadMore>
|
||||||
<StyledLink
|
<StyledLink
|
||||||
|
Loading…
Reference in New Issue
Block a user