diff --git a/packages/app/src/components/quick-search/results.tsx b/packages/app/src/components/quick-search/results.tsx index 1467a1dba6..fb09b8f75a 100644 --- a/packages/app/src/components/quick-search/results.tsx +++ b/packages/app/src/components/quick-search/results.tsx @@ -1,15 +1,21 @@ import { Command } from 'cmdk'; import { StyledListItem } from './style'; -import Link from 'next/link'; import { useModal } from '@/providers/global-modal-provider'; -import { AllPagesIcon, FavouritesIcon, TrashIcon } from '@blocksuite/icons'; +import { + AllPagesIcon, + FavouritesIcon, + TrashIcon, + PaperIcon, +} from '@blocksuite/icons'; import { useEditor } from '@/providers/editor-provider'; import { useEffect, useState } from 'react'; +import { useRouter } from 'next/router'; export const Results = (props: { query: string }) => { const query = props.query; const { triggerQuickSearchModal } = useModal(); const { search, openPage, pageList } = useEditor(); + const router = useRouter(); const [results, setResults] = useState(new Map()); useEffect(() => { return setResults(search(query)); @@ -34,43 +40,49 @@ export const Results = (props: { query: string }) => { }} value={result.title} > - {result.title} + + + {result.title} + ); })} - + { + router.push('/page-list/all'); + triggerQuickSearchModal(); + }} + > - triggerQuickSearchModal()} - > - - All pages - + + All pages - + { + router.push('/page-list/favorite'); + triggerQuickSearchModal(); + }} + > - triggerQuickSearchModal()} - > - - Favourites - + + Favourites - + { + router.push('/page-list/trash'); + triggerQuickSearchModal(); + }} + > - triggerQuickSearchModal()} - > - - Trash - + + Trash diff --git a/packages/app/src/components/quick-search/style.ts b/packages/app/src/components/quick-search/style.ts index 6bfc085eae..8be4e6a353 100644 --- a/packages/app/src/components/quick-search/style.ts +++ b/packages/app/src/components/quick-search/style.ts @@ -11,6 +11,13 @@ export const StyledContent = styled('div')(({ theme }) => { letterSpacing: '0.06em', '[cmdk-group-heading]': { margin: '5px 16px', + fontSize: theme.font.sm, + }, + '[aria-selected="true"]': { + transition: 'background .15s, color .15s', + borderRadius: '5px', + color: theme.colors.primaryColor, + backgroundColor: theme.colors.hoverBackground, }, }; }); @@ -110,7 +117,7 @@ export const StyledListItem = styled.button(({ theme }) => { width: '612px', height: '32px', fontSize: theme.font.sm, - color: theme.colors.popoverColor, + color: 'inherit', paddingLeft: '12px', borderRadius: '5px', ...displayFlex('flex-start', 'center'), @@ -118,32 +125,5 @@ export const StyledListItem = styled.button(({ theme }) => { fontSize: '20px', marginRight: '12px', }, - transition: 'background .15s, color .15s', - ':hover': { - color: theme.colors.primaryColor, - backgroundColor: theme.colors.hoverBackground, - }, - a: { - width: '100%', - color: 'inherit', - ...displayFlex('flex-start', 'center'), - ':visited': { - color: theme.colors.popoverColor, - }, - transition: 'background .15s, color .15s', - svg: { - fontSize: '20px', - color: 'inherit', - marginBottom: '2px', - }, - span: { - color: 'inherit', - margin: '0 12px', - lineHeight: '22px', - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', - }, - }, }; });