From fd72f693039499d3b8295855ab7f8448f003e62b Mon Sep 17 00:00:00 2001 From: JimmFly Date: Tue, 7 Feb 2023 12:31:06 +0800 Subject: [PATCH] chore: update style --- .../app/src/components/quick-search/index.tsx | 80 ++++++++++--------- .../app/src/components/quick-search/style.ts | 3 +- 2 files changed, 46 insertions(+), 37 deletions(-) diff --git a/packages/app/src/components/quick-search/index.tsx b/packages/app/src/components/quick-search/index.tsx index 88f1b7e12..39a9ec036 100644 --- a/packages/app/src/components/quick-search/index.tsx +++ b/packages/app/src/components/quick-search/index.tsx @@ -30,7 +30,9 @@ export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => { const [publishWorkspaceName, setPublishWorkspaceName] = useState(''); const [showCreatePage, setShowCreatePage] = useState(true); const { triggerQuickSearchModal } = useModal(); - + const isPublicAndNoQuery = () => { + return isPublic && query.length === 0; + }; // Add ‘⌘+K’ shortcut keys as switches useEffect(() => { const down = (e: KeyboardEvent) => { @@ -72,7 +74,7 @@ export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => { width={620} style={{ maxHeight: '80vh', - minHeight: isPublic && query.length === 0 ? '72px' : '350px', + minHeight: isPublicAndNoQuery() ? '72px' : '350px', top: '12vh', }} > @@ -100,41 +102,47 @@ export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => { /> {isMac() ? '⌘ + K' : 'Ctrl + K'} - {isPublic && query.length === 0 ? null : ( - <> - - - - {!isPublic ? ( - - ) : ( - - )} - + <> + + + {!isPublic ? ( - showCreatePage ? ( - <> - - -