diff --git a/app/components/CategoriesNav/Menu.tsx b/app/components/CategoriesNav/Menu.tsx index 928aa962..dbad1b38 100644 --- a/app/components/CategoriesNav/Menu.tsx +++ b/app/components/CategoriesNav/Menu.tsx @@ -20,7 +20,7 @@ export const CategoriesNav = ({categories, activeCategoryId}: CategoriesNavProps return (

Categories

- + {categories .filter((tag) => tag.name.toLowerCase().includes(search.toLowerCase())) .map(({tagId, name, questions}) => ( diff --git a/app/components/SearchInput/Input.tsx b/app/components/SearchInput/Input.tsx index 3ffba303..aa5b4214 100644 --- a/app/components/SearchInput/Input.tsx +++ b/app/components/SearchInput/Input.tsx @@ -12,8 +12,12 @@ interface SearchInputProps { * Custom styles */ expandable?: boolean + /** + * Custom placeholder + */ + placeholderText?: string } -export const SearchInput = ({onChange, expandable}: SearchInputProps) => { +export const SearchInput = ({onChange, expandable, placeholderText}: SearchInputProps) => { const [search, setSearch] = useState('') const handleSearch = (search: string) => { setSearch(search) @@ -29,7 +33,7 @@ export const SearchInput = ({onChange, expandable}: SearchInputProps) => { { handleSearch(e.currentTarget.value) diff --git a/app/routes/tags.all.tsx b/app/routes/tags.all.tsx index 43447a84..59c65599 100644 --- a/app/routes/tags.all.tsx +++ b/app/routes/tags.all.tsx @@ -6,7 +6,9 @@ export const loader = async ({request, params}: Parameters[0]) = const {data: tags, timestamp} = await loadTags(request) const tagId = params['*'] && params['*'].split('/')[0] - const currentTag = tagId ? tags.find(({tagId: checkedId, name}) => [checkedId.toString(), name].includes(tagId)) : tags[0] + const currentTag = tagId + ? tags.find(({tagId: checkedId, name}) => [checkedId.toString(), name].includes(tagId)) + : tags[0] if (currentTag === undefined) { throw new Response(null, {