From 55ce94a65fe783c735d0f4ea9e6ab92dc6f2c066 Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Fri, 15 Mar 2024 00:53:03 +0700 Subject: [PATCH] Update tooltip for super like button to be separated between the reward and like --- src/components/voting/SuperLike.module.sass | 10 +++ src/components/voting/SuperLike.tsx | 75 +++++++++++---------- 2 files changed, 51 insertions(+), 34 deletions(-) diff --git a/src/components/voting/SuperLike.module.sass b/src/components/voting/SuperLike.module.sass index 3f6c67b89..0a5bbfb78 100644 --- a/src/components/voting/SuperLike.module.sass +++ b/src/components/voting/SuperLike.module.sass @@ -23,4 +23,14 @@ &.SuperLikeActive background: linear-gradient(97deg, #8B55FD 8.3%, #7493FC 91.24%) color: white + + &.SuperLikeDisabled + color: #94a3b8 + color: rgba(0, 0, 0, 0.25) + background: #f5f5f5 + border-color: #d9d9d9 + text-shadow: none + -webkit-box-shadow: none + box-shadow: none + cursor: not-allowed diff --git a/src/components/voting/SuperLike.tsx b/src/components/voting/SuperLike.tsx index 6bd494512..66845aa30 100644 --- a/src/components/voting/SuperLike.tsx +++ b/src/components/voting/SuperLike.tsx @@ -175,44 +175,51 @@ export default function SuperLike({ post, iconClassName, isComment, ...props }: else if (!canBeSuperliked) tooltipTitle = `You cannot like ${entity}s that are older than 7 days` else if (!superLikeMessage.message) tooltipTitle = 'Loading...' - const button = ( -
- -
- ) + + {({ reward, tooltip }) => ( + +
+ + {reward} + + + )} + + +
- return ( - <> - {tooltipTitle ? {button} : button} setIsOpenShouldStakeModal(false)}