From 2e30aaa59438c6f94ef5d2021355751034fcb4c5 Mon Sep 17 00:00:00 2001 From: kvakazyambra Date: Wed, 8 Nov 2023 23:42:13 +0300 Subject: [PATCH] Subscribe buttons refactoring --- .../Author/AuthorBadge/AuthorBadge.tsx | 2 + .../Author/AuthorCard/AuthorCard.module.scss | 45 ------------------- .../Author/AuthorCard/AuthorCard.tsx | 11 ++--- src/components/Topic/Card.tsx | 1 + .../_shared/Button/Button.module.scss | 45 +++++++++++++++++++ src/components/_shared/Button/Button.tsx | 4 +- 6 files changed, 55 insertions(+), 53 deletions(-) diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx index 47ba693b..289cfa7e 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.tsx +++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx @@ -130,6 +130,7 @@ export const AuthorBadge = (props: Props) => { size="M" value={subscribeValue()} onClick={() => handleSubscribe(true)} + isSubscribeButton={true} class={clsx(styles.actionButton, { [styles.iconed]: props.iconButtons })} /> } @@ -139,6 +140,7 @@ export const AuthorBadge = (props: Props) => { size="M" value={unsubscribeValue()} onClick={() => handleSubscribe(false)} + isSubscribeButton={true} class={clsx(styles.actionButton, { [styles.iconed]: props.iconButtons })} /> diff --git a/src/components/Author/AuthorCard/AuthorCard.module.scss b/src/components/Author/AuthorCard/AuthorCard.module.scss index 7c121bf7..7853160b 100644 --- a/src/components/Author/AuthorCard/AuthorCard.module.scss +++ b/src/components/Author/AuthorCard/AuthorCard.module.scss @@ -77,51 +77,6 @@ flex-wrap: wrap; } - .buttonSubscribe { - aspect-ratio: auto; - background-color: #000; - border: 1px solid #000; - border-radius: 0.8rem; - color: #fff; - float: none; - padding-bottom: 0.6rem; - padding-top: 0.6rem; - width: 10em; - - .icon { - margin-right: 0.5em; - - img { - filter: invert(1); - } - } - - &:hover { - background: #fff; - color: #000; - - .icon img { - filter: invert(0); - } - - .buttonSubscribeLabel { - display: none; - } - - .buttonSubscribeLabelHovered { - display: block; - } - } - - img { - vertical-align: text-top; - } - } - - .buttonSubscribeLabelHovered { - display: none; - } - .buttonWriteMessage { border-radius: 0.8rem; padding-bottom: 0.6rem; diff --git a/src/components/Author/AuthorCard/AuthorCard.tsx b/src/components/Author/AuthorCard/AuthorCard.tsx index 662aa1a9..5bac630c 100644 --- a/src/components/Author/AuthorCard/AuthorCard.tsx +++ b/src/components/Author/AuthorCard/AuthorCard.tsx @@ -18,6 +18,7 @@ import { TopicBadge } from '../../Topic/TopicBadge' import { Button } from '../../_shared/Button' import { getShareUrl, SharePopup } from '../../Article/SharePopup' import styles from './AuthorCard.module.scss' +import stylesButton from '../../_shared/Button/Button.module.scss' type Props = { author: Author @@ -102,8 +103,8 @@ export const AuthorCard = (props: Props) => { } else if (subscribed()) { return ( <> - {t('Following')} - {t('Unfollow')} + {t('Following')} + {t('Unfollow')} ) } else { @@ -210,11 +211,7 @@ export const AuthorCard = (props: Props) => { when={isProfileOwner()} fallback={
-