Skip to content

Commit

Permalink
feat: allow gasLimit field to be disabled (#7784)
Browse files Browse the repository at this point in the history
  • Loading branch information
CremaFR committed Sep 13, 2024
1 parent 06a6ce1 commit 0bad0cb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-turtles-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

feat: allow gasLimit field to be disabled
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const AdvancedOptions: NonNullable<EvmFamily["sendAmountFields"]>["component"] =
transaction,
status,
updateTransaction,
disableEditGasLimit,
}) => {
invariant(transaction.family === "evm", "AdvancedOptions: evm family expected");
invariant(account, "Account required");
Expand Down Expand Up @@ -63,18 +64,20 @@ const AdvancedOptions: NonNullable<EvmFamily["sendAmountFields"]>["component"] =
) : (
<Box horizontal justifyContent="left">
<Label color="p.theme.colors.palette.text.shade100">{gasLimit.toString()}</Label>
<Button
borderRadius={4}
variant="shade"
outline
size="small"
onClick={onEditClick}
ml={2}
>
<Box horizontal alignItems="center">
{t("send.steps.details.edit")}
</Box>
</Button>
{!disableEditGasLimit && (
<Button
borderRadius={4}
variant="shade"
outline
size="small"
onClick={onEditClick}
ml={2}
>
<Box horizontal alignItems="center">
{t("send.steps.details.edit")}
</Box>
</Button>
)}
</Box>
)}
</Box>
Expand Down
1 change: 1 addition & 0 deletions apps/ledger-live-desktop/src/renderer/families/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export type LLDCoinFamily<
bridgePending?: boolean;
trackProperties?: Record<string, unknown>;
transactionToUpdate?: T;
disableEditGasLimit?: boolean;
}>;
fields?: string[];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type SendAmountFieldsProps = {
trackProperties?: Record<string, unknown>;
transactionToUpdate?: Transaction;
disableSlowStrategy?: boolean;
disableEditGasLimit?: boolean;
};

const AmountRelatedField = (props: SendAmountFieldsProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export default function FeesDrawerLiveApp({
updateTransaction={handleUpdateTransaction}
mapStrategies={mapStrategies}
disableSlowStrategy={disableSlowStrategy}
disableEditGasLimit={true}
trackProperties={{
page: "Swap quotes",
...swapDefaultTrack,
Expand Down

0 comments on commit 0bad0cb

Please sign in to comment.