Skip to content

Commit

Permalink
feat: add share sns cta
Browse files Browse the repository at this point in the history
  • Loading branch information
kittybest committed Dec 23, 2024
1 parent 1efeb87 commit 8fbdadb
Showing 1 changed file with 63 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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",
},
}),
);

Expand Down Expand Up @@ -100,12 +111,60 @@ export const BallotConfirmation = ({ pollId }: IBallotConfirmationProps): JSX.El

<Notice
content={
round?.votingEndsAt ? format(round.votingEndsAt, "d MMM yyyy hh:mm") : "The date would be announced soon."
round?.votingEndsAt
? `Results will be available after tallying - ${format(round.votingEndsAt, "d MMM yyyy hh:mm")}`
: "The date will be announced soon."
}
title="Results will be available after tallying."
variant="block"
/>

<Card variant="invert">
<div className="text-center">
<b className="text-2xl uppercase">Share that you have voted in {round?.roundId} round.</b>
</div>

<div className="mt-2 flex w-full flex-col items-center justify-center gap-2 sm:flex-row sm:gap-4">
<Button
as={Link}
href={`https://x.com/intent/tweet?text=I+successfully+submit+my+vote+in+${round?.roundId}+round.`}
size="auto"
target="_blank"
variant="tertiary"
>
<FaXTwitter />

<span className="ml-2">Twitter</span>
</Button>

<p>OR</p>

<Button
as={Link}
href={`https://www.threads.net/intent/post?text=I+successfully+submit+my+vote+in+${round?.roundId}+round.`}
size="auto"
target="_blank"
variant="tertiary"
>
<FaThreads />

<span className="ml-2">Threads</span>
</Button>

<p>OR</p>

<Button
as={Link}
href={`https://warpcast.com/~/compose?text=I+successfully+submit+my+vote+in+${round?.roundId}+round.`}
size="auto"
target="_blank"
variant="tertiary"
>
<SiFarcaster />

<span className="ml-2">Farcaster</span>
</Button>
</div>
</Card>

{roundState === ERoundState.VOTING && (
<Card className="flex-col sm:flex-row">
<div className="flex-3 flex flex-col gap-4">
Expand Down

0 comments on commit 8fbdadb

Please sign in to comment.