chore: change style

This commit is contained in:
JimmFly
2022-12-09 14:51:59 +08:00
parent 9ba01e3a5a
commit 4bcea812f0
5 changed files with 49 additions and 14 deletions
@@ -1,12 +1,25 @@
import React from 'react'; import React from 'react';
import {
MiddleFavouritesIcon,
MiddleTrashIcon,
MiddleAllPagesIcon,
} from '@blocksuite/icons';
const JumpTo = () => { const JumpTo = () => {
return ( return (
<div> <div>
<div>Jump to</div> <div>Jump to</div>
<div>All pages</div> <div>
<div>Favorites</div> <MiddleAllPagesIcon />
<div>Trash</div> <span> All pages</span>
</div>
<div>
<MiddleFavouritesIcon />
<span> Favourites</span>
</div>
<div>
<MiddleTrashIcon />
<span> Trash</span>
</div>
</div> </div>
); );
}; };
@@ -1,11 +1,20 @@
import React from 'react'; import React from 'react';
import { MiddleAddIcon } from '@blocksuite/icons'; import { MiddleAddIcon } from '@blocksuite/icons';
import { StyledModalFooterContent } from './style'; import { StyledModalFooterContent } from './style';
import { useEditor } from '@/providers/editor-provider';
import { IconButton } from '@/ui/button';
const QuickSearchFooter = () => { const QuickSearchFooter = () => {
const { createPage } = useEditor();
return ( return (
<StyledModalFooterContent> <StyledModalFooterContent>
<MiddleAddIcon /> <IconButton>
<MiddleAddIcon
onClick={() => {
createPage();
}}
/>
</IconButton>
<span>New page</span> <span>New page</span>
</StyledModalFooterContent> </StyledModalFooterContent>
); );
@@ -1,4 +1,4 @@
import { Modal } from '@/ui/modal'; import { Modal, ModalWrapper } from '@/ui/modal';
import { import {
StyledModalWrapper, StyledModalWrapper,
@@ -21,7 +21,15 @@ const isMac = () => {
export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => { export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
return ( return (
<Modal open={open} onClose={onClose}> <Modal open={open} onClose={onClose}>
<StyledModalWrapper data-testid="quick-search-modal-content"> <ModalWrapper
width={620}
height={'auto'}
style={{
maxHeight: '720px',
minHeight: '350px',
borderRadius: '20px',
}}
>
<StyledModalHeader> <StyledModalHeader>
<Input /> <Input />
<StyledShortcut>{isMac() ? '⌘+K' : 'Ctrl+K'}</StyledShortcut> <StyledShortcut>{isMac() ? '⌘+K' : 'Ctrl+K'}</StyledShortcut>
@@ -34,7 +42,7 @@ export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
<StyledModalFooter> <StyledModalFooter>
<QuickSearchFooter /> <QuickSearchFooter />
</StyledModalFooter> </StyledModalFooter>
</StyledModalWrapper> </ModalWrapper>
</Modal> </Modal>
); );
}; };
@@ -22,7 +22,7 @@ export const StyledContent = styled('div')(({ theme }) => {
width: '100%', width: '100%',
padding: '5px 24px', padding: '5px 24px',
overflow: 'auto', overflow: 'auto',
color: theme.colors.textColor, color: theme.colors.popoverColor,
marginTop: '16px', marginTop: '16px',
letterSpacing: '0.06em', letterSpacing: '0.06em',
}; };
@@ -42,14 +42,18 @@ export const StyledInput = styled('input')(({ theme }) => {
fontSize: theme.font.sm, fontSize: theme.font.sm,
...displayFlex('space-between', 'center'), ...displayFlex('space-between', 'center'),
letterSpacing: '0.06em', letterSpacing: '0.06em',
color: theme.colors.textColor, color: theme.colors.popoverColor,
'::placeholder': { '::placeholder': {
color: theme.colors.placeHolderColor, color: theme.colors.placeHolderColor,
}, },
}; };
}); });
export const StyledLabel = styled('label')(({ theme }) => { export const StyledLabel = styled('label')(({ theme }) => {
return { width: '24px', height: '24px' }; return {
width: '24px',
height: '24px',
color: theme.colors.iconColor,
};
}); });
export const StyledModalHeader = styled('div')(({ theme }) => { export const StyledModalHeader = styled('div')(({ theme }) => {
@@ -57,7 +61,7 @@ export const StyledModalHeader = styled('div')(({ theme }) => {
height: '48px', height: '48px',
margin: '12px 24px 0px 24px', margin: '12px 24px 0px 24px',
...displayFlex('space-between', 'center'), ...displayFlex('space-between', 'center'),
color: theme.colors.textColor, color: theme.colors.popoverColor,
}; };
}); });
export const StyledModalDivider = styled('div')(({ theme }) => { export const StyledModalDivider = styled('div')(({ theme }) => {
@@ -75,7 +79,7 @@ export const StyledModalFooter = styled('div')(({ theme }) => {
fontSize: theme.font.sm, fontSize: theme.font.sm,
lineHeight: '20px', lineHeight: '20px',
textAlign: 'center', textAlign: 'center',
color: theme.colors.textColor, color: theme.colors.popoverColor,
margin: '16px 0', margin: '16px 0',
}; };
}); });
@@ -85,7 +89,7 @@ export const StyledModalFooterContent = styled('div')(({ theme }) => {
lineHeight: '20px', lineHeight: '20px',
textAlign: 'center', textAlign: 'center',
...displayFlex('center', 'center'), ...displayFlex('center', 'center'),
color: theme.colors.textColor, color: theme.colors.popoverColor,
margin: '16px 0', margin: '16px 0',
span: { span: {
marginLeft: '12px', marginLeft: '12px',
@@ -10,6 +10,7 @@ import {
import { Arrow } from './icons'; import { Arrow } from './icons';
import Link from 'next/link'; import Link from 'next/link';
import { useEditor } from '@/providers/editor-provider'; import { useEditor } from '@/providers/editor-provider';
import { useModal } from '@/providers/global-modal-provider';
export const WorkSpaceSliderBar = () => { export const WorkSpaceSliderBar = () => {
const { triggerQuickSearchModal } = useModal(); const { triggerQuickSearchModal } = useModal();
const [show, setShow] = useState(false); const [show, setShow] = useState(false);