Skip to content

Commit 20dfa02

Browse files
committed
feat: allow search bar to be typable
1 parent 0af5841 commit 20dfa02

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

apps/web/src/routes/_app/datahub/index.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,32 @@ const RouteComponent = () => {
181181
<div className="flex grow flex-col">
182182
<div className="mb-3 flex flex-col justify-between gap-3 lg:flex-row">
183183
<Dialog open={isLookupOpen} onOpenChange={setIsLookupOpen}>
184-
<Dialog.Trigger className="grow">
184+
{isLookUpSearch ? (
185+
<Dialog.Trigger className="grow">
186+
<Button
187+
className="[&>input]:text-foreground [&>input]:placeholder-foreground grow"
188+
data-testid="datahub-subject-lookup-search"
189+
id="subject-lookup-search-bar"
190+
>
191+
{t({
192+
en: 'Click to Search',
193+
fr: 'Cliquer pour rechercher'
194+
})}
195+
</Button>
196+
</Dialog.Trigger>
197+
) : (
185198
<SearchBar
186-
className="[&>input]:text-foreground [&>input]:placeholder-foreground"
199+
className="[&>input]:text-foreground [&>input]:placeholder-foreground grow"
187200
data-testid="datahub-subject-lookup-search"
188201
id="subject-lookup-search-bar"
189202
placeholder={t({
190203
en: 'Click to Search',
191204
fr: 'Cliquer pour rechercher'
192205
})}
193-
readOnly={true}
206+
readOnly={false}
194207
/>
195-
</Dialog.Trigger>
208+
)}
209+
196210
<Dialog.Content data-spotlight-type="subject-lookup-modal" data-testid="datahub-subject-lookup-dialog">
197211
<Dialog.Header>
198212
<Dialog.Title>{t('datahub.index.lookup.title')}</Dialog.Title>

0 commit comments

Comments
 (0)