Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Community form upgrade #465

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions apps/web/components/Forms/CommunityForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import React, { useState } from "react";
import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/outline";
import { usePathname, useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { Address, Chain, createPublicClient, http, parseUnits } from "viem";
Expand Down Expand Up @@ -237,7 +238,7 @@ export const CommunityForm = ({
formRows={formatFormRows()}
previewTitle="Check details and covenant description"
/>
: <div className="flex flex-col gap-2 overflow-hidden p-1">
: <div className="flex flex-col gap-2 p-1">
<div className="flex flex-col">
<FormInput
label="Community Name"
Expand Down Expand Up @@ -269,6 +270,7 @@ export const CommunityForm = ({
min: INPUT_TOKEN_MIN_VALUE,
}}
suffix={tokenGarden.symbol}
tooltip="Amount of tokens user must stake to join and participate in community governance. Refundable upon leaving the community."
/>
</div>
<div className="flex flex-col">
Expand All @@ -295,6 +297,7 @@ export const CommunityForm = ({
},
}}
suffix="%"
tooltip="A percentage fee applied from the membership stake amount when joining a community."
/>
</div>
<div className="flex flex-col">
Expand All @@ -311,6 +314,7 @@ export const CommunityForm = ({
registerKey="feeReceiver"
placeholder="0x.."
type="text"
tooltip="Safe or Ethereum address that receives the fees paid by members."
/>
</div>
<div className="flex flex-col">
Expand All @@ -331,21 +335,23 @@ export const CommunityForm = ({
registerKey="councilSafe"
placeholder="0x.."
type="text"
tooltip="The moderators of the community. Choose a Safe address that can create pools and manage settings in the community."
/>
</div>

<div className="flex">
<FormCheckBox
label="Admins can expel members"
label="Council safe can expel members"
register={register}
errors={errors}
registerKey="isKickMemberEnabled"
type="checkbox"
tooltip="If enabled, the council can remove members from the community. Removed members will receive their staked tokens back and can rejoin later."
/>
</div>
<div className="flex flex-col">
<FormInput
label="Covenant description"
label="Covenant"
register={register}
required
errors={errors}
Expand All @@ -358,6 +364,21 @@ export const CommunityForm = ({
rows={7}
placeholder="Covenant description..."
/>
<div className="flex sm:items-center gap-4">
<a
href="https://www.notion.so/1hive-gardens/Community-Onboarding-b9abf08bb1a64ca299defade9f31368f"
target="_blank"
rel="noreferrer"
className="text-primary-content flex items-center gap-1 hover:opacity-90"
>
Tools for creating your Community&apos;s Covenant
<ArrowTopRightOnSquareIcon
width={16}
height={16}
className="text-primary-content"
/>
</a>
</div>
</div>
</div>
}
Expand Down
Loading