Skip to content

Commit 7f14659

Browse files
fix show more matches button
1 parent 4fda82f commit 7f14659

File tree

3 files changed

+40
-27
lines changed

3 files changed

+40
-27
lines changed

packages/ui/locales/en/views.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,15 @@
422422
"failure": "Failure",
423423
"label": "Status",
424424
"favorite": "Favorites"
425+
},
426+
"tagsOption": {
427+
"label": "Tags"
428+
},
429+
"connectorIdentifierOption": {
430+
"label": "Connector Identifier"
431+
},
432+
"descriptionOption": {
433+
"label": "Description"
425434
}
426435
},
427436
"connectivityStatus": "Connectivity status",

packages/ui/locales/fr/views.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,15 @@
413413
"failure": "Échec",
414414
"label": "Statut",
415415
"favorite": "Favorites"
416+
},
417+
"tagsOption": {
418+
"label": "Tags"
419+
},
420+
"connectorIdentifierOption": {
421+
"label": "Connector Identifier"
422+
},
423+
"descriptionOption": {
424+
"label": "Description"
416425
}
417426
},
418427
"connectivityStatus": "État de la connexion",

packages/ui/src/views/search/components/search-results-list.tsx

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC, useState } from 'react'
22

3-
import { Accordion, Alert, Layout, Link, Skeleton, Spacer, Tag, Text } from '@/components'
3+
import { Accordion, Alert, Button, Layout, Link, Skeleton, Spacer, Tag, Text } from '@/components'
44
import { useTranslation } from '@/context'
55
import { cn } from '@utils/cn'
66

@@ -110,7 +110,7 @@ export const SearchResultsList: FC<SearchResultsListProps> = ({
110110
</Link>
111111
</Layout.Horizontal>
112112
</Accordion.Trigger>
113-
<Accordion.Content className="border-t bg-cn-background-1 pb-0">
113+
<Accordion.Content className="bg-cn-background-1 border-t pb-0">
114114
{item.matches && item.matches.length >= 1 && (
115115
<Layout.Vertical gap="none" className="mt-1">
116116
{item.matches
@@ -147,31 +147,26 @@ export const SearchResultsList: FC<SearchResultsListProps> = ({
147147
</div>
148148
))}
149149
{item.matches?.length > DEFAULT_NUM_ITEMS_TO_SHOW && (
150-
<Text
151-
variant="caption-single-line-normal"
152-
className="mt-2 cursor-pointer bg-cn-background-0 py-1.5 pl-4 hover:underline"
153-
tabIndex={0}
154-
onMouseDown={e => {
155-
e.preventDefault()
156-
}}
157-
onClick={e => {
158-
e.stopPropagation()
159-
e.preventDefault()
160-
161-
const key = `${item.repo_path}/${item.file_name}`
162-
setExpandedItems(prev => ({
163-
...prev,
164-
[key]: !prev[key]
165-
}))
166-
}}
167-
>
168-
{expandedItems[`${item.repo_path}/${item.file_name}`]
169-
? t('views:search.showLess', '- Show Less')
170-
: t(
171-
'views:search.showMore',
172-
`+ Show ${item.matches.length - DEFAULT_NUM_ITEMS_TO_SHOW} more matches`
173-
)}
174-
</Text>
150+
<div className="bg-cn-background-0 mt-2 py-1.5 pl-4">
151+
<Button
152+
variant="link"
153+
className="text-cn-2 font-caption-single-line-normal p-cn-4xs h-fit"
154+
onClick={() => {
155+
const key = `${item.repo_path}/${item.file_name}`
156+
setExpandedItems(prev => ({
157+
...prev,
158+
[key]: !prev[key]
159+
}))
160+
}}
161+
>
162+
{expandedItems[`${item.repo_path}/${item.file_name}`]
163+
? t('views:search.showLess', '- Show Less')
164+
: t(
165+
'views:search.showMore',
166+
`+ Show ${item.matches.length - DEFAULT_NUM_ITEMS_TO_SHOW} more matches`
167+
)}
168+
</Button>
169+
</div>
175170
)}
176171
</Layout.Vertical>
177172
)}

0 commit comments

Comments
 (0)