diff --git a/src/components/Nav/Header/Header.tsx b/src/components/Nav/Header/Header.tsx index adc78513..c372f424 100644 --- a/src/components/Nav/Header/Header.tsx +++ b/src/components/Nav/Header/Header.tsx @@ -41,7 +41,7 @@ export const Header = (props: Props) => { const { t, lang } = useLocalize() const { modal } = useUI() const { requireAuthentication } = useSession() - const [searchParams, ] = useSearchParams() + const [searchParams] = useSearchParams() const { sortedTopics: topics } = useTopics() const [randomTopics, setRandomTopics] = createSignal([]) 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) => { diff --git a/src/components/Nav/Header/HeaderLink.tsx b/src/components/Nav/Header/HeaderLink.tsx index 60a1fd48..483d6af7 100644 --- a/src/components/Nav/Header/HeaderLink.tsx +++ b/src/components/Nav/Header/HeaderLink.tsx @@ -21,7 +21,7 @@ export const Link = (props: Props) => { > {children}} + wrapper={(children) => {children}} > {
    - + {(letter, index) => (
  • @@ -143,7 +143,7 @@ export const AllAuthors = (props: Props) => { {(letter) => (
    -

    {letter}

    +

    {letter}

    diff --git a/src/context/localize.tsx b/src/context/localize.tsx index a95f4196..6e1f2ad2 100644 --- a/src/context/localize.tsx +++ b/src/context/localize.tsx @@ -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, diff --git a/src/utils/i18next.ts b/src/utils/i18next.ts index b1cf0cc5..a4ae4e80 100644 --- a/src/utils/i18next.ts +++ b/src/utils/i18next.ts @@ -12,7 +12,7 @@ TimeAgo.addLocale(ruTime) class AutoKeyMap extends Map { 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)