mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Improve React Doctor score and badge (#1127)
* fix(react doctor): improve quality score and badge * fix(react doctor): address review feedback * fix(review): address final bot feedback
This commit is contained in:
@@ -9,7 +9,7 @@ const SubscriptionButton = ({ address }: { address: string }) => {
|
||||
const { subscribed, subscribe, unsubscribe } = useSubscribe({ communityAddress: address });
|
||||
const [recentlyUnsubscribed, setRecentlyUnsubscribed] = useState(false);
|
||||
|
||||
const handleClick = () => {
|
||||
const toggleSubscription = () => {
|
||||
if (recentlyUnsubscribed || !subscribed) {
|
||||
subscribe();
|
||||
setRecentlyUnsubscribed(false);
|
||||
@@ -29,10 +29,10 @@ const SubscriptionButton = ({ address }: { address: string }) => {
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
handleClick();
|
||||
toggleSubscription();
|
||||
}
|
||||
}}
|
||||
onClick={handleClick}
|
||||
onClick={toggleSubscription}
|
||||
>
|
||||
{recentlyUnsubscribed || !subscribed ? t('subscribe') : t('unsubscribe')}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user