Skip to content

Commit

Permalink
Explicitly set bigNumberValue to null while creating proposal templat…
Browse files Browse the repository at this point in the history
…e and within BigNumberInput
  • Loading branch information
mudrila committed Apr 8, 2024
1 parent 6b0aade commit ac192ff
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/CreateProposalTemplate/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CreateProposalTemplateTransaction } from '../../types/createProposalTem

export const DEFAULT_PROPOSAL_TEMPLATE_TRANSACTION: CreateProposalTemplateTransaction = {
targetAddress: '',
ethValue: { value: '', bigNumberValue: undefined },
ethValue: { value: '', bigNumberValue: null },
functionName: '',
parameters: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ITokenAllocations {
setFieldValue: (field: string, value: any) => void;
addressErrorMessage: string | null;
amountErrorMessage: string | null;
amountInputValue: BigNumber | undefined;
amountInputValue: BigNumber | undefined | null;
allocationLength: number;
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/ui/forms/BigNumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import { BigNumberValuePair } from '../../../types';
export interface BigNumberInputProps
extends Omit<InputElementProps, 'value' | 'onChange'>,
FormControlOptions {
value: BigNumber | undefined;
value: BigNumber | undefined | null;
onChange: (value: BigNumberValuePair) => void;
decimalPlaces?: number;
min?: string;
max?: string;
maxValue?: BigNumber;
maxValue?: BigNumber | null;
}
/**
* This component will add a chakra Input component that accepts and sets a BigNumber
Expand Down Expand Up @@ -82,7 +82,7 @@ export function BigNumberInput({
if (stringValue === '') {
onChange({
value: stringValue,
bigNumberValue: undefined,
bigNumberValue: null,
});
setInputValue('');
return;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/utils/useApproval.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useTransaction } from './useTransaction';
const useApproval = (
tokenContract?: VotesERC20 | VotesERC20Wrapper,
spenderAddress?: string,
userBalance?: BigNumber,
userBalance?: BigNumber | null,
) => {
const { address: account } = useAccount();
const [allowance, setAllowance] = useState(BigNumber.from(0));
Expand Down
2 changes: 1 addition & 1 deletion src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BigNumber } from 'ethers';

export interface BigNumberValuePair {
value: string;
bigNumberValue?: BigNumber;
bigNumberValue?: BigNumber | null;
}

export type WithError = { error?: string };

0 comments on commit ac192ff

Please sign in to comment.