Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

feat: conditionally render TipAction based on subscription status in PostActions component

yoginth.com 0f8d05f4 839533a5

verified
+2 -1
+2 -1
apps/web/src/components/Post/Actions/index.tsx
··· 17 17 const PostActions = ({ post, showCount = false }: PostActionsProps) => { 18 18 const targetPost = isRepost(post) ? post.repostOf : post; 19 19 const hasPostAction = (targetPost.actions?.length || 0) > 0; 20 + const tipEnabled = targetPost.author?.hasSubscribed; 20 21 const canAct = 21 22 hasPostAction && 22 23 targetPost.actions.some( ··· 33 34 <ShareMenu post={post} showCount={showCount} /> 34 35 <Like post={targetPost} showCount={showCount} /> 35 36 {canAct && !showCount ? <CollectAction post={targetPost} /> : null} 36 - <TipAction post={targetPost} showCount={showCount} /> 37 + {tipEnabled && <TipAction post={targetPost} showCount={showCount} />} 37 38 </span> 38 39 {canAct ? <SmallCollectButton post={targetPost} /> : null} 39 40 </span>