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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 33 deletions

View File

@ -96,35 +96,38 @@ export const Results: React.FC<ResultsProps> = ({
)
) : (
<div>
<Command.Group heading={t('Recently viewed')}>
{recentlyViewed.map(recent => {
return (
<Command.Item
key={recent.id}
value={recent.id}
onSelect={() => {
onClose();
router.push({
pathname: '/workspace/[workspaceId]/[pageId]',
query: {
workspaceId: blockSuiteWorkspace.room,
pageId: recent.id,
},
});
}}
>
<StyledListItem>
{recent.mode === 'edgeless' ? (
<EdgelessIcon />
) : (
<PaperIcon />
)}
<span>{recent.title}</span>
</StyledListItem>
</Command.Item>
);
})}
</Command.Group>
{recentlyViewed.length > 0 && (
<Command.Group heading={t('Recent')}>
{recentlyViewed.map(recent => {
return (
<Command.Item
key={recent.id}
value={recent.id}
onSelect={() => {
onClose();
router.push({
pathname: '/workspace/[workspaceId]/[pageId]',
query: {
workspaceId: blockSuiteWorkspace.room,
pageId: recent.id,
},
});
}}
>
<StyledListItem>
{recent.mode === 'edgeless' ? (
<EdgelessIcon />
) : (
<PaperIcon />
)}
<span>{recent.title}</span>
</StyledListItem>
</Command.Item>
);
})}
</Command.Group>
)}
<Command.Group heading={t('Jump to')}>
{List.map(link => {
return (

View File

@ -8,13 +8,16 @@ export const StyledContent = styled('div')(({ theme }) => {
overflow: 'auto',
marginBottom: '10px',
...displayFlex('center', 'flex-start'),
color: theme.colors.popoverColor,
color: theme.colors.textColor,
transition: 'all 0.15s',
letterSpacing: '0.06em',
'[cmdk-group-heading]': {
margin: '5px 16px',
fontSize: theme.font.base,
fontWeight: '500',
...displayFlex('start', 'center'),
margin: '0 16px',
height: '36px',
lineHeight: '22px',
fontSize: theme.font.sm,
color: theme.colors.secondaryTextColor,
},
'[aria-selected="true"]': {
borderRadius: '5px',