From 04540950c4634c032bedfc98d051b9ab007cb3c9 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Thu, 23 Oct 2025 18:32:03 -0400 Subject: [PATCH] add toggle to see results for creator --- .../[rkey]/PublishedPollBlock.tsx | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx b/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx index a9b5bdd1..2c43e9fe 100644 --- a/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx +++ b/app/lish/[did]/[publication]/[rkey]/PublishedPollBlock.tsx @@ -71,6 +71,8 @@ export const PublishedPollBlock = (props: { (v) => v.voter_did === identity?.atp_did, ) || !!optimisticVote); + let isCreator = + identity?.atp_did && props.pollData.uri.includes(identity?.atp_did); const displayResults = showResults || hasVoted; return ( @@ -82,12 +84,24 @@ export const PublishedPollBlock = (props: { }} > {displayResults ? ( - + <> + + {isCreator && !hasVoted && ( +
+ +
+ )} + ) : ( <> {pollRecord.options.map((option, index) => ( @@ -102,7 +116,7 @@ export const PublishedPollBlock = (props: { ))}
- {identity?.atp_did && ( + {isCreator && (