feat: modify sidebar style (#1508)

This commit is contained in:
Qi 2023-03-10 16:52:25 +08:00 committed by GitHub
parent 5e73f02b43
commit a20368c491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 17 deletions

View File

@ -36,6 +36,7 @@ export const SidebarSwitch = ({
>
<StyledSidebarSwitch
visible={visible}
disabled={!visible}
data-testid={testid}
onClick={useCallback(() => {
setOpen(!open);

View File

@ -1,23 +1,10 @@
import { styled } from '@affine/component';
import { IconButton, styled } from '@affine/component';
export const StyledSidebarSwitch = styled('button')<{ visible: boolean }>(
({ theme, visible }) => {
export const StyledSidebarSwitch = styled(IconButton)<{ visible: boolean }>(
({ visible }) => {
return {
display: 'inline-flex',
justifyContent: 'center',
alignItems: 'center',
color: theme.colors.innerHoverBackground,
width: '32px',
height: '32px',
borderRadius: '8px',
opacity: visible ? 1 : 0,
transition: 'all 0.2s ease-in-out',
...(visible ? {} : { cursor: 'not-allowed', pointerEvents: 'none' }),
':hover': {
background: '#F1F1F4',
color: theme.colors.iconColor,
},
};
}
);

View File

@ -2,7 +2,8 @@ import { MuiAvatar, textEllipsis } from '@affine/component';
import { styled } from '@affine/component';
export const SelectorWrapper = styled('div')(({ theme }) => {
return {
height: '64px',
marginTop: '4px',
height: '56px',
display: 'flex',
alignItems: 'center',
padding: '0 44px 0 12px',