From d78778566029d3d3f4efedd79c2bace43d6dbe8d Mon Sep 17 00:00:00 2001 From: LeonspaceX Date: Wed, 28 Jan 2026 18:33:59 +0800 Subject: [PATCH] Highlight voted button in PostCard --- front/src/components/PostCard.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/front/src/components/PostCard.tsx b/front/src/components/PostCard.tsx index 16909e9..cf31cb4 100644 --- a/front/src/components/PostCard.tsx +++ b/front/src/components/PostCard.tsx @@ -163,6 +163,12 @@ const useStyles = makeStyles({ boxShadow: 'none', }, }, + actionButtonActive: { + color: tokens.colorBrandForegroundLink, + '& svg': { + color: tokens.colorBrandForegroundLink, + }, + }, modalOverlay: { position: 'fixed', top: 0, @@ -203,6 +209,7 @@ const PostCard = ({ const { dispatchToast } = useToastController(toasterId); const [votes, setVotes] = React.useState({ upvotes, downvotes }); const [hasVoted, setHasVoted] = React.useState(false); + const [voteChoice, setVoteChoice] = React.useState<'up' | 'down' | null>(null); const [showComments, setShowComments] = React.useState(false); const [showReportModal, setShowReportModal] = React.useState(false); @@ -239,9 +246,10 @@ const PostCard = ({