Skip to content

Commit

Permalink
updated round info
Browse files Browse the repository at this point in the history
  • Loading branch information
Crisgarner authored and ctrlc03 committed Nov 7, 2024
1 parent d3c2de3 commit 35fbf9c
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,16 @@ export const ApplicationButtons = ({

const form = useFormContext<Application>();

const [
name,
bio,
payoutAddress,
websiteUrl,
profileImageUrl,
bannerImageUrl,
contributionDescription,
impactDescription,
] = useMemo(
const [name, author, bio, payoutAddress, websiteUrl, profileImageUrl, bannerImageUrl, impactDescription] = useMemo(
() =>
form.watch([
"name",
"author",
"bio",
"payoutAddress",
"websiteUrl",
"profileImageUrl",
"bannerImageUrl",
"contributionDescription",
"impactDescription",
]),
[form],
Expand All @@ -69,13 +60,14 @@ export const ApplicationButtons = ({
profileImageUrl !== undefined &&
bio.length > 0 &&
name.length > 0 &&
author.length > 0 &&
payoutAddress.length > 0 &&
websiteUrl.length > 0
);
}

if (step === EApplicationStep.ADVANCED) {
return contributionDescription.length > 0 && impactDescription.length > 0;
return impactDescription.length > 0;
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,19 @@ export const ApplicationForm = ({ pollId }: IApplicationFormProps): JSX.Element
description="Please provide information about your project."
title="Project Profile"
>
<FormControl required hint="This is the name of your project" label="Project name" name="name">
<Input placeholder="Type your project name" />
<FormControl required hint="This is the name of your project" label="Dashboard name" name="name">
<Input placeholder="Type your dashboard name" />
</FormControl>

<FormControl required hint="This is the name of the author" label="Author name" name="author">
<Input placeholder="Type the author name" />
</FormControl>

<FormControl required label="Description" name="bio">
<Textarea placeholder="Type project description" rows={4} />
<Textarea
placeholder="What does your dashboard show? What does it help others to understand and how?"
rows={4}
/>
</FormControl>

<div className="gap-4 md:flex">
Expand All @@ -113,6 +120,10 @@ export const ApplicationForm = ({ pollId }: IApplicationFormProps): JSX.Element
<Input placeholder="Type your twitter username" />
</FormControl>

<FormControl className="flex-1" label="Farcaster" name="farcaster" required={false}>
<Input placeholder="Type your farcaster username" />
</FormControl>

<FormControl
className="flex-1"
hint="Provide your github of this project"
Expand Down Expand Up @@ -148,15 +159,11 @@ export const ApplicationForm = ({ pollId }: IApplicationFormProps): JSX.Element

<FormSection
className={step === EApplicationStep.ADVANCED ? "block" : "hidden"}
description="Describe the contribution and impact of your project."
title="Contribution & Impact"
description="Describe why is it relevant for Ethereum?."
title="Relevance"
>
<FormControl required label="Contribution description" name="contributionDescription">
<Textarea placeholder="What have your project contributed to?" rows={4} />
</FormControl>

<FormControl required label="Impact description" name="impactDescription">
<Textarea placeholder="What impact has your project had?" rows={4} />
<FormControl required label="Why is it relevant for Ethereum?" name="impactDescription">
<Textarea placeholder="Why is it relevant for Ethereum?" rows={4} />
</FormControl>
</FormSection>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const ApplicationSteps = ({ step }: IApplicationStepsProps): JSX.Element

<Interline />

<StepCategory progress={step - 1} title="Contribution & Impact" />
<StepCategory progress={step - 1} title="Relevance" />

<Interline />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,23 @@ export const ReviewApplicationDetails = (): JSX.Element => {
</div>

<div className="flex flex-col gap-6 dark:text-white">
<b className="text-lg">Project Profile</b>
<b className="text-lg">Dashboard Profile</b>

<ValueField required body={application.name} title="Project name" />
<ValueField required body={application.name} title="Dashboard name" />

<ValueField required body={application.bio} title="Project description" />
<ValueField required body={application.author} title="Author name" />

<ValueField required body={application.bio} title="Dashboard description" />

<ValueField required body={application.payoutAddress} title="Payout address" />

<div className="grid grid-flow-row gap-4 sm:grid-cols-2">
<ValueField required body={application.websiteUrl} title="Website" />

<ValueField required body={application.payoutAddress} title="Payout address" />

<ValueField body={application.twitter} title="X(Twitter)" />

<ValueField body={application.farcaster} title="Farcaster" />

<ValueField body={application.github} title="Github" />
</div>

Expand Down Expand Up @@ -88,11 +92,9 @@ export const ReviewApplicationDetails = (): JSX.Element => {
</div>

<div className="flex flex-col gap-6 dark:text-white">
<b className="text-lg">Contribution & Impact</b>

<ValueField required body={application.contributionDescription} title="Contribution description" />
<b className="text-lg">Relevance</b>

<ValueField required body={application.impactDescription} title="Impact description" />
<ValueField required body={application.impactDescription} title="Why is it relevant for Ethereum?" />
</div>
</div>
);
Expand Down
4 changes: 3 additions & 1 deletion packages/interface/src/features/applications/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const fundingSourceTypes = {

export const ApplicationSchema = z.object({
name: z.string().min(3),
author: z.string().min(3),
bio: z.string().min(3),
profileImageUrl: z.string().optional(),
bannerImageUrl: z.string().optional(),
Expand All @@ -38,7 +39,8 @@ export const ApplicationSchema = z.object({
payoutAddress: EthAddressSchema,
github: z.string().optional(),
twitter: z.string().optional(),
contributionDescription: z.string().min(3),
farcaster: z.string().optional(),
contributionDescription: z.string().optional(),
impactDescription: z.string().min(3),
impactCategory: z.array(z.string()).min(1).optional(),
contributionLinks: z
Expand Down
9 changes: 4 additions & 5 deletions packages/interface/src/features/home/components/FaqList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ export const FAQList = (): JSX.Element => (

<FAQItem
description="(Please enter the main focus and description of this round.)"
title="what is the focus of this round?"
title="What is this voting round about?"
/>

<FAQItem
description="(This is related to what gatekeeper is used.)"
title="What are the requirements for participation?"
/>
<FAQItem description="(This is related to what gatekeeper is used.)" title="What are the projects?" />

<FAQItem description="(This is related to what gatekeeper is used.)" title="Who can vote and how?" />

<FAQItem
description={
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,51 @@
import { FaGithub, FaEthereum } from "react-icons/fa";
import { FaXTwitter } from "react-icons/fa6";
import { RiGlobalLine } from "react-icons/ri";
import { SiFarcaster } from "react-icons/si";

import { Link } from "~/components/ui/Link";
import useScreenSize from "~/hooks/useScreenSize";

interface IProjectContactsProps {
author?: string;
payoutAddress?: string;
website?: string;
github?: string;
twitter?: string;
farcaster?: string;
}

export const ProjectContacts = ({
author = undefined,
payoutAddress = undefined,
website = undefined,
github = undefined,
twitter = undefined,
farcaster = undefined,
}: IProjectContactsProps): JSX.Element => {
const { width } = useScreenSize();

return (
<div className="my-8 grid w-full grid-cols-1 gap-4 border-y border-gray-200 px-2 py-4 text-blue-400 xl:grid-cols-2">
{author && (
<Link href={`https://etherscan.io/address/${author}`} target="_blank">
{payoutAddress && (
<Link href={`https://etherscan.io/address/${payoutAddress}`} target="_blank">
<FaEthereum />

{width <= 640 ? `${author.slice(0, 6)}...${author.slice(-4)}` : author}
{width <= 640 ? `${payoutAddress.slice(0, 6)}...${payoutAddress.slice(-4)}` : payoutAddress}
</Link>
)}

{twitter && (
<Link href="https://x.com" target="_blank">
<Link href={`https://x.com/${twitter}`} target="_blank">
<FaXTwitter />
x.com

{twitter}
</Link>
)}

{farcaster && (
<Link href={`https://warpcast.com/${farcaster}`} target="_blank">
<SiFarcaster />

{farcaster}
</Link>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type { IRecipient } from "~/utils/types";
import { useProjectMetadata } from "../hooks/useProjects";

import { ProjectContacts } from "./ProjectContacts";
import { ProjectDescriptionSection } from "./ProjectDescriptionSection";

export interface IProjectDetailsProps {
pollId: string;
Expand All @@ -24,15 +23,25 @@ export interface IProjectDetailsProps {
const ProjectDetails = ({ pollId, project, action = undefined }: IProjectDetailsProps): JSX.Element => {
const metadata = useProjectMetadata(project.metadataUrl);

const { bio, websiteUrl, payoutAddress, github, twitter, fundingSources, profileImageUrl, bannerImageUrl } =
metadata.data ?? {};
const {
bio,
author,
websiteUrl,
payoutAddress,
github,
twitter,
farcaster,
impactDescription,
profileImageUrl,
bannerImageUrl,
} = metadata.data ?? {};

const roundState = useRoundState(pollId);

return (
<div className="relative dark:text-white">
<div className="mb-7 px-2">
<Navigation pollId={pollId} projectName={metadata.data?.name ?? "project name"} />
<Navigation pollId={pollId} projectName={metadata.data?.name ?? "dashboard name"} />
</div>

<div className="overflow-hidden rounded-3xl">
Expand All @@ -53,25 +62,33 @@ const ProjectDetails = ({ pollId, project, action = undefined }: IProjectDetails
)}
</div>

<ProjectContacts author={payoutAddress} github={github} twitter={twitter} website={websiteUrl} />
<ProjectContacts
farcaster={farcaster}
github={github}
payoutAddress={payoutAddress}
twitter={twitter}
website={websiteUrl}
/>

<Heading as="h4" className="px-2" size="xl">
Author
</Heading>

<p className="px-2 text-gray-400">{author}</p>

<Heading as="h4" className="mt-4 px-2" size="xl">
Description
</Heading>

<p className="px-2 text-gray-400">{bio}</p>

<div className="my-8 flex flex-col gap-8 px-2">
<ProjectDescriptionSection
contributions={metadata.data?.contributionLinks}
description={metadata.data?.contributionDescription}
title="contributions"
/>
<Heading as="h4" className="mt-4 px-2" size="xl">
Why is it relevant for Ethereum?
</Heading>

<ProjectDescriptionSection
description={metadata.data?.impactDescription}
fundings={fundingSources}
title="Impact"
/>
<p className="px-2 text-gray-400">{impactDescription}</p>

{action}
</div>
{action}
</div>
);
};
Expand Down

0 comments on commit 35fbf9c

Please sign in to comment.