From e402ff05bebc9970c1596599948ef3af6de622cf Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 25 Dec 2023 02:05:25 +0300 Subject: [PATCH] search-modal-fix --- .../Nav/SearchModal/SearchModal.tsx | 37 +++++-------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/src/components/Nav/SearchModal/SearchModal.tsx b/src/components/Nav/SearchModal/SearchModal.tsx index 9dad8cdb..a61f73b1 100644 --- a/src/components/Nav/SearchModal/SearchModal.tsx +++ b/src/components/Nav/SearchModal/SearchModal.tsx @@ -1,41 +1,24 @@ import { clsx } from 'clsx' -import { createEffect, createSignal } from 'solid-js' - import { useLocalize } from '../../../context/localize' -import { apiClient } from '../../../graphql/client/core' -import { SearchResult } from '../../../graphql/schema/core.gen' import { Icon } from '../../_shared/Icon' import styles from './SearchModal.module.scss' export const SearchModal = () => { const { t } = useLocalize() - const [searchResults, setSearchResults] = createSignal>([]) + let qElement: HTMLInputElement | undefined - let msgElement: HTMLTextAreaElement | undefined - let contactElement: HTMLInputElement | undefined - - const submit = async () => { - const results = await apiClient.getShoutsSearch({ text: msgElement.value }) - - if (results) setSearchResults(results) + const submitQuery = async (ev) => { + ev.preventDefault() + window.history.pushState({}, '', '/search?q=' + qElement.value) } - - createEffect(() => { - if (searchResults()) { - // TODO: some showing logics - } - }) - - // TODO: useLocalize() - return ( -
+ +
  • - +
  • - +