From 935efc045b69e06dae33b1aa7b40781f41292e93 Mon Sep 17 00:00:00 2001 From: yu-zhen Date: Thu, 19 Dec 2024 01:55:34 +0800 Subject: [PATCH] feat: add share sns cta --- .../ballot/components/BallotConfirmation.tsx | 69 +++++++++++++++++-- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/packages/interface/src/features/ballot/components/BallotConfirmation.tsx b/packages/interface/src/features/ballot/components/BallotConfirmation.tsx index a6ab042d..c7d9fa63 100644 --- a/packages/interface/src/features/ballot/components/BallotConfirmation.tsx +++ b/packages/interface/src/features/ballot/components/BallotConfirmation.tsx @@ -1,6 +1,8 @@ import { format } from "date-fns"; import Link from "next/link"; import { useMemo } from "react"; +import { FaXTwitter, FaThreads } from "react-icons/fa6"; +import { SiFarcaster } from "react-icons/si"; import { tv } from "tailwind-variants"; import { Hex } from "viem"; import { useAccount } from "wagmi"; @@ -26,7 +28,16 @@ const feedbackUrl = process.env.NEXT_PUBLIC_FEEDBACK_URL!; const Card = createComponent( "div", tv({ - base: "rounded-lg border border-blue-400 p-8 bg-blue-50 flex justify-between items-center gap-8 my-14", + base: "rounded-lg border p-8 justify-between items-center gap-8 my-14", + variants: { + variant: { + default: "border-blue-400 bg-blue-50 flex", + invert: "text-blue-700 bg-blue-400 border-blue-700", + }, + }, + defaultVariants: { + variant: "default", + }, }), ); @@ -56,6 +67,8 @@ export const BallotConfirmation = ({ pollId }: IBallotConfirmationProps): JSX.El const sum = useMemo(() => formatNumber(sumBallot(ballot.votes)), [ballot, sumBallot]); + const shareText = useMemo(() => `I+successfully+submit+my+vote+in+${round?.roundId}+round.`, [round]); + return (
@@ -100,12 +113,60 @@ export const BallotConfirmation = ({ pollId }: IBallotConfirmationProps): JSX.El + +
+ Share that you have voted in {round?.roundId} round. +
+ +
+ + +

OR

+ + + +

OR

+ + +
+
+ {roundState === ERoundState.VOTING && (