Skip to content

Commit bb66eae

Browse files
committed
No index drilling
1 parent 8cd6ce8 commit bb66eae

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

src/components/ProposalBuilder/ProposalActionCard.tsx

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ import { Card } from '../ui/cards/Card';
1212
import { SendAssetsData } from '../ui/modals/SendAssetsModal';
1313

1414
export function SendAssetsAction({
15-
index,
1615
action,
1716
onRemove,
1817
}: {
19-
index: number;
2018
action: SendAssetsData;
21-
onRemove: (index: number) => void;
19+
onRemove: () => void;
2220
}) {
2321
const { t } = useTranslation('common');
2422
const { displayName } = useGetAccountName(action.destinationAddress);
@@ -47,9 +45,7 @@ export function SendAssetsAction({
4745
color="red-0"
4846
variant="tertiary"
4947
size="sm"
50-
onClick={() => {
51-
onRemove(index);
52-
}}
48+
onClick={onRemove}
5349
>
5450
<Icon as={Trash} />
5551
</Button>
@@ -59,16 +55,14 @@ export function SendAssetsAction({
5955
}
6056

6157
export function AirdropAction({
62-
index,
6358
totalAmount,
6459
recipientsCount,
6560
onRemove,
6661
asset,
6762
}: {
68-
index: number;
6963
totalAmount: bigint;
7064
recipientsCount: number;
71-
onRemove: (index: number) => void;
65+
onRemove: () => void;
7266
asset: TokenBalance;
7367
}) {
7468
const { t } = useTranslation('common');
@@ -98,9 +92,7 @@ export function AirdropAction({
9892
color="red-0"
9993
variant="tertiary"
10094
size="sm"
101-
onClick={() => {
102-
onRemove(index);
103-
}}
95+
onClick={onRemove}
10496
>
10597
<Icon as={Trash} />
10698
</Button>
@@ -143,14 +135,13 @@ export function ProposalActionCard({
143135
return (
144136
<SendAssetsAction
145137
key={index}
146-
index={index}
147138
action={{
148139
destinationAddress,
149140
transferAmount,
150141
asset: actionAsset,
151142
nonceInput: undefined,
152143
}}
153-
onRemove={removeAction}
144+
onRemove={() => removeAction(index)}
154145
/>
155146
);
156147
} else if (action.actionType === ProposalActionType.AIRDROP) {
@@ -174,11 +165,10 @@ export function ProposalActionCard({
174165
return (
175166
<AirdropAction
176167
key={index}
177-
index={index}
178168
asset={actionAsset}
179169
totalAmount={totalAmount}
180170
recipientsCount={recipientsCount}
181-
onRemove={removeAction}
171+
onRemove={() => removeAction(index)}
182172
/>
183173
);
184174
}

0 commit comments

Comments
 (0)