From edf4400627abf3bd6a092a068b56872204c9f7f0 Mon Sep 17 00:00:00 2001 From: ilya-bkv Date: Fri, 15 Mar 2024 17:55:37 +0300 Subject: [PATCH] Change follow logic --- .../AuthorBadge/AuthorBadge.module.scss | 26 +++++++++ .../Author/AuthorBadge/AuthorBadge.tsx | 51 +---------------- .../Author/AuthorCard/AuthorCard.tsx | 8 ++- .../Topic/TopicBadge/TopicBadge.tsx | 9 ++- src/components/Views/Author/Author.tsx | 57 +++++++++---------- .../ProfileSubscriptions.tsx | 2 - .../BadgeSubscribeButton.tsx | 53 ++++++++++------- src/context/following.tsx | 4 -- src/graphql/client/core.ts | 1 - 9 files changed, 100 insertions(+), 111 deletions(-) diff --git a/src/components/Author/AuthorBadge/AuthorBadge.module.scss b/src/components/Author/AuthorBadge/AuthorBadge.module.scss index 3c3b1366..ebd5d145 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.module.scss +++ b/src/components/Author/AuthorBadge/AuthorBadge.module.scss @@ -89,4 +89,30 @@ text-align: right; } } + + .actionButton { + border-radius: 0.8rem !important; + margin-right: 0 !important; + width: 9em; + + &.iconed { + padding: 6px !important; + min-width: 4rem; + width: unset; + + &:hover img { + filter: invert(1); + } + } + + &:hover { + .actionButtonLabel { + display: none; + } + + .actionButtonLabelHovered { + display: block; + } + } + } } diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx index 3342b5b8..6f0020ae 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.tsx +++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx @@ -15,7 +15,6 @@ import { CheckButton } from '../../_shared/CheckButton' import { ConditionalWrapper } from '../../_shared/ConditionalWrapper' import { Icon } from '../../_shared/Icon' import { Userpic } from '../Userpic' -import stylesButton from '../../_shared/Button/Button.module.scss' import styles from './AuthorBadge.module.scss' import { BadgeSubscribeButton } from "../../_shared/BadgeSubscribeButton"; @@ -131,56 +130,8 @@ export const AuthorBadge = (props: Props) => { handleFollowClick()} isSubscribed={isSubscribed()} + actionMessageType={subscribeInAction()?.slug === props.author.slug ? subscribeInAction().type : undefined} /> - {/*}*/} - {/*>*/} - {/* */} - {/* */} - {/* */} - {/* }*/} - {/* onClick={handleFollowClick}*/} - {/* isSubscribeButton={true}*/} - {/* class={clsx(styles.actionButton, {*/} - {/* [styles.iconed]: props.iconButtons,*/} - {/* [stylesButton.subscribed]: isSubscribed(),*/} - {/* })}*/} - {/* />*/} - {/* }*/} - {/* >*/} - {/* */} - {/* {t('Following')}*/} - {/* {t('Unfollow')}*/} - {/* */} - {/* }*/} - {/* >*/} - {/* */} - {/* */} - {/* }*/} - {/* onClick={handleFollowClick}*/} - {/* isSubscribeButton={true}*/} - {/* class={clsx(styles.actionButton, {*/} - {/* [styles.iconed]: props.iconButtons,*/} - {/* [stylesButton.subscribed]: isSubscribed(),*/} - {/* })}*/} - {/* />*/} - {/* */} - {/**/}