2023-12-26 10:05:15 +00:00
|
|
|
|
import { openPage } from '@nanostores/router'
|
2023-12-18 00:17:58 +00:00
|
|
|
|
import { clsx } from 'clsx'
|
2023-12-26 10:05:15 +00:00
|
|
|
|
|
2023-11-02 19:21:51 +00:00
|
|
|
|
import { useLocalize } from '../../../context/localize'
|
2023-12-26 10:05:15 +00:00
|
|
|
|
import { router, useRouter } from '../../../stores/router'
|
|
|
|
|
import { hideModal } from '../../../stores/ui'
|
2023-11-02 19:21:51 +00:00
|
|
|
|
import { Icon } from '../../_shared/Icon'
|
2023-11-30 08:50:29 +00:00
|
|
|
|
|
|
|
|
|
import styles from './SearchModal.module.scss'
|
2023-11-02 19:21:51 +00:00
|
|
|
|
|
|
|
|
|
export const SearchModal = () => {
|
|
|
|
|
const { t } = useLocalize()
|
2023-12-24 23:56:24 +00:00
|
|
|
|
const { changeSearchParams } = useRouter()
|
2023-12-24 23:05:25 +00:00
|
|
|
|
let qElement: HTMLInputElement | undefined
|
2023-12-19 13:06:54 +00:00
|
|
|
|
|
2023-12-24 23:05:25 +00:00
|
|
|
|
const submitQuery = async (ev) => {
|
|
|
|
|
ev.preventDefault()
|
2023-12-24 23:56:24 +00:00
|
|
|
|
changeSearchParams({}, true)
|
|
|
|
|
hideModal()
|
2023-12-24 23:37:30 +00:00
|
|
|
|
openPage(router, 'search', { q: qElement.value })
|
2023-11-02 19:21:51 +00:00
|
|
|
|
}
|
|
|
|
|
return (
|
2023-12-24 23:05:25 +00:00
|
|
|
|
<form onSubmit={submitQuery} class={styles.searchForm}>
|
2023-11-02 19:21:51 +00:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2023-12-24 23:05:25 +00:00
|
|
|
|
name="q"
|
2023-11-02 19:21:51 +00:00
|
|
|
|
placeholder={t('Site search')}
|
2023-12-24 23:05:25 +00:00
|
|
|
|
ref={qElement}
|
2023-11-02 19:21:51 +00:00
|
|
|
|
class={styles.searchField}
|
|
|
|
|
/>
|
2023-11-30 08:50:29 +00:00
|
|
|
|
<button type="submit" class={styles.submitControl}>
|
2023-11-02 19:21:51 +00:00
|
|
|
|
<Icon name="search" />
|
|
|
|
|
</button>
|
|
|
|
|
<p class={styles.searchDescription}>
|
|
|
|
|
Для поиска публикаций, искусства, комментариев, интересных вам авторов и тем, просто начните
|
|
|
|
|
вводить ваш запрос
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<ul class={clsx('view-switcher', styles.filterSwitcher)}>
|
|
|
|
|
<li class="view-switcher__item view-switcher__item--selected">
|
2023-12-24 23:05:25 +00:00
|
|
|
|
<button type="button">{t('All')}</button>
|
2023-11-02 19:21:51 +00:00
|
|
|
|
</li>
|
|
|
|
|
<li class="view-switcher__item">
|
2023-12-24 23:05:25 +00:00
|
|
|
|
<button type="button">{t('Publications')}</button>
|
2023-11-02 19:21:51 +00:00
|
|
|
|
</li>
|
|
|
|
|
<li class="view-switcher__item">
|
2023-12-24 23:05:25 +00:00
|
|
|
|
<button type="button">{t('Topics')}</button>
|
2023-11-02 19:21:51 +00:00
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<div class={styles.filterResults}>
|
|
|
|
|
<button type="button" class={styles.filterResultsControl}>
|
|
|
|
|
Период времени
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.filterResultsControl}>
|
|
|
|
|
Рейтинг
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.filterResultsControl}>
|
|
|
|
|
Тип постов
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.filterResultsControl}>
|
|
|
|
|
Темы
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.filterResultsControl}>
|
|
|
|
|
Авторы
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.filterResultsControl}>
|
|
|
|
|
Сообщества
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="container-xl">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class={clsx('col-md-18 offset-md-2', styles.topicsList)}>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
За месяц
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#репортажи
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#интервью
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#культура
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#поэзия
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#теории
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#война в украине
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#общество
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#Экспериментальная Музыка
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
Рейтинг 300+
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#Протесты
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
Музыка
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#За линией Маннергейма
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
Тесты
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
Коллективные истории
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#личный опыт
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
Тоня Самсонова
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#личный опыт
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
#Секс
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class={styles.topTopic}>
|
|
|
|
|
Молоко Plus
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
)
|
|
|
|
|
}
|