chore: update quick search style (#1376)

This commit is contained in:
JimmFly
2023-03-07 19:30:58 +08:00
committed by GitHub
parent bc9d470d08
commit 83e1cd9274
2 changed files with 39 additions and 33 deletions
@@ -96,35 +96,38 @@ export const Results: React.FC<ResultsProps> = ({
) )
) : ( ) : (
<div> <div>
<Command.Group heading={t('Recently viewed')}> {recentlyViewed.length > 0 && (
{recentlyViewed.map(recent => { <Command.Group heading={t('Recent')}>
return ( {recentlyViewed.map(recent => {
<Command.Item return (
key={recent.id} <Command.Item
value={recent.id} key={recent.id}
onSelect={() => { value={recent.id}
onClose(); onSelect={() => {
router.push({ onClose();
pathname: '/workspace/[workspaceId]/[pageId]', router.push({
query: { pathname: '/workspace/[workspaceId]/[pageId]',
workspaceId: blockSuiteWorkspace.room, query: {
pageId: recent.id, workspaceId: blockSuiteWorkspace.room,
}, pageId: recent.id,
}); },
}} });
> }}
<StyledListItem> >
{recent.mode === 'edgeless' ? ( <StyledListItem>
<EdgelessIcon /> {recent.mode === 'edgeless' ? (
) : ( <EdgelessIcon />
<PaperIcon /> ) : (
)} <PaperIcon />
<span>{recent.title}</span> )}
</StyledListItem> <span>{recent.title}</span>
</Command.Item> </StyledListItem>
); </Command.Item>
})} );
</Command.Group> })}
</Command.Group>
)}
<Command.Group heading={t('Jump to')}> <Command.Group heading={t('Jump to')}>
{List.map(link => { {List.map(link => {
return ( return (
@@ -8,13 +8,16 @@ export const StyledContent = styled('div')(({ theme }) => {
overflow: 'auto', overflow: 'auto',
marginBottom: '10px', marginBottom: '10px',
...displayFlex('center', 'flex-start'), ...displayFlex('center', 'flex-start'),
color: theme.colors.popoverColor, color: theme.colors.textColor,
transition: 'all 0.15s', transition: 'all 0.15s',
letterSpacing: '0.06em', letterSpacing: '0.06em',
'[cmdk-group-heading]': { '[cmdk-group-heading]': {
margin: '5px 16px', ...displayFlex('start', 'center'),
fontSize: theme.font.base, margin: '0 16px',
fontWeight: '500', height: '36px',
lineHeight: '22px',
fontSize: theme.font.sm,
color: theme.colors.secondaryTextColor,
}, },
'[aria-selected="true"]': { '[aria-selected="true"]': {
borderRadius: '5px', borderRadius: '5px',