[#122] format tag filters

This commit is contained in:
amirhouieh 2023-08-29 18:02:36 +02:00
parent dab25d06d9
commit fb6bb6cdbc
3 changed files with 5 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import {
} from 'use-query-params'
import { useDeepCompareEffect } from 'react-use'
import { lsdUtils } from '@/utils/lsd.utils'
import { formatTagText } from '@/utils/string.utils'
interface SearchBoxProps {
onSearch?: (query: string, tags: string[], types: LPE.ContentType[]) => void
tags?: string[]
@ -227,7 +228,7 @@ const SearchBox = (props: SearchBoxProps) => {
<Dropdown
size={'small'}
placeholder={'Topics'}
options={tags.map((t) => ({ name: t, value: t }))}
options={tags.map((t) => ({ name: formatTagText(t), value: t }))}
value={hydrated ? (filterTags as string[]) : []}
onChange={(n) => setFilterTags(n as string[])}
multi={true}

View File

@ -98,6 +98,9 @@ export default function App({ Component, pageProps }: AppLayoutProps) {
.lsd-dropdown-menu {
z-index: 99;
}
.lsd-dropdown-item__label {
text-transform: capitalize;
}
`}
/>
<QueryClientProvider client={queryClient}>

View File

@ -1 +0,0 @@