Skip to content

Commit

Permalink
no chain
Browse files Browse the repository at this point in the history
  • Loading branch information
hardingjam committed Oct 1, 2024
1 parent 6e376a8 commit 61571e7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions app/_services/buttonsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,28 @@ export const getFieldPresetsButtons = (field: Field): any[] => {
];
};

export const getDepositPresetsButtons = (deposit: Deposit, token: TokenInfo): any[] => {
export const getDepositPresetsButtons = (
deposit: Deposit | undefined | null,
token: TokenInfo
): any[] => {
if (!deposit) {
return [];
}

return [
{
buttonTarget: 'buttonValue',
buttonValue: 'back',
buttonText: '←'
},
...(deposit?.presets
? deposit.presets?.map((preset: number) => ({
...(deposit.presets
? deposit.presets.map((preset: number) => ({
buttonTarget: 'buttonValue',
buttonValue: `${preset}`,
buttonText: `${preset} ${token.symbol}`
}))
: []),
...(deposit?.min !== undefined
...(deposit.min !== undefined
? [
{
buttonTarget: 'textInputLabel',
Expand Down

0 comments on commit 61571e7

Please sign in to comment.