Files
twenty_crm/front/src/modules/ui/layout/right-drawer/components/RightDrawerTopBarCloseButton.tsx
Charles Bochet d6364a9fdd Apply new theme (#449)
* Apply new theme

* Fix storybook

* Fixes

* Fix regressions
2023-06-26 19:13:04 -07:00

44 lines
1.0 KiB
TypeScript

import styled from '@emotion/styled';
import { useRecoilState } from 'recoil';
import { IconPlus } from '@/ui/icons/index';
import { isRightDrawerOpenState } from '../states/isRightDrawerOpenState';
const StyledButton = styled.button`
align-items: center;
background: none;
border: 1px solid ${({ theme }) => theme.border.color.light};
border-radius: 4px;
cursor: pointer;
display: flex;
flex-direction: row;
height: 24px;
padding: 3px;
transition: ${({ theme }) => theme.clickableElementBackgroundTransition};
width: 24px;
&:hover {
background: ${({ theme }) => theme.background.transparent.light};
}
svg {
color: ${({ theme }) => theme.font.color.tertiary};
transform: rotate(45deg);
}
`;
export function RightDrawerTopBarCloseButton() {
const [, setIsRightDrawerOpen] = useRecoilState(isRightDrawerOpenState);
function handleButtonClick() {
setIsRightDrawerOpen(false);
}
return (
<StyledButton onClick={handleButtonClick}>
<IconPlus size={16} />
</StyledButton>
);
}