From 0698900f8d571a965ead78007066268bf69658e3 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 29 Aug 2024 17:40:31 +0300 Subject: [PATCH] fmt --- src/components/Topic/Full.tsx | 24 ++++--- .../Views/AllAuthors/AllAuthors.tsx | 15 +++- src/components/Views/Author/Author.tsx | 6 +- .../Views/Profile/ProfileSettings.tsx | 6 +- src/components/Views/Topic.tsx | 70 ++++++++++++------- src/components/_shared/LoadMoreWrapper.tsx | 13 ++-- src/routes/author/[slug]/[...tab].tsx | 8 ++- 7 files changed, 90 insertions(+), 52 deletions(-) diff --git a/src/components/Topic/Full.tsx b/src/components/Topic/Full.tsx index 5449a211..16366abc 100644 --- a/src/components/Topic/Full.tsx +++ b/src/components/Topic/Full.tsx @@ -27,15 +27,21 @@ export const FullTopic = (props: Props) => { const [followed, setFollowed] = createSignal() const [title, setTitle] = createSignal('') - createEffect(on(() => props.topic, (tpc) => { - if (!tpc) return - /* FIXME: use title translation*/ - setTitle((_) => tpc?.title || '') - return `#${capitalize( - lang() === 'en' ? tpc.slug.replace(/-/, ' ') : tpc.title || tpc.slug.replace(/-/, ' '), - true - )}` - }, {} )) + createEffect( + on( + () => props.topic, + (tpc) => { + if (!tpc) return + /* FIXME: use title translation*/ + setTitle((_) => tpc?.title || '') + return `#${capitalize( + lang() === 'en' ? tpc.slug.replace(/-/, ' ') : tpc.title || tpc.slug.replace(/-/, ' '), + true + )}` + }, + {} + ) + ) createEffect(() => { if (follows?.topics?.length !== 0) { diff --git a/src/components/Views/AllAuthors/AllAuthors.tsx b/src/components/Views/AllAuthors/AllAuthors.tsx index da0f80ff..a611cd81 100644 --- a/src/components/Views/AllAuthors/AllAuthors.tsx +++ b/src/components/Views/AllAuthors/AllAuthors.tsx @@ -34,9 +34,11 @@ export const ABC = { export const AllAuthors = (props: Props) => { const { t, lang } = useLocalize() const alphabet = createMemo(() => ABC[lang()] || ABC['ru']) - const [searchParams, ] = useSearchParams<{ by?: string }>() + const [searchParams] = useSearchParams<{ by?: string }>() const { authorsSorted, setAuthorsSort, loadAuthors } = useAuthors() - const authors = createMemo(() => (searchParams.by || searchParams.by === 'name') ? props.authors : authorsSorted()) + const authors = createMemo(() => + searchParams.by || searchParams.by === 'name' ? props.authors : authorsSorted() + ) const [loading, setLoading] = createSignal(false) // filter @@ -207,7 +209,14 @@ export const AllAuthors = (props: Props) => {
- 0}> + 0 + } + >