From 1a9f6fcf73e3858620ae0a3c6d96044174c1c789 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 8 Mar 2024 11:01:15 -0600 Subject: [PATCH] Like button improvements --- .../Profile/Header/ProfileHeaderLabeler.tsx | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx index 01b64647bc..b6e1de28fd 100644 --- a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx +++ b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx @@ -24,6 +24,7 @@ import {pluralize} from '#/lib/strings/helpers' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonText} from '#/components/Button' +import {Text} from '#/components/Typography' import * as Toast from '#/view/com/util/Toast' import {ProfileHeaderShell} from './Shell' import {ProfileHeaderDropdownBtn} from './DropdownBtn' @@ -86,6 +87,8 @@ let ProfileHeaderLabeler = ({ labeler.viewer?.like || '', ) const isLiked = !!likeUri + const likeCount = + isLiked && likeUri ? (labeler.likeCount || 0) + 1 : labeler.likeCount || 0 const onToggleLiked = React.useCallback(async () => { if (!labeler) { @@ -216,7 +219,7 @@ let ProfileHeaderLabeler = ({ /> ) : undefined} - + )}