Skip to content

Commit a32e284

Browse files
committed
Feat: Select colony native token by default
1 parent 2024aaf commit a32e284

File tree

1 file changed

+5
-2
lines changed
  • src/components/v5/common/ActionSidebar/partials/AmountField

1 file changed

+5
-2
lines changed

src/components/v5/common/ActionSidebar/partials/AmountField/hooks.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { getTokenDecimalsWithFallback } from '~utils/tokens.ts';
99
import { CHAIN_FIELD_NAME } from '~v5/common/ActionSidebar/consts.ts';
1010

1111
export const useAmountField = (selectedTokenAddress: string | undefined) => {
12-
const { colony } = useColonyContext();
12+
const {
13+
colony,
14+
colony: { nativeToken },
15+
} = useColonyContext();
1316
const { watch } = useFormContext();
1417
const chainId = watch(CHAIN_FIELD_NAME) ?? DEFAULT_NETWORK_INFO.chainId;
1518

@@ -22,7 +25,7 @@ export const useAmountField = (selectedTokenAddress: string | undefined) => {
2225
const selectedToken =
2326
colonyTokens.find(
2427
(token) => token?.tokenAddress === selectedTokenAddress,
25-
) || colonyTokens[0];
28+
) || nativeToken;
2629

2730
const formattingOptions: FormatNumeralOptions = useMemo(
2831
() => ({

0 commit comments

Comments
 (0)