2022-09-29 11:50:48 +00:00
|
|
|
import { clsx } from 'clsx'
|
2023-11-14 15:10:00 +00:00
|
|
|
|
2024-07-04 07:51:15 +00:00
|
|
|
import { useLocalize } from '~/context/localize'
|
2023-11-14 15:10:00 +00:00
|
|
|
import { Icon } from '../_shared/Icon'
|
|
|
|
|
2024-06-24 17:50:27 +00:00
|
|
|
import { useNavigate } from '@solidjs/router'
|
2023-11-14 15:10:00 +00:00
|
|
|
import styles from '../../styles/FourOuFour.module.scss'
|
2022-09-09 11:53:35 +00:00
|
|
|
|
2024-06-24 17:50:27 +00:00
|
|
|
type EvType = Event & { submitter: HTMLElement } & { currentTarget: HTMLFormElement; target: Element }
|
|
|
|
|
|
|
|
export const FourOuFourView = () => {
|
|
|
|
let queryInput: HTMLInputElement | null
|
|
|
|
const navigate = useNavigate()
|
|
|
|
const search = (_ev: EvType) => navigate(`/search?q=${queryInput?.value || ''}`)
|
|
|
|
|
2023-02-17 09:21:02 +00:00
|
|
|
const { t } = useLocalize()
|
2022-09-09 11:53:35 +00:00
|
|
|
return (
|
2022-09-23 21:29:32 +00:00
|
|
|
<div class={styles.errorPageWrapper}>
|
|
|
|
<div class={styles.errorPage}>
|
2023-08-27 22:26:39 +00:00
|
|
|
<div class="wide-container">
|
2022-09-09 11:53:35 +00:00
|
|
|
<div class="row">
|
2023-03-10 17:42:48 +00:00
|
|
|
<div class="col-md-14 offset-md-6 col-lg-12">
|
2022-09-15 20:52:07 +00:00
|
|
|
<a href="/" class="image-link">
|
2022-09-23 21:29:32 +00:00
|
|
|
<img class={styles.errorImage} src="/error.svg" alt="error" width="auto" height="auto" />
|
2022-09-15 20:52:07 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
2022-09-09 11:53:35 +00:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
2023-03-10 17:42:48 +00:00
|
|
|
<div class={clsx(styles.errorTextContainer, 'col-md-4 col-sm-6 offset-sm-2 offset-md-4')}>
|
2022-09-23 21:29:32 +00:00
|
|
|
<div class={styles.errorText}>
|
2022-09-15 20:52:07 +00:00
|
|
|
<div>{t('Error')}</div>
|
2022-09-23 21:29:32 +00:00
|
|
|
<div class={styles.big}>404</div>
|
2022-09-09 11:53:35 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-03-10 17:42:48 +00:00
|
|
|
<div class={clsx(styles.searchFormContainer, 'col-sm-10 col-md-8 col-lg-6')}>
|
2022-09-23 21:29:32 +00:00
|
|
|
<div class={styles.errorExplain}>
|
2022-09-15 20:52:07 +00:00
|
|
|
<p>{t(`You've reached a non-existed page`)}</p>
|
|
|
|
<p>{t('Try to find another way')}:</p>
|
2024-06-24 17:50:27 +00:00
|
|
|
<form
|
|
|
|
class={clsx(styles.prettyForm, 'pretty-form')}
|
|
|
|
method="get"
|
|
|
|
onSubmit={(ev) => search(ev)}
|
|
|
|
>
|
2022-09-23 21:29:32 +00:00
|
|
|
<div class={clsx(styles.prettyFormItem, 'pretty-form__item')}>
|
2023-12-25 08:34:49 +00:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
name="q"
|
|
|
|
placeholder={t('Search')}
|
|
|
|
id="search-field"
|
2024-06-24 17:50:27 +00:00
|
|
|
ref={(el) => (queryInput = el)}
|
2023-12-25 08:34:49 +00:00
|
|
|
/>
|
2022-09-15 20:52:07 +00:00
|
|
|
<label for="search-field">{t('Search')}</label>
|
2022-09-23 21:29:32 +00:00
|
|
|
<button type="submit" class={styles.searchSubmit}>
|
2022-09-15 20:52:07 +00:00
|
|
|
<Icon name="search" />
|
|
|
|
</button>
|
2022-09-09 11:53:35 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2022-09-23 21:29:32 +00:00
|
|
|
<p class={styles.textCenter}>
|
2022-11-19 08:09:52 +00:00
|
|
|
<a href="/">{t('Back to main page')}</a>
|
2022-09-09 11:53:35 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|