From b1db22aa23106bdd379c52257c5e5d061ad5ad83 Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Thu, 12 Oct 2023 23:32:42 +0300 Subject: [PATCH] Change followers modal logic (#257) --- src/components/App.tsx | 2 -- .../Author/AuthorCard/AuthorCard.module.scss | 1 + .../Author/AuthorCard/AuthorCard.tsx | 30 +++---------------- src/components/Nav/ProfilePopup.tsx | 2 +- src/components/Views/Author/Author.tsx | 1 - src/pages/authorFollowers.page.route.ts | 4 --- src/pages/authorFollowing.page.route.ts | 4 --- src/stores/router.ts | 2 -- 8 files changed, 6 insertions(+), 40 deletions(-) delete mode 100644 src/pages/authorFollowers.page.route.ts delete mode 100644 src/pages/authorFollowing.page.route.ts diff --git a/src/components/App.tsx b/src/components/App.tsx index eb5fbf02..59662098 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -48,8 +48,6 @@ const pagesMap: Record> = { author: AuthorPage, authorComments: AuthorPage, authorAbout: AuthorPage, - authorFollowing: AuthorPage, - authorFollowers: AuthorPage, inbox: InboxPage, expo: ExpoPage, expoLayout: ExpoPage, diff --git a/src/components/Author/AuthorCard/AuthorCard.module.scss b/src/components/Author/AuthorCard/AuthorCard.module.scss index df6805a4..84609c03 100644 --- a/src/components/Author/AuthorCard/AuthorCard.module.scss +++ b/src/components/Author/AuthorCard/AuthorCard.module.scss @@ -640,6 +640,7 @@ margin-top: 1rem; margin-right: 3rem; vertical-align: top; + border-bottom: unset !important; &:last-child { margin-right: 0; diff --git a/src/components/Author/AuthorCard/AuthorCard.tsx b/src/components/Author/AuthorCard/AuthorCard.tsx index 7a301656..8516cde4 100644 --- a/src/components/Author/AuthorCard/AuthorCard.tsx +++ b/src/components/Author/AuthorCard/AuthorCard.tsx @@ -14,7 +14,6 @@ import { openPage, redirectPage } from '@nanostores/router' import { useLocalize } from '../../../context/localize' import { ConditionalWrapper } from '../../_shared/ConditionalWrapper' import { Modal } from '../../Nav/Modal' -import { showModal } from '../../../stores/ui' import { SubscriptionFilter } from '../../../pages/types' import { isAuthor } from '../../../utils/isAuthor' import { AuthorBadge } from '../AuthorBadge' @@ -22,8 +21,6 @@ import { TopicBadge } from '../../Topic/TopicBadge' import { Button } from '../../_shared/Button' import { getShareUrl, SharePopup } from '../../Article/SharePopup' import stylesHeader from '../../Nav/Header/Header.module.scss' -import { getDescription } from '../../../utils/meta' -import { Popover } from '../../_shared/Popover' type Props = { caption?: string @@ -52,7 +49,6 @@ type Props = { export const AuthorCard = (props: Props) => { const { t, lang } = useLocalize() - const { page } = useRouter() const { session, isSessionLoaded, @@ -122,12 +118,6 @@ export const AuthorCard = (props: Props) => { } }) - createEffect(() => { - if (page().route === 'authorFollowing') { - showModal('following') - } - }) - const handleCloseFollowModals = () => { redirectPage(router, 'author', { slug: props.author.slug }) } @@ -225,20 +215,14 @@ export const AuthorCard = (props: Props) => {
0 && !props.isCurrentUser}> -
{ - redirectPage(router, 'authorFollowers', { slug: props.author.slug }) - showModal('followers') - }} - > + {(f) => }
{t('SubscriptionWithCount', { count: props.followers.length })}
-
+
0 && props.isCurrentUser}>
- diff --git a/src/pages/authorFollowers.page.route.ts b/src/pages/authorFollowers.page.route.ts deleted file mode 100644 index c18a617a..00000000 --- a/src/pages/authorFollowers.page.route.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ROUTES } from '../stores/router' -import { getServerRoute } from '../utils/getServerRoute' - -export default getServerRoute(ROUTES.authorFollowers) diff --git a/src/pages/authorFollowing.page.route.ts b/src/pages/authorFollowing.page.route.ts deleted file mode 100644 index a8925f2f..00000000 --- a/src/pages/authorFollowing.page.route.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ROUTES } from '../stores/router' -import { getServerRoute } from '../utils/getServerRoute' - -export default getServerRoute(ROUTES.authorFollowing) diff --git a/src/stores/router.ts b/src/stores/router.ts index 316c4f1c..01755a1e 100644 --- a/src/stores/router.ts +++ b/src/stores/router.ts @@ -18,8 +18,6 @@ export const ROUTES = { author: '/author/:slug', authorComments: '/author/:slug/comments', authorAbout: '/author/:slug/about', - authorFollowers: '/author/:slug/followers', - authorFollowing: '/author/:slug/following', feed: '/feed', feedMy: '/feed/my', feedNotifications: '/feed/notifications',