Skip to content

Commit

Permalink
Merge pull request #209 from autonomys/update-search-placeholder
Browse files Browse the repository at this point in the history
update: search placeholder
  • Loading branch information
clostao authored Feb 20, 2025
2 parents 43fbd18 + bc01ab9 commit 0a310da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/src/components/SearchBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ export const SearchBar = ({ scope }: { scope: 'global' | 'user' }) => {
});
}, [query, recommendations, error, handleSelectItem]);

const placeholder = useMemo(() => {
if (scope === 'global') {
return 'Search by Name or CID';
}

return 'Search by Name or CID within your files';
}, [scope]);

return (
<div className='mx-auto w-full max-w-md dark:text-darkBlack'>
<div className='relative mt-1'>
Expand All @@ -160,7 +168,7 @@ export const SearchBar = ({ scope }: { scope: 'global' | 'user' }) => {
onChange={handleInputChange}
onFocus={() => setIsOpen(true)}
onKeyDown={handleKeyDown}
placeholder='Search by Name or CID'
placeholder={placeholder}
/>
<button
type='button'
Expand Down

0 comments on commit 0a310da

Please sign in to comment.