diff --git a/packages/interface/public/logo-muqa.png b/packages/interface/public/logo-muqa.png new file mode 100644 index 00000000..c9aa3d03 Binary files /dev/null and b/packages/interface/public/logo-muqa.png differ diff --git a/packages/interface/public/logo.png b/packages/interface/public/logo.png new file mode 100644 index 00000000..c71e7762 Binary files /dev/null and b/packages/interface/public/logo.png differ diff --git a/packages/interface/public/round-logo.svg b/packages/interface/public/round-logo.svg deleted file mode 100644 index d8bb29c7..00000000 --- a/packages/interface/public/round-logo.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/packages/interface/src/components/ImageUpload.tsx b/packages/interface/src/components/ImageUpload.tsx index a914a0fb..14147e20 100644 --- a/packages/interface/src/components/ImageUpload.tsx +++ b/packages/interface/src/components/ImageUpload.tsx @@ -14,7 +14,7 @@ export interface IImageUploadProps extends ComponentProps<"img"> { export const ImageUpload = ({ name = "", - maxSize = 1024 * 1024, // 1 MB + maxSize = 2048 * 2048, // 2 MB className, }: IImageUploadProps): JSX.Element => { const ref = useRef(null); diff --git a/packages/interface/src/components/JoinButton.tsx b/packages/interface/src/components/JoinButton.tsx index cddb616c..4589ac3c 100644 --- a/packages/interface/src/components/JoinButton.tsx +++ b/packages/interface/src/components/JoinButton.tsx @@ -13,7 +13,6 @@ export const JoinButton = (): JSX.Element => { const onError = useCallback(() => toast.error("Signup error"), []); const handleSignup = useCallback(() => onSignup(onError), [onSignup, onError]); - return ( {appState === EAppState.VOTING && !isEligibleToVote && ( diff --git a/packages/interface/src/components/RoundInfo.tsx b/packages/interface/src/components/RoundInfo.tsx index 75c9f06f..abb29699 100644 --- a/packages/interface/src/components/RoundInfo.tsx +++ b/packages/interface/src/components/RoundInfo.tsx @@ -1,17 +1,12 @@ -import Image from "next/image"; - import { Heading } from "~/components/ui/Heading"; -import { config } from "~/config"; export const RoundInfo = (): JSX.Element => ( - Round + MUQA - {config.roundLogo && } - - {config.roundId} + Beach Contest diff --git a/packages/interface/src/components/ui/Avatar.tsx b/packages/interface/src/components/ui/Avatar.tsx index ddad7f49..c443278b 100644 --- a/packages/interface/src/components/ui/Avatar.tsx +++ b/packages/interface/src/components/ui/Avatar.tsx @@ -14,6 +14,7 @@ export const Avatar = createComponent( sm: "w-12 h-12 rounded-md", md: "w-16 h-16 rounded-md", lg: "w-40 h-40 rounded-3xl", + xl: "w-80 h-80 rounded-4xl", }, rounded: { full: "rounded-full", diff --git a/packages/interface/src/config.ts b/packages/interface/src/config.ts index ffe5dc80..8b54702a 100644 --- a/packages/interface/src/config.ts +++ b/packages/interface/src/config.ts @@ -69,7 +69,7 @@ export const getRPCURL = (): string | undefined => { }; export const config = { - logoUrl: "/Logo.svg", + logoUrl: "/logo.svg", pageSize: 3 * 4, // TODO: temp solution until we come up with solid one // https://github.com/privacy-scaling-explorations/maci-platform/issues/31 diff --git a/packages/interface/src/contexts/Maci.tsx b/packages/interface/src/contexts/Maci.tsx index d84003d6..9e4ccf65 100644 --- a/packages/interface/src/contexts/Maci.tsx +++ b/packages/interface/src/contexts/Maci.tsx @@ -104,7 +104,6 @@ export const MaciProvider: React.FC = ({ children }: MaciProv // for Semaphore it will be a proof being part of the group useEffect(() => { setIsLoading(true); - // add custom logic for other gatekeepers here switch (gatekeeperTrait) { case GatekeeperTrait.Semaphore: @@ -145,6 +144,9 @@ export const MaciProvider: React.FC = ({ children }: MaciProv }); setIsLoading(false); break; + case GatekeeperTrait.FreeForAll: + setIsLoading(false); + break; default: break; } @@ -157,7 +159,7 @@ export const MaciProvider: React.FC = ({ children }: MaciProv // for instance with semaphore const isEligibleToVote = useMemo( () => gatekeeperTrait && (gatekeeperTrait === GatekeeperTrait.FreeForAll || Boolean(sgData)) && Boolean(address), - [sgData, address], + [sgData, address, gatekeeperTrait], ); // on load get the key pair from local storage and set the signature message @@ -192,7 +194,6 @@ export const MaciProvider: React.FC = ({ children }: MaciProv if (!address) { return; } - const signature = await signMessageAsync({ message: signatureMessage }); const newSemaphoreIdentity = new Identity(signature); const userKeyPair = genKeyPair({ seed: BigInt(signature) }); diff --git a/packages/interface/src/features/applications/components/ApplicationButtons.tsx b/packages/interface/src/features/applications/components/ApplicationButtons.tsx index 5701ec5b..a94c5f3e 100644 --- a/packages/interface/src/features/applications/components/ApplicationButtons.tsx +++ b/packages/interface/src/features/applications/components/ApplicationButtons.tsx @@ -8,7 +8,6 @@ import { Spinner } from "~/components/ui/Spinner"; import { useIsCorrectNetwork } from "~/hooks/useIsCorrectNetwork"; import type { Application } from "../types"; -import type { ImpactMetrix, ContributionLink, FundingSource } from "~/features/projects/types"; export enum EApplicationStep { PROFILE, @@ -39,62 +38,19 @@ export const ApplicationButtons = ({ const form = useFormContext(); - const [ - name, - bio, - payoutAddress, - websiteUrl, - profileImageUrl, - bannerImageUrl, - contributionDescription, - impactDescription, - impactCategory, - contributionLinks, - fundingSources, - ] = useMemo( - () => - form.watch([ - "name", - "bio", - "payoutAddress", - "websiteUrl", - "profileImageUrl", - "bannerImageUrl", - "contributionDescription", - "impactDescription", - "impactCategory", - "contributionLinks", - "fundingSources", - ]), + const [name, bio, profileImageUrl, bannerImageUrl, activitiesDescription] = useMemo( + () => form.watch(["name", "bio", "websiteUrl", "profileImageUrl", "bannerImageUrl", "activitiesDescription"]), [form], ); - const checkLinks = ( - links: Pick[] | undefined, - ): boolean => - links === undefined || links.every((link) => link.description !== undefined && link.description.length > 0); - const checkStepComplete = (): boolean => { if (step === EApplicationStep.PROFILE) { - return ( - bannerImageUrl !== undefined && - profileImageUrl !== undefined && - bio.length > 0 && - name.length > 0 && - payoutAddress.length > 0 && - websiteUrl.length > 0 - ); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + return bannerImageUrl !== undefined && profileImageUrl !== undefined && bio.length > 0 && name.length > 0; } if (step === EApplicationStep.ADVANCED) { - return ( - impactCategory !== undefined && - impactCategory.length > 0 && - contributionDescription.length > 0 && - impactDescription.length > 0 && - checkLinks(contributionLinks) && - checkLinks(fundingSources) - ); + return (activitiesDescription ?? "").length > 0; } return true; diff --git a/packages/interface/src/features/applications/components/ApplicationForm.tsx b/packages/interface/src/features/applications/components/ApplicationForm.tsx index 70b6bcff..e36c1f76 100644 --- a/packages/interface/src/features/applications/components/ApplicationForm.tsx +++ b/packages/interface/src/features/applications/components/ApplicationForm.tsx @@ -6,16 +6,15 @@ import { toast } from "sonner"; import { useAccount } from "wagmi"; import { ImageUpload } from "~/components/ImageUpload"; -import { FieldArray, Form, FormControl, FormSection, Select, Textarea } from "~/components/ui/Form"; +import { Form, FormControl, FormSection, Textarea } from "~/components/ui/Form"; import { Input } from "~/components/ui/Input"; import { useIsCorrectNetwork } from "~/hooks/useIsCorrectNetwork"; import { useCreateApplication } from "../hooks/useCreateApplication"; -import { ApplicationSchema, contributionTypes, fundingSourceTypes } from "../types"; +import { ApplicationSchema } from "../types"; import { ApplicationButtons, EApplicationStep } from "./ApplicationButtons"; import { ApplicationSteps } from "./ApplicationSteps"; -import { ImpactTags } from "./ImpactTags"; import { ReviewApplicationDetails } from "./ReviewApplicationDetails"; export const ApplicationForm = (): JSX.Element => { @@ -29,7 +28,7 @@ export const ApplicationForm = (): JSX.Element => { /** * There are 3 steps for creating an application. - * The first step is to set the project introduction (profile); + * The first step is to set the beach introduction (profile); * the second step is to set the contributions, impacts, and funding sources (advanced); * the last step is to review the input values, allow editing by going back to previous steps (review). */ @@ -69,9 +68,6 @@ export const ApplicationForm = (): JSX.Element => { { create.mutate(application); @@ -79,48 +75,32 @@ export const ApplicationForm = (): JSX.Element => { > - - + + - + - + - - - - - - - - - - @@ -130,7 +110,7 @@ export const ApplicationForm = (): JSX.Element => { required className="flex-1" hint="The size should be smaller than 1MB." - label="Project background image" + label="beach background image" name="bannerImageUrl" > @@ -140,76 +120,12 @@ export const ApplicationForm = (): JSX.Element => { - - - - - - + + - - - - ( - - - - - - - - - - - - {Object.entries(contributionTypes).map(([value, label]) => ( - - {label} - - ))} - - - - )} - title="Contribution links" - /> - - ( - - - - - - - - - - - - - - - - {Object.entries(fundingSourceTypes).map(([value, label]) => ( - - {label} - - ))} - - - - )} - title="Funding sources" - /> {step === EApplicationStep.REVIEW && } diff --git a/packages/interface/src/features/applications/components/ApplicationItem.tsx b/packages/interface/src/features/applications/components/ApplicationItem.tsx index d5f7dc8e..34e6da2d 100644 --- a/packages/interface/src/features/applications/components/ApplicationItem.tsx +++ b/packages/interface/src/features/applications/components/ApplicationItem.tsx @@ -30,7 +30,7 @@ export const ApplicationItem = ({ const form = useFormContext(); - const { fundingSources = [], profileImageUrl } = metadata.data ?? {}; + const { activitiesDescription, profileImageUrl } = metadata.data ?? {}; return ( @@ -48,7 +48,7 @@ export const ApplicationItem = ({ - {fundingSources.length} funding sources + {activitiesDescription} diff --git a/packages/interface/src/features/applications/components/ReviewApplicationDetails.tsx b/packages/interface/src/features/applications/components/ReviewApplicationDetails.tsx index 8ff1e65a..ebead9e0 100644 --- a/packages/interface/src/features/applications/components/ReviewApplicationDetails.tsx +++ b/packages/interface/src/features/applications/components/ReviewApplicationDetails.tsx @@ -3,12 +3,9 @@ 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"; -import { LinkField } from "./LinkField"; - interface IValueFieldProps { title: string; body?: ReactNode; @@ -45,24 +42,20 @@ export const ReviewApplicationDetails = (): JSX.Element => { Review & Submit - Please review and submit your project application. + Please review and submit your beach application. - Project Profile + Beach Profile - + - + - - - - @@ -91,33 +84,9 @@ export const ReviewApplicationDetails = (): JSX.Element => { - Contribution & Impact - - - - - - ( - - {tag} - - ))} - title="Impact categories" - /> - - ( - - ))} - title="Contribution links" - /> - - )} - title="Funding sources" - /> + Activities + + ); diff --git a/packages/interface/src/features/applications/types/index.ts b/packages/interface/src/features/applications/types/index.ts index a348e6d8..b9abcc74 100644 --- a/packages/interface/src/features/applications/types/index.ts +++ b/packages/interface/src/features/applications/types/index.ts @@ -1,8 +1,5 @@ import { z } from "zod"; -import { EthAddressSchema } from "~/features/voters/types"; -import { reverseKeys } from "~/utils/reverseKeys"; - export const MetadataSchema = z.object({ name: z.string().min(3), metadataType: z.enum(["1"]), @@ -34,39 +31,8 @@ export const ApplicationSchema = z.object({ // Automatically prepend "https://" if it's missing /^(http:\/\/|https:\/\/)/i.test(url) ? url : `https://${url}`, ), - payoutAddress: EthAddressSchema, - github: z.string().optional(), twitter: z.string().optional(), - contributionDescription: z.string().min(3), - impactDescription: z.string().min(3), - impactCategory: z.array(z.string()).min(1).optional(), - contributionLinks: z - .array( - z.object({ - description: z.string().min(3), - type: z.nativeEnum(reverseKeys(contributionTypes)), - url: z - .string() - .min(1) - .transform((url) => - // Automatically prepend "https://" if it's missing - /^(http:\/\/|https:\/\/)/i.test(url) ? url : `https://${url}`, - ), - }), - ) - .default([]) - .optional(), - fundingSources: z - .array( - z.object({ - description: z.string().min(3), - amount: z.number(), - currency: z.string().min(3).max(4), - type: z.nativeEnum(reverseKeys(fundingSourceTypes)), - }), - ) - .default([]) - .optional(), + activitiesDescription: z.string().min(3), }); export type Application = z.infer; diff --git a/packages/interface/src/features/projects/components/ProjectDetails.tsx b/packages/interface/src/features/projects/components/ProjectDetails.tsx index e696066e..0aefdcd9 100644 --- a/packages/interface/src/features/projects/components/ProjectDetails.tsx +++ b/packages/interface/src/features/projects/components/ProjectDetails.tsx @@ -13,9 +13,6 @@ import type { Attestation } from "~/utils/types"; import { useProjectMetadata } from "../hooks/useProjects"; -import { ProjectContacts } from "./ProjectContacts"; -import { ProjectDescriptionSection } from "./ProjectDescriptionSection"; - export interface IProjectDetailsProps { action?: ReactNode; projectId?: string; @@ -31,8 +28,7 @@ const ProjectDetails = ({ }: IProjectDetailsProps): JSX.Element => { const metadata = useProjectMetadata(attestation?.metadataPtr); - const { bio, websiteUrl, payoutAddress, github, twitter, fundingSources, profileImageUrl, bannerImageUrl } = - metadata.data ?? {}; + const { bio, activitiesDescription, profileImageUrl, bannerImageUrl } = metadata.data ?? {}; const appState = useAppState(); @@ -42,7 +38,7 @@ const ProjectDetails = ({ - + @@ -58,26 +54,24 @@ const ProjectDetails = ({ {appState === EAppState.VOTING && } - - {bio} - + - Impact statements + Activities - - - + {activitiesDescription} + + + Pictures + + + + + + + {action} diff --git a/packages/interface/src/layouts/DefaultLayout.tsx b/packages/interface/src/layouts/DefaultLayout.tsx index 3f57d5bb..abbba4bb 100644 --- a/packages/interface/src/layouts/DefaultLayout.tsx +++ b/packages/interface/src/layouts/DefaultLayout.tsx @@ -32,7 +32,7 @@ export const Layout = ({ children = null, ...props }: ILayoutProps): JSX.Element const links = [ { href: "/projects", - children: "Projects", + children: "Beaches", }, ];
Please review and submit your project application.
Please review and submit your beach application.
{bio}
- Impact statements + Activities
{activitiesDescription}
+ Pictures +