mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
feat(core): split right sidebar (#5971)
https://github.com/toeverything/AFFiNE/assets/13579374/c846c069-aa32-445d-b59b-b773a9b05ced Now each view has a general container, the yellow area is the general container part, and the green part is the routing specific part. 
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { SidebarIcon } from '@blocksuite/icons';
|
||||
import clsx from 'clsx';
|
||||
import { useAtom } from 'jotai';
|
||||
|
||||
import { IconButton } from '../../../ui/button';
|
||||
@@ -7,7 +8,13 @@ import { Tooltip } from '../../../ui/tooltip';
|
||||
import { appSidebarOpenAtom } from '../index.jotai';
|
||||
import * as styles from './sidebar-switch.css';
|
||||
|
||||
export const SidebarSwitch = ({ show }: { show: boolean }) => {
|
||||
export const SidebarSwitch = ({
|
||||
show = true,
|
||||
className,
|
||||
}: {
|
||||
show?: boolean;
|
||||
className?: string;
|
||||
}) => {
|
||||
const [open, setOpen] = useAtom(appSidebarOpenAtom);
|
||||
const t = useAFFiNEI18N();
|
||||
const tooltipContent = open
|
||||
@@ -22,7 +29,7 @@ export const SidebarSwitch = ({ show }: { show: boolean }) => {
|
||||
side={open ? 'bottom' : 'right'}
|
||||
>
|
||||
<IconButton
|
||||
className={styles.sidebarSwitch}
|
||||
className={clsx(styles.sidebarSwitch, className)}
|
||||
data-show={show}
|
||||
size="large"
|
||||
data-testid={`app-sidebar-arrow-button-${open ? 'collapse' : 'expand'}`}
|
||||
|
||||
@@ -3,11 +3,11 @@ import { style } from '@vanilla-extract/css';
|
||||
export const notFoundPageContainer = style({
|
||||
fontSize: cssVar('fontBase'),
|
||||
color: cssVar('textPrimaryColor'),
|
||||
height: '100vh',
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
width: '100vw',
|
||||
width: '100%',
|
||||
padding: '0 20px',
|
||||
});
|
||||
export const wrapper = style({
|
||||
|
||||
@@ -13,7 +13,7 @@ export const root = style({
|
||||
},
|
||||
position: 'relative',
|
||||
width: panelWidthVar,
|
||||
minWidth: 0,
|
||||
minWidth: panelWidthVar,
|
||||
height: '100%',
|
||||
selectors: {
|
||||
'&[data-is-floating="true"]': {
|
||||
|
||||
@@ -48,13 +48,12 @@ export const mainContainerStyle = style({
|
||||
zIndex: 0,
|
||||
// it will create stacking context to limit layer of child elements and be lower than after auto zIndex
|
||||
width: 0,
|
||||
display: 'flex',
|
||||
flex: 1,
|
||||
maxWidth: '100%',
|
||||
backgroundColor: cssVar('backgroundPrimaryColor'),
|
||||
selectors: {
|
||||
'&[data-show-padding="true"]': {
|
||||
margin: '8px',
|
||||
borderRadius: '5px',
|
||||
overflow: 'hidden',
|
||||
// todo: is this performance intensive?
|
||||
filter: 'drop-shadow(0px 0px 4px rgba(66,65,73,.14))',
|
||||
@@ -66,9 +65,6 @@ export const mainContainerStyle = style({
|
||||
},
|
||||
},
|
||||
},
|
||||
'&[data-show-padding="true"][data-is-macos="true"]': {
|
||||
borderRadius: '6px',
|
||||
},
|
||||
'&[data-show-padding="true"]:before': {
|
||||
content: '""',
|
||||
position: 'absolute',
|
||||
|
||||
Reference in New Issue
Block a user