diff --git a/packages/interface/.env.example b/packages/interface/.env.example index b6405b2b..89be68ce 100644 --- a/packages/interface/.env.example +++ b/packages/interface/.env.example @@ -38,7 +38,6 @@ NEXT_PUBLIC_TOKEN_NAME="Votes" # Determine when users can register applications, admins review them, voters vote, and results are published NEXT_PUBLIC_START_DATE=2024-01-01T00:00:00.000Z NEXT_PUBLIC_REGISTRATION_END_DATE=2024-01-01T00:00:00.000Z -NEXT_PUBLIC_REVIEW_END_DATE=2024-01-01T00:00:00.000Z NEXT_PUBLIC_RESULTS_DATE=2024-01-01T00:00:00.000Z # Collect user feedback. Is shown as a link when user has voted diff --git a/packages/interface/src/components/BallotOverview.tsx b/packages/interface/src/components/BallotOverview.tsx index 02b75c9f..d4659a1f 100644 --- a/packages/interface/src/components/BallotOverview.tsx +++ b/packages/interface/src/components/BallotOverview.tsx @@ -1,5 +1,6 @@ import Link from "next/link"; +import { Heading } from "~/components/ui/Heading"; import { useBallot } from "~/contexts/Ballot"; import { useAppState } from "~/utils/state"; import { EAppState } from "~/utils/types"; @@ -21,7 +22,9 @@ export const BallotOverview = (): JSX.Element => { } >
{description}
diff --git a/packages/interface/src/components/ui/Heading.tsx b/packages/interface/src/components/ui/Heading.tsx index 97f77d93..3854cf49 100644 --- a/packages/interface/src/components/ui/Heading.tsx +++ b/packages/interface/src/components/ui/Heading.tsx @@ -5,14 +5,16 @@ import { createComponent } from "."; export const Heading = createComponent( "div", tv({ - base: "font-bold", + base: "font-bold dark:text-white font-mono uppercase", variants: { size: { md: "text-base", lg: "text-lg mt-2 mb-1 ", xl: "text-xl ", "2xl": "text-2xl mt-8 mb-4 ", - "3xl": "text-3xl mt-8 mb-4 ", + "3xl": "text-[32px]", + "4xl": "text-[40px]", + "6xl": "text-6xl mb-8", }, }, defaultVariants: { diff --git a/packages/interface/src/config.ts b/packages/interface/src/config.ts index 1dfabe7e..53c07111 100644 --- a/packages/interface/src/config.ts +++ b/packages/interface/src/config.ts @@ -42,6 +42,28 @@ const easSchemaRegistryContractAddresses = { base: "0x4200000000000000000000000000000000000020", }; +// Chain Id +const chainId = { + ethereum: 1, + optimism: 10, + optimismSepolia: 11155420, + arbitrum: 42161, + linea: 7567838, + sepolia: 11155111, + base: 8453, +}; + +// Chain name +const chainName = { + ethereum: "Ethereum", + optimism: "OP", + optimismSepolia: "OP Sepolia", + arbitrum: "Arbitrum", + linea: "Linea", + sepolia: "Sepolia", + base: "Base", +}; + /** * Convert the chain name for the semaphore ethers library * @returns the chain name for the semaphore ethers library @@ -76,7 +98,6 @@ export const config = { voteLimit: 50, startsAt: parseDate(process.env.NEXT_PUBLIC_START_DATE), registrationEndsAt: parseDate(process.env.NEXT_PUBLIC_REGISTRATION_END_DATE), - reviewEndsAt: parseDate(process.env.NEXT_PUBLIC_REVIEW_END_DATE), resultsAt: parseDate(process.env.NEXT_PUBLIC_RESULTS_DATE), skipApprovedVoterCheck: ["true", "1"].includes(process.env.NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK!), tokenName: process.env.NEXT_PUBLIC_TOKEN_NAME!, @@ -91,7 +112,8 @@ export const config = { roundOrganizer: process.env.NEXT_PUBLIC_ROUND_ORGANIZER ?? "PSE", pollMode: process.env.NEXT_PUBLIC_POLL_MODE ?? "non-qv", roundLogo: process.env.NEXT_PUBLIC_ROUND_LOGO, - chainName: process.env.NEXT_PUBLIC_CHAIN_NAME!, + chainName: chainName[process.env.NEXT_PUBLIC_CHAIN_NAME as keyof typeof chainName], + chainId: chainId[process.env.NEXT_PUBLIC_CHAIN_NAME as keyof typeof chainId], }; export const theme = { diff --git a/packages/interface/src/contexts/Maci.tsx b/packages/interface/src/contexts/Maci.tsx index ce45707d..89d47f1b 100644 --- a/packages/interface/src/contexts/Maci.tsx +++ b/packages/interface/src/contexts/Maci.tsx @@ -1,6 +1,7 @@ /* eslint-disable no-console */ import { Identity } from "@semaphore-protocol/core"; import { isAfter } from "date-fns"; +import { type Signer, BrowserProvider } from "ethers"; import { signup, isRegisteredUser, @@ -21,7 +22,7 @@ import { api } from "~/utils/api"; import { getSemaphoreProof } from "~/utils/semaphore"; import type { IVoteArgs, MaciContextType, MaciProviderProps } from "./types"; -import type { Signer } from "ethers"; +import type { EIP1193Provider } from "viem"; import type { Attestation } from "~/utils/types"; export const MaciContext = createContextSelect the applications you want to approve. You must be a configured admin to approve applications. diff --git a/packages/interface/src/features/applications/components/ReviewApplicationDetails.tsx b/packages/interface/src/features/applications/components/ReviewApplicationDetails.tsx index 36acb7f2..8ff1e65a 100644 --- a/packages/interface/src/features/applications/components/ReviewApplicationDetails.tsx +++ b/packages/interface/src/features/applications/components/ReviewApplicationDetails.tsx @@ -2,6 +2,7 @@ import clsx from "clsx"; import { useMemo, type ReactNode } from "react"; import { useFormContext } from "react-hook-form"; +import { Heading } from "~/components/ui/Heading"; import { Tag } from "~/components/ui/Tag"; import type { Application } from "../types"; @@ -42,7 +43,7 @@ export const ReviewApplicationDetails = (): JSX.Element => { return (
Please review and submit your project application.
{`Thank you for participating in ${config.eventName} ${config.roundId} round.`} diff --git a/packages/interface/src/features/projects/components/ProjectDetails.tsx b/packages/interface/src/features/projects/components/ProjectDetails.tsx index 6a2c7f16..e696066e 100644 --- a/packages/interface/src/features/projects/components/ProjectDetails.tsx +++ b/packages/interface/src/features/projects/components/ProjectDetails.tsx @@ -1,6 +1,7 @@ import clsx from "clsx"; import { type ReactNode } from "react"; +import { Heading } from "~/components/ui/Heading"; import { Navigation } from "~/components/ui/Navigation"; import { ProjectAvatar } from "~/features/projects/components/ProjectAvatar"; import { ProjectBanner } from "~/features/projects/components/ProjectBanner"; @@ -50,7 +51,9 @@ const ProjectDetails = ({
Thank you for submitting your project application. Our team is now reviewing it.
diff --git a/packages/interface/src/pages/applications/new.tsx b/packages/interface/src/pages/applications/new.tsx
index 344c4b62..60bf09a2 100644
--- a/packages/interface/src/pages/applications/new.tsx
+++ b/packages/interface/src/pages/applications/new.tsx
@@ -1,6 +1,7 @@
import { FiAlertCircle } from "react-icons/fi";
import { Alert } from "~/components/ui/Alert";
+import { Heading } from "~/components/ui/Heading";
import { ApplicationForm } from "~/features/applications/components/ApplicationForm";
import { Layout } from "~/layouts/DefaultLayout";
import { useAppState } from "~/utils/state";
@@ -13,7 +14,9 @@ const NewProjectPage = (): JSX.Element => {
diff --git a/packages/interface/src/pages/ballot/index.tsx b/packages/interface/src/pages/ballot/index.tsx
index 070d14d2..1ed60f17 100644
--- a/packages/interface/src/pages/ballot/index.tsx
+++ b/packages/interface/src/pages/ballot/index.tsx
@@ -8,6 +8,7 @@ import { useAccount } from "wagmi";
import { Button } from "~/components/ui/Button";
import { Dialog } from "~/components/ui/Dialog";
import { Form } from "~/components/ui/Form";
+import { Heading } from "~/components/ui/Heading";
import { useBallot } from "~/contexts/Ballot";
import { useMaci } from "~/contexts/Maci";
import { AllocationFormWrapper } from "~/features/ballot/components/AllocationList";
@@ -63,7 +64,9 @@ const ClearBallot = (): JSX.Element | null => {
const EmptyBallot = (): JSX.Element => (
Your vote currently doesn't have any projects added. Browse through the available projects.
@@ -87,7 +90,9 @@ const BallotAllocationForm = (): JSX.Element => {
return (
Once you have reviewed your vote allocation, you can submit your ballot.
{config.startsAt && format(config.startsAt, "d MMMM, yyyy")}
diff --git a/packages/interface/src/pages/stats/index.tsx b/packages/interface/src/pages/stats/index.tsx
index b7b0ab89..f28e9274 100644
--- a/packages/interface/src/pages/stats/index.tsx
+++ b/packages/interface/src/pages/stats/index.tsx
@@ -18,7 +18,9 @@ const ResultsChart = dynamic(async () => import("~/features/results/components/C
const Stat = ({ title, children = null }: PropsWithChildren<{ title: string }>) => (
New Application
+ Your vote is empty
+ My Ballot
+ {step.label}
+ {config.eventName.toUpperCase()}
+ {config.roundId.toUpperCase()}
+ {title}
+ Connect your wallet to see results
+ Top Projects
+