From 8879519b478dcd0928e3ead1605623327ea7338b Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 31 Dec 2023 08:01:34 +0300 Subject: [PATCH] minor-fixes --- src/components/Author/AuthorBadge/AuthorBadge.tsx | 6 +++--- src/components/Author/AuthorCard/AuthorCard.tsx | 2 +- src/components/Author/AuthorLink/AuthorLink.tsx | 2 +- src/components/Views/AllAuthors.tsx | 8 ++++---- src/components/Views/Feed/Feed.tsx | 2 +- src/components/Views/Inbox.tsx | 8 +++++--- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx index c7bb9325..ed9ebbf6 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.tsx +++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx @@ -7,16 +7,16 @@ import { useSession } from '../../../context/session' import { Author, FollowingEntity } from '../../../graphql/schema/core.gen' import { router, useRouter } from '../../../stores/router' import { follow, unfollow } from '../../../stores/zine/common' +// import { capitalize } from '../../../utils/capitalize' +import { isCyrillic } from '../../../utils/cyrillic' +import { translit } from '../../../utils/ru2en' import { Button } from '../../_shared/Button' import { CheckButton } from '../../_shared/CheckButton' import { Icon } from '../../_shared/Icon' import { Userpic } from '../Userpic' -import { translit } from '../../../utils/ru2en' import styles from './AuthorBadge.module.scss' import stylesButton from '../../_shared/Button/Button.module.scss' -import { capitalize } from '../../../utils/capitalize' -import { isCyrillic } from '../../../utils/cyrillic' type Props = { author: Author diff --git a/src/components/Author/AuthorCard/AuthorCard.tsx b/src/components/Author/AuthorCard/AuthorCard.tsx index 4a68fd59..2d29a354 100644 --- a/src/components/Author/AuthorCard/AuthorCard.tsx +++ b/src/components/Author/AuthorCard/AuthorCard.tsx @@ -10,6 +10,7 @@ import { FollowingEntity, Topic } from '../../../graphql/schema/core.gen' import { SubscriptionFilter } from '../../../pages/types' import { router, useRouter } from '../../../stores/router' import { follow, unfollow } from '../../../stores/zine/common' +import { isCyrillic } from '../../../utils/cyrillic' import { isAuthor } from '../../../utils/isAuthor' import { translit } from '../../../utils/ru2en' import { Button } from '../../_shared/Button' @@ -22,7 +23,6 @@ import { Userpic } from '../Userpic' import styles from './AuthorCard.module.scss' import stylesButton from '../../_shared/Button/Button.module.scss' -import { isCyrillic } from '../../../utils/cyrillic' type Props = { author: Author diff --git a/src/components/Author/AuthorLink/AuthorLink.tsx b/src/components/Author/AuthorLink/AuthorLink.tsx index bd3a8880..b230afe7 100644 --- a/src/components/Author/AuthorLink/AuthorLink.tsx +++ b/src/components/Author/AuthorLink/AuthorLink.tsx @@ -5,10 +5,10 @@ import { useLocalize } from '../../../context/localize' import { Author } from '../../../graphql/schema/core.gen' import { capitalize } from '../../../utils/capitalize' import { isCyrillic } from '../../../utils/cyrillic' +import { translit } from '../../../utils/ru2en' import { Userpic } from '../Userpic' import styles from './AhtorLink.module.scss' -import { translit } from '../../../utils/ru2en' type Props = { author: Author diff --git a/src/components/Views/AllAuthors.tsx b/src/components/Views/AllAuthors.tsx index b749372c..3b1ec9d4 100644 --- a/src/components/Views/AllAuthors.tsx +++ b/src/components/Views/AllAuthors.tsx @@ -7,17 +7,17 @@ import { createEffect, createMemo, createSignal, For, Show } from 'solid-js' import { useLocalize } from '../../context/localize' import { useRouter } from '../../stores/router' import { loadAuthors, setAuthorsSort, useAuthorsStore } from '../../stores/zine/authors' +import { capitalize } from '../../utils/capitalize' +import { isCyrillic } from '../../utils/cyrillic' import { dummyFilter } from '../../utils/dummyFilter' import { getImageUrl } from '../../utils/getImageUrl' +import { translit } from '../../utils/ru2en' import { scrollHandler } from '../../utils/scroll' import { Loading } from '../_shared/Loading' import { SearchField } from '../_shared/SearchField' import { AuthorBadge } from '../Author/AuthorBadge' import styles from './AllAuthors.module.scss' -import { isCyrillic } from '../../utils/cyrillic' -import { capitalize } from '../../utils/capitalize' -import { translit } from '../../utils/ru2en' type AllAuthorsPageSearchParams = { by: '' | 'name' | 'shouts' | 'followers' @@ -87,7 +87,7 @@ export const AllAuthorsView = (props: Props) => { let letter = '' if (!letter && author && author.name) { const name = translate(author) - .replace(/[^A-zА-я0-9]/, ' ') + .replace(/[^\dA-zА-я]/, ' ') .trim() const nameParts = name.trim().split(' ') const found = nameParts.filter(Boolean).pop() diff --git a/src/components/Views/Feed/Feed.tsx b/src/components/Views/Feed/Feed.tsx index ebfa89a3..1edb897d 100644 --- a/src/components/Views/Feed/Feed.tsx +++ b/src/components/Views/Feed/Feed.tsx @@ -18,8 +18,8 @@ import { DropDown } from '../../_shared/DropDown' import { Icon } from '../../_shared/Icon' import { Loading } from '../../_shared/Loading' import { CommentDate } from '../../Article/CommentDate' -import { AuthorLink } from '../../Author/AuthorLink' import { AuthorBadge } from '../../Author/AuthorBadge' +import { AuthorLink } from '../../Author/AuthorLink' import { ArticleCard } from '../../Feed/ArticleCard' import { Sidebar } from '../../Feed/Sidebar' diff --git a/src/components/Views/Inbox.tsx b/src/components/Views/Inbox.tsx index 28e4958b..65c82656 100644 --- a/src/components/Views/Inbox.tsx +++ b/src/components/Views/Inbox.tsx @@ -9,7 +9,7 @@ import { useLocalize } from '../../context/localize' import { useSession } from '../../context/session' import { useRouter } from '../../stores/router' import { showModal } from '../../stores/ui' -import { AuthorsSortBy, useAuthorsStore } from '../../stores/zine/authors' +// import { AuthorsSortBy, useAuthorsStore } from '../../stores/zine/authors' import { Icon } from '../_shared/Icon' import { Popover } from '../_shared/Popover' import SimplifiedEditor from '../Editor/SimplifiedEditor' @@ -47,9 +47,9 @@ export const InboxView = (props: Props) => { const { chats, messages, - actions: { loadChats, loadRecipients, getMessages, sendMessage, createChat }, + actions: { loadChats, getMessages, sendMessage, createChat }, } = useInbox() - const [recipients, setRecipients] = createSignal([]) + const [recipients, setRecipients] = createSignal(props.authors) const [sortByGroup, setSortByGroup] = createSignal(false) const [sortByPerToPer, setSortByPerToPer] = createSignal(false) const [currentDialog, setCurrentDialog] = createSignal() @@ -189,6 +189,8 @@ export const InboxView = (props: Props) => { setIsScrollToNewVisible(false) } + const isLoaded = createMemo(() => props.isLoaded) + return (