Expand on right drawer (#769)

Ok
This commit is contained in:
Lucas Bordeau
2023-07-20 00:00:50 +02:00
committed by GitHub
parent 3336e6960d
commit c8065f82e8
13 changed files with 103 additions and 54 deletions

View File

@ -0,0 +1,31 @@
import {
IconLayoutSidebarRightCollapse,
IconLayoutSidebarRightExpand,
} from '@tabler/icons-react';
import { useRecoilState } from 'recoil';
import { IconButton } from '../../button/components/IconButton';
import { isRightDrawerExpandedState } from '../states/isRightDrawerExpandedState';
export function RightDrawerTopBarExpandButton() {
const [isRightDrawerExpanded, setIsRightDrawerExpanded] = useRecoilState(
isRightDrawerExpandedState,
);
function handleButtonClick() {
setIsRightDrawerExpanded(!isRightDrawerExpanded);
}
return (
<IconButton
icon={
isRightDrawerExpanded ? (
<IconLayoutSidebarRightCollapse size={16} />
) : (
<IconLayoutSidebarRightExpand size={16} />
)
}
onClick={handleButtonClick}
/>
);
}