Feat/add right drawer (#159)

* Added right drawer component and logic

* Refactored layout to accept right drawer
This commit is contained in:
Lucas Bordeau
2023-05-30 21:03:50 +02:00
committed by GitHub
parent 3674365e6f
commit cb259d5cf1
24 changed files with 272 additions and 39 deletions

View File

@ -4,14 +4,20 @@ import { ReactNode } from 'react';
type OwnProps = {
icon: ReactNode;
label: string;
type?: 'standard' | 'warning';
onClick: () => void;
};
const StyledButton = styled.div`
type StyledButtonProps = {
type: 'standard' | 'warning';
};
const StyledButton = styled.div<StyledButtonProps>`
display: flex;
cursor: pointer;
user-select: none;
color: ${(props) =>
props.type === 'warning' ? props.theme.red : props.theme.text60};
justify-content: center;
padding: ${(props) => props.theme.spacing(2)};
@ -28,9 +34,14 @@ const StyledButtonLabel = styled.div`
font-weight: 500;
`;
export function EntityTableActionBarButton({ label, icon, onClick }: OwnProps) {
export function EntityTableActionBarButton({
label,
icon,
type = 'standard',
onClick,
}: OwnProps) {
return (
<StyledButton onClick={onClick}>
<StyledButton type={type} onClick={onClick}>
{icon}
<StyledButtonLabel>{label}</StyledButtonLabel>
</StyledButton>