This commit is contained in:
Untone 2024-07-05 16:35:13 +03:00
parent bff5de0c8e
commit a767ce7fd1
5 changed files with 14 additions and 11 deletions

View File

@ -41,7 +41,7 @@ export const Header = (props: Props) => {
const { t, lang } = useLocalize()
const { modal } = useUI()
const { requireAuthentication } = useSession()
const [searchParams, ] = useSearchParams<HeaderSearchParams>()
const [searchParams] = useSearchParams<HeaderSearchParams>()
const { sortedTopics: topics } = useTopics()
const [randomTopics, setRandomTopics] = createSignal<Topic[]>([])
const [getIsScrollingBottom, setIsScrollingBottom] = createSignal(false)
@ -82,7 +82,7 @@ export const Header = (props: Props) => {
if (!(fixed() || modal())) {
window.scrollTo(0, windowScrollTop)
if(mainContent) mainContent.style.marginTop = ''
if (mainContent) mainContent.style.marginTop = ''
}
})
@ -101,7 +101,10 @@ export const Header = (props: Props) => {
})
})
const scrollToComments = (event: MouseEvent & { currentTarget: HTMLDivElement; target: Element }, value: boolean) => {
const scrollToComments = (
event: MouseEvent & { currentTarget: HTMLDivElement; target: Element },
value: boolean
) => {
event.preventDefault()
props.scrollToComments?.(value)
}
@ -190,7 +193,7 @@ export const Header = (props: Props) => {
</div>
</div>
<div class={clsx('col-md-5 col-xl-4 col-auto', styles.mainLogo)}>
<A href='/'>
<A href="/">
<img src="/logo.svg" alt={t('Discours')} />
</A>
</div>

View File

@ -21,7 +21,7 @@ export const Link = (props: Props) => {
>
<ConditionalWrapper
condition={props.href === `/${loc.pathname}`}
wrapper={(children) => <A href={props.href||'/'}>{children}</A>}
wrapper={(children) => <A href={props.href || '/'}>{children}</A>}
>
<span
class={clsx('cursorPointer linkReplacement', { [styles.mainNavigationItemActive]: props.active })}

View File

@ -120,7 +120,7 @@ export const AllAuthors = (props: Props) => {
<div class="row">
<div class="col-lg-20 col-xl-18">
<ul class={clsx('nodash', styles.alphabet)}>
<For each={[...(alphabet()||[])]}>
<For each={[...(alphabet() || [])]}>
{(letter, index) => (
<li>
<Show when={letter in byLetterFiltered()} fallback={letter}>
@ -143,7 +143,7 @@ export const AllAuthors = (props: Props) => {
<For each={sortedKeys() || []}>
{(letter) => (
<div class={clsx(styles.group, 'group')}>
<h2 id={`letter-${alphabet()?.indexOf(letter)||''}`}>{letter}</h2>
<h2 id={`letter-${alphabet()?.indexOf(letter) || ''}`}>{letter}</h2>
<div class="container">
<div class="row">
<div class="col-lg-20">

View File

@ -87,7 +87,7 @@ export const LocalizeProvider = (props: { children: JSX.Element }) => {
try {
return i18next.t(...args)
} catch (_) {
return args?.length > 0 ? args[0] as string : ''
return args?.length > 0 ? (args[0] as string) : ''
}
}) as i18n['t'],
lang,

View File

@ -12,7 +12,7 @@ TimeAgo.addLocale(ruTime)
class AutoKeyMap extends Map<string, string> {
get(key: string): string {
return super.get(key) ?? key;
return super.get(key) ?? key
}
}
@ -20,7 +20,7 @@ export const i18nextInit = async (lng = 'ru') => {
if (!i18next.isInitialized) {
console.debug('[i18next] initializing...')
const enAutoKeyMap = new AutoKeyMap(Object.entries(en));
const enAutoKeyMap = new AutoKeyMap(Object.entries(en))
await i18next
.use(HttpApi)
@ -39,7 +39,7 @@ export const i18nextInit = async (lng = 'ru') => {
interpolation: {
escapeValue: false
},
parseMissingKeyHandler: (key) => key
parseMissingKeyHandler: (key: string) => key
})
} else if (i18next.language !== lng) {
await i18next.changeLanguage(lng)