This PR was created by [GitStart](https://gitstart.com/) to address the requirements from this ticket: [TWNTY-7529](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7529). --- ### Description - Migrated all button components to `twenty-ui` \ \ `Button`\ `ButtonGroup`\ `ColorPickerButton`\ `FloatingButton`\ `FloatingButtonGroup`\ `FloatingIconButton`\ `FloatingIconButtonGroup`\ `IconButton`\ `IconButtonGroup`\ `LightButton`\ `LightIconButton`\ `LightIconButtonGroup`\ `MainButton`\ \ Fixes twentyhq/private-issues#89 Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Charles Bochet <charles@twenty.com>
43 lines
898 B
TypeScript
43 lines
898 B
TypeScript
import styled from '@emotion/styled';
|
|
import { Banner, BannerVariant, Button, IconComponent } from 'twenty-ui';
|
|
|
|
const StyledBanner = styled(Banner)`
|
|
position: absolute;
|
|
`;
|
|
|
|
const StyledText = styled.div`
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
`;
|
|
|
|
export const InformationBanner = ({
|
|
message,
|
|
variant = 'default',
|
|
buttonTitle,
|
|
buttonIcon,
|
|
buttonOnClick,
|
|
}: {
|
|
message: string;
|
|
variant?: BannerVariant;
|
|
buttonTitle?: string;
|
|
buttonIcon?: IconComponent;
|
|
buttonOnClick?: () => void;
|
|
}) => {
|
|
return (
|
|
<StyledBanner variant={variant}>
|
|
<StyledText>{message}</StyledText>
|
|
{buttonTitle && buttonOnClick && (
|
|
<Button
|
|
variant="secondary"
|
|
title={buttonTitle}
|
|
Icon={buttonIcon}
|
|
size="small"
|
|
inverted
|
|
onClick={buttonOnClick}
|
|
/>
|
|
)}
|
|
</StyledBanner>
|
|
);
|
|
};
|