Added search component to the all authors page
This commit is contained in:
parent
e80a9ec7e7
commit
180db86fd2
|
@ -9,6 +9,7 @@ import styles from '../../styles/AllTopics.module.scss'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import { useSession } from '../../context/session'
|
import { useSession } from '../../context/session'
|
||||||
import { locale } from '../../stores/ui'
|
import { locale } from '../../stores/ui'
|
||||||
|
import { SearchField } from '../_shared/SearchField'
|
||||||
|
|
||||||
type AllAuthorsPageSearchParams = {
|
type AllAuthorsPageSearchParams = {
|
||||||
by: '' | 'name' | 'shouts' | 'rating'
|
by: '' | 'name' | 'shouts' | 'rating'
|
||||||
|
@ -50,6 +51,11 @@ export const AllAuthorsView = (props: Props) => {
|
||||||
return keys
|
return keys
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// TODO make search
|
||||||
|
const searchAuthors = (value) => {
|
||||||
|
let q = value.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
const showMore = () => setLimit((oldLimit) => oldLimit + PAGE_SIZE)
|
const showMore = () => setLimit((oldLimit) => oldLimit + PAGE_SIZE)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -72,10 +78,7 @@ export const AllAuthorsView = (props: Props) => {
|
||||||
<a href="/authors">{t('By alphabet')}</a>
|
<a href="/authors">{t('By alphabet')}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="view-switcher__search">
|
<li class="view-switcher__search">
|
||||||
<a href="/authors/search">
|
<SearchField onChange={searchAuthors} />
|
||||||
<Icon name="search" />
|
|
||||||
{t('Search author')}
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user