Skip to content

Commit

Permalink
remove select askAmount (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 authored Mar 14, 2024
1 parent 699fd1f commit 47b0cf5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
5 changes: 5 additions & 0 deletions packages/nextjs/app/api/grants/new/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ export async function POST(req: Request) {
return NextResponse.json({ error: "Invalid form details submited" }, { status: 400 });
}

// Check to see if the askAmount === 0.25
if (Number(askAmount) !== 0.25) {
return NextResponse.json({ error: "Invalid askAmount" }, { status: 400 });
}

// Verif if the builder is present
const builder = await findUserByAddress(signer);
if (!builder.exists) {
Expand Down
23 changes: 5 additions & 18 deletions packages/nextjs/app/apply/_component/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ type ReqBody = {
signer?: string;
};

const selectOptions = [0.1, 0.25, 0.5, 1];

const Form = () => {
const { address: connectedAddress } = useAccount();
const { signTypedDataAsync } = useSignTypedData();
Expand All @@ -34,7 +32,7 @@ const Form = () => {
try {
const title = formData.get("title") as string;
const description = formData.get("description") as string;
const askAmount = formData.get("askAmount") as string;
const askAmount = "0.25";
if (!title || !description || !askAmount) {
notification.error("Please fill all the fields");
return;
Expand Down Expand Up @@ -65,12 +63,12 @@ const Form = () => {
};

return (
<div className="card card-compact w-96 bg-base-100 shadow-xl">
<form action={clientFormAction} className="card-body space-y-4">
<div className="card card-compact rounded-xl w-96 bg-secondary shadow-lg">
<form action={clientFormAction} className="card-body space-y-3">
<h2 className="card-title self-center text-3xl !mb-0">Submit Proposal</h2>
<div className="space-y-2">
<p className="m-0 text-xl ml-2">Title</p>
<div className="flex border-2 border-base-300 bg-base-200 rounded-full text-accent">
<div className="flex border-2 border-base-300 bg-base-200 rounded-xl text-accent">
<input
className="input input-ghost focus-within:border-transparent focus:outline-none focus:bg-transparent focus:text-gray-400 h-[2.2rem] min-h-[2.2rem] px-4 border w-full font-medium placeholder:text-accent/50 text-gray-400"
placeholder="title"
Expand All @@ -82,7 +80,7 @@ const Form = () => {
</div>
<div className="space-y-2">
<p className="m-0 text-xl ml-2">Description</p>
<div className="flex border-2 border-base-300 bg-base-200 rounded-3xl text-accent">
<div className="flex border-2 border-base-300 bg-base-200 rounded-xl text-accent">
<textarea
className="input input-ghost focus-within:border-transparent focus:outline-none focus:bg-transparent focus:text-gray-400 px-4 pt-2 border w-full font-medium placeholder:text-accent/50 text-gray-400 h-28 rounded-none"
placeholder="description"
Expand All @@ -91,17 +89,6 @@ const Form = () => {
/>
</div>
</div>
<div className="space-y-2">
<p className="m-0 text-xl ml-2">Ask amount</p>
<select className="select bg-base-200 select-primary select-md select-bordered w-full" name="askAmount">
<option disabled>Select amount</option>
{selectOptions.map(option => (
<option key={option} value={option}>
{option} ETH
</option>
))}
</select>
</div>
<SubmitButton />
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/app/apply/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NextPage } from "next";

const SubmitGrant: NextPage = () => {
return (
<div className="flex items-center flex-col flex-grow text-center pt-10 md:pt-4 px-6">
<div className="flex bg-base-100 items-center flex-col flex-grow text-center pt-10 md:pt-4 px-6">
<h1 className="text-3xl sm:text-4xl font-bold mb-4">Apply for a Community Grant</h1>
<p className="text-md mb-0 max-w-xl">
As a BuidlGuidl member, you can build projects to make a significant impact on the ecosystem, and get
Expand Down

0 comments on commit 47b0cf5

Please sign in to comment.