✨(frontend) enhance QuickSearch components
- Updated QuickSearchItemContent to ensure full width for better layout consistency. - Adjusted padding in QuickSearchStyle for improved spacing and visual hierarchy. - Refactored DocSearchItem to utilize Box component for consistent styling and layout. - Removed unused imports in DocSearchItem to streamline the codebase.
This commit is contained in:
committed by
Anthony LC
parent
78b5e2c1cc
commit
899047d9a2
@@ -29,7 +29,12 @@ export const QuickSearchItemContent = ({
|
||||
$justify="space-between"
|
||||
$width="100%"
|
||||
>
|
||||
<Box $direction="row" $align="center" $gap={spacings['2xs']}>
|
||||
<Box
|
||||
$direction="row"
|
||||
$align="center"
|
||||
$gap={spacings['2xs']}
|
||||
$width="100%"
|
||||
>
|
||||
{left}
|
||||
</Box>
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ export const QuickSearchStyle = createGlobalStyle`
|
||||
|
||||
[cmdk-list] {
|
||||
|
||||
padding: 0 var(--c--theme--spacings--sm) var(--c--theme--spacings--sm)
|
||||
var(--c--theme--spacings--sm);
|
||||
padding: 0 var(--c--theme--spacings--base) var(--c--theme--spacings--base)
|
||||
var(--c--theme--spacings--base);
|
||||
|
||||
flex:1;
|
||||
overflow-y: auto;
|
||||
@@ -114,7 +114,7 @@ export const QuickSearchStyle = createGlobalStyle`
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: var(--c--theme--spacings--base);
|
||||
margin-bottom: var(--c--theme--spacings--xs);
|
||||
}
|
||||
|
||||
[cmdk-empty] {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
import { Box, Icon, Text } from '@/components';
|
||||
import { Box, Icon } from '@/components';
|
||||
import { QuickSearchItemContent } from '@/components/quick-search/QuickSearchItemContent';
|
||||
import { Doc } from '@/features/docs/doc-management';
|
||||
import { SimpleDocItem } from '@/features/docs/docs-grid/components/SimpleDocItem';
|
||||
@@ -13,26 +11,19 @@ type DocSearchItemProps = {
|
||||
export const DocSearchItem = ({ doc }: DocSearchItemProps) => {
|
||||
const { isDesktop } = useResponsiveStore();
|
||||
return (
|
||||
<div data-testid={`doc-search-item-${doc.id}`}>
|
||||
<Box data-testid={`doc-search-item-${doc.id}`} $width="100%">
|
||||
<QuickSearchItemContent
|
||||
left={
|
||||
<Box $direction="row" $align="center" $gap="10px">
|
||||
<Box $direction="row" $align="center" $gap="10px" $width="100%">
|
||||
<Box $flex={isDesktop ? 9 : 1}>
|
||||
<SimpleDocItem doc={doc} showAccesses />
|
||||
</Box>
|
||||
{isDesktop && (
|
||||
<Box $flex={2} $justify="center" $align="center">
|
||||
<Text $variation="500" $align="right" $size="xs">
|
||||
{DateTime.fromISO(doc.updated_at).toRelative()}
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
}
|
||||
right={
|
||||
<Icon iconName="keyboard_return" $theme="primary" $variation="800" />
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user