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 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
6 changes: 0 additions & 6 deletions apps/web/components/Forms/PoolForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,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 @@ -936,17 +935,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
47 changes: 21 additions & 26 deletions apps/web/components/ProposalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,33 +205,28 @@ 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>
<div
className={`flex-grow sm:max-w-[460px] ${isProposalEnded && "tooltip"}`}
data-tip="Can't change support from ended proposals."
>
<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
18 changes: 9 additions & 9 deletions apps/web/components/Proposals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export function Proposals({
const disableManageSupportBtnCondition: ConditionObject[] = [
{
condition: !memberActivatedStrategy,
message: "Must have points activated to support proposals",
message: "You need to activate your governance first",
},
{
condition: !isAllowed,
Expand Down Expand Up @@ -446,6 +446,7 @@ export function Proposals({
const isEndedProposalActiveAllocation = endedProposals.some(
(x) => stakedFilters[x.id]?.value,
);

// Render
return (
<>
Expand All @@ -472,7 +473,12 @@ export function Proposals({
<AdjustmentsHorizontalIcon height={24} width={24} />
}
onClick={() => setAllocationView((prev) => !prev)}
disabled={disableManSupportButton || !isAllowed}
disabled={
!isConnected ||
missmatchUrl ||
!memberActivatedStrategy ||
!isAllowed
}
tooltip={tooltipMessage}
>
Manage support
Expand Down Expand Up @@ -582,13 +588,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
4 changes: 2 additions & 2 deletions apps/web/configs/chains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const chainConfigMap: {
arbitrator: "0x10B469b23a47BC557daB81743af8A97Ef9e9f833",
passportScorer: "0x8cd4bA4ad10d85A550fe45d567a49E49e1D23CE1",
isTestnet: false,
safePrefix: "arb",
safePrefix: "arb1",
},
10: {
name: optimism.name,
Expand All @@ -173,7 +173,7 @@ export const chainConfigMap: {
arbitrator: "0x01b415E97310611EF5fea5c0b43470F6217456aA",
passportScorer: "0x084a5504dCFeac0ec3E10517247639e50c8DcFFd",
isTestnet: false,
safePrefix: "opt",
safePrefix: "oeth",
},
137: {
name: polygon.name,
Expand Down
Loading