diff --git a/packages/nextjs/app/admin/_components/SubmissionCard.tsx b/packages/nextjs/app/admin/_components/SubmissionCard.tsx index 0e12ba4..102d425 100644 --- a/packages/nextjs/app/admin/_components/SubmissionCard.tsx +++ b/packages/nextjs/app/admin/_components/SubmissionCard.tsx @@ -5,6 +5,7 @@ import { SubmissionComments } from "./SubmissionComments"; import { SubmissionEligible } from "./SubmissionEligible"; import "./submission-rating.css"; import { useMutation } from "@tanstack/react-query"; +import clsx from "clsx"; import { useAccount } from "wagmi"; import { Address } from "~~/components/scaffold-eth"; import { Submission } from "~~/services/database/repositories/submissions"; @@ -14,7 +15,7 @@ import { notification } from "~~/utils/scaffold-eth"; export const SubmissionCard = ({ submission }: { submission: Submission }) => { const { address: connectedAddress } = useAccount(); - const { mutateAsync: postNewVote } = useMutation({ + const { mutateAsync: postNewVote, isPending: isVotePending } = useMutation({ mutationFn: (newVote: { score: number }) => postMutationFetcher(`/api/submissions/${submission.id}/votes`, { body: newVote }), }); @@ -104,12 +105,17 @@ export const SubmissionCard = ({ submission }: { submission: Submission }) => { ))} {score > 0 && ( - +
+ {isVotePending && } + +
)}