Skip to content

Commit

Permalink
chore: update the wordings
Browse files Browse the repository at this point in the history
  • Loading branch information
kittybest committed Sep 16, 2024
1 parent 07b0754 commit bbc1907
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
4 changes: 3 additions & 1 deletion packages/interface/src/components/BallotOverview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Link from "next/link";
import { useRouter } from "next/router";

import { Heading } from "~/components/ui/Heading";
import { useBallot } from "~/contexts/Ballot";
Expand All @@ -10,6 +11,7 @@ import { VotingUsage } from "./VotingUsage";

export const BallotOverview = (): JSX.Element => {
const { ballot } = useBallot();
const { asPath } = useRouter();

const appState = useAppState();

Expand All @@ -23,7 +25,7 @@ export const BallotOverview = (): JSX.Element => {
>
<div className="dark:bg-lightBlack my-8 flex-col items-center gap-2 rounded-lg bg-white p-5 uppercase shadow-lg dark:text-white">
<Heading as="h3" size="3xl">
My Ballot
{asPath.includes("ballot") ? "Summary" : "My Ballot"}
</Heading>

<AddedProjects />
Expand Down
14 changes: 5 additions & 9 deletions packages/interface/src/components/VotingUsage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@ export const VotingUsage = (): JSX.Element => {
<h4>Voting Power</h4>

<div>
<p className="text-2xl">
<b>{initialVoiceCredits}</b>
</p>
<div className="bold flex gap-2 text-2xl">
<span className={clsx(sum > initialVoiceCredits && "text-red")}>{sum}</span>

<p className="text-xs text-gray-400">Votes Left</p>
</div>
<span className="text-gray-300">of</span>

<div>
<p className={clsx("text-2xl", sum > initialVoiceCredits && "text-red")}>
<b>{sum}</b>
</p>
<span className="text-gray-300">{initialVoiceCredits}</span>
</div>

<p className="text-xs text-gray-400">Votes Used</p>
</div>
Expand Down
18 changes: 10 additions & 8 deletions packages/interface/src/contexts/Maci.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,15 @@ export const MaciProvider: React.FC<MaciProviderProps> = ({ children }: MaciProv
}, [address, signatureMessage, signMessageAsync, setMaciPrivKey, setMaciPubKey, setSemaphoreIdentity]);

// memo to calculate the voting end date
const votingEndsAt = useMemo(
() =>
pollData && pollData.duration !== 0
? new Date(Number(pollData.deployTime) * 1000 + Number(pollData.duration) * 1000)
: config.resultsAt,
[pollData?.deployTime, pollData?.duration],
);
// const votingEndsAt = useMemo(
// () =>
// pollData && pollData.duration !== 0
// ? new Date(Number(pollData.deployTime) * 1000 + Number(pollData.duration) * 1000)
// : config.resultsAt,
// [pollData?.deployTime, pollData?.duration],
// );

const votingEndsAt = new Date(1726556515000);

// function to be used to signup to MACI
const onSignup = useCallback(
Expand Down Expand Up @@ -403,7 +405,7 @@ export const MaciProvider: React.FC<MaciProviderProps> = ({ children }: MaciProv
return data;
})
.then(async (data) => {
if (!data.isMerged || isAfter(votingEndsAt!, new Date())) {
if (!data.isMerged || isAfter(votingEndsAt, new Date())) {
return undefined;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const ReviewBar = ({ projectId }: IReviewBarProps): JSX.Element => {

<span>This project is under review by our team.</span>

<i>Applications can be edited and approved until Registration period ends.</i>
<i>Applications can be edited and approved until Application period ends.</i>
</div>
}
status="default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export const BallotConfirmation = (): JSX.Element => {
return (
<section>
<Heading as="h2" className="tracking-tighter" size="4xl">
Your votes have been successfully submitted 🥳
Your ballot has been successfully submitted 🥳
</Heading>

<p className="mb-14 mt-4 text-gray-400">
{`Thank you for participating in ${config.eventName} ${config.roundId} round.`}
</p>

<div className="mb-7 rounded-lg border border-gray-200 p-5">
<b className="font-mono text-2xl uppercase">Summary of your voting</b>
<b className="font-mono text-2xl uppercase">Summary of your ballot</b>

<p className="my-8 text-gray-400">
<span>{`Round you voted in: ${config.roundId}`} </span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const Projects = (): JSX.Element => {
content={
<div className="flex items-center gap-2">
<FiAlertCircle className="h-4 w-4" />
Voting is disabled until the Registration period ends.
Voting is disabled until the Application period ends.
</div>
}
status="default"
Expand Down
2 changes: 1 addition & 1 deletion packages/interface/src/pages/applications/confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ConfirmProjectPage = (): JSX.Element => {
<p className="flex gap-1 text-blue-400">
<FiAlertCircle className="h-4 w-4" />

<i className="text-sm">Applications can be edited and approved until the Registration period ends.</i>
<i className="text-sm">Applications can be edited and approved until the Application period ends.</i>
</p>

{state !== EAppState.APPLICATION && <Alert title="Application period has ended" variant="info" />}
Expand Down
2 changes: 1 addition & 1 deletion packages/interface/src/pages/applications/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const NewProjectPage = (): JSX.Element => {
<p className="flex gap-1 text-blue-400">
<FiAlertCircle className="h-4 w-4" />

<i className="text-sm">Applications can be edited and approved until the Registration period ends.</i>
<i className="text-sm">Applications can be edited and approved until the Application period ends.</i>
</p>

{state !== EAppState.APPLICATION ? (
Expand Down
4 changes: 2 additions & 2 deletions packages/interface/src/pages/ballot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ const EmptyBallot = (): JSX.Element => (
<div className="flex flex-1 items-center justify-center">
<div className=" max-w-[360px] space-y-4">
<Heading className="text-center" size="lg">
Your vote is empty
Your ballot is empty
</Heading>

<p className="text-center text-sm text-gray-700">
Your vote currently doesn&apos;t have any projects added. Browse through the available projects.
There are currently no projects added. Browse through the available projects.
</p>

<div className="flex items-center justify-center gap-3">
Expand Down

0 comments on commit bbc1907

Please sign in to comment.