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

Small fixes #504

Merged
merged 9 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 0 additions & 6 deletions apps/web/components/Forms/PoolForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,6 @@ export function PoolForm({ token, communityAddr }: Props) {
tooltip="% of Pool's voting weight needed to pass the smallest funding proposal possible. Higher funding requests demand greater conviction to pass."
label="Minimum conviction"
register={register}
required
errors={errors}
registerKey="minimumConviction"
type="number"
Expand All @@ -940,17 +939,12 @@ export function PoolForm({ token, communityAddr }: Props) {
className="pr-14"
otherProps={{
step: 1 / CV_SCALE_PRECISION,
min: 1 / CV_SCALE_PRECISION,
}}
registerOptions={{
max: {
value: 99.9,
message: "Minimum conviction should be under 100%",
},
min: {
value: 1 / CV_SCALE_PRECISION,
message: "Minimum conviction must be greater than 0",
},
}}
suffix="%"
/>
Expand Down
42 changes: 17 additions & 25 deletions apps/web/components/ProposalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,33 +205,25 @@ export function ProposalCard({
<div className="flex gap-12 flex-wrap w-full ">
<div className="mt-4 w-full">
{isAllocationView ?
<div className=" flex w-full flex-wrap items-center justify-between gap-6">
<div className="flex w-full flex-wrap items-center justify-between gap-6">
<div className="flex items-center gap-8 flex-grow flex-wrap">
<div className="flex-grow sm:max-w-[460px]">
<div
className={isProposalEnded ? "tooltip" : ""}
data-tip={
isProposalEnded ?
"Cannot change allocation when a proposal is ended"
: ""
}
>
<input
type="range"
min={0}
max={Number(memberActivatedPoints)}
value={inputData ? Number(inputData.value) : undefined}
className={`range range-md cursor-pointer bg-neutral-soft [--range-shdw:var(--color-green-500)] ${isProposalEnded ? "grayscale !cursor-not-allowed" : ""}`}
step={Number(memberActivatedPoints / 100n)}
onChange={(e) => {
inputHandler(
proposalData.id,
BigInt(Math.floor(Number(e.target.value))),
);
}}
disabled={isProposalEnded}
/>
</div>
<input
type="range"
min={0}
max={Number(memberActivatedPoints)}
value={inputData ? Number(inputData.value) : undefined}
className={`range range-md cursor-pointer bg-neutral-soft [--range-shdw:var(--color-green-500)] ${isProposalEnded ? "grayscale !cursor-not-allowed" : ""}`}
step={Number(memberActivatedPoints / 100n)}
onChange={(e) => {
inputHandler(
proposalData.id,
BigInt(Math.floor(Number(e.target.value))),
);
}}
disabled={isProposalEnded}
/>

<div className="flex w-full justify-between px-2.5">
{[...Array(21)].map((_, i) => (
// eslint-disable-next-line react/no-array-index-key
Expand Down
10 changes: 2 additions & 8 deletions apps/web/components/Proposals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export function Proposals({
<AdjustmentsHorizontalIcon height={24} width={24} />
}
onClick={() => setAllocationView((prev) => !prev)}
disabled={disableManSupportButton || !isAllowed}
disabled={!isConnected || missmatchUrl || !isAllowed}
tooltip={tooltipMessage}
>
Manage support
Expand Down Expand Up @@ -582,13 +582,7 @@ export function Proposals({
<Button
icon={<PlusIcon height={24} width={24} />}
disabled={!isConnected || missmatchUrl || !isMemberCommunity}
tooltip={
isConnected ?
isMemberCommunity ?
undefined
: "Register to community first"
: "Connect wallet first"
}
tooltip={tooltipMessage}
>
Create a proposal
</Button>
Expand Down
Loading