Skip to content

Commit

Permalink
Merge branch 'small-fixes' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati0x committed Dec 12, 2024
2 parents 7124d8d + 3239afe commit b5501eb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 43 deletions.
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

0 comments on commit b5501eb

Please sign in to comment.