mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-31 17:19:56 +08:00
init: the first public commit for AFFiNE
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { useShowSettingsSidebar } from '@toeverything/datasource/state';
|
||||
import { ContainerTabs } from './ContainerTabs';
|
||||
|
||||
const SETTINGS_SIDEBAR_WIDTH = 370;
|
||||
|
||||
export const SettingsSidebar = () => {
|
||||
const { showSettingsSidebar } = useShowSettingsSidebar();
|
||||
|
||||
return (
|
||||
<StyledContainerForSidebar
|
||||
isShow={showSettingsSidebar}
|
||||
id="id-side-panel"
|
||||
>
|
||||
{showSettingsSidebar ? <ContainerTabs /> : null}
|
||||
</StyledContainerForSidebar>
|
||||
);
|
||||
};
|
||||
|
||||
const StyledContainerForSidebar = styled('div', {
|
||||
shouldForwardProp: (prop: string) => !['isShow'].includes(prop),
|
||||
})<{ isShow?: boolean }>(({ theme, isShow }) => {
|
||||
return {
|
||||
flex: 'none',
|
||||
width: isShow ? SETTINGS_SIDEBAR_WIDTH : 0,
|
||||
// TODO: animation not working
|
||||
transition: 'all 300ms ease-in-out',
|
||||
borderLeft: `1px solid ${theme.affine.palette.menuSeparator}`,
|
||||
zIndex: 100,
|
||||
backgroundColor: 'white',
|
||||
overflow: 'hidden',
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user