Skip to content

Commit

Permalink
Add advanced settings to multisig sign page
Browse files Browse the repository at this point in the history
  • Loading branch information
OKendigelyan committed Jun 12, 2024
1 parent ebef7e5 commit 5f601cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/components/AdvancedSettingsAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import colors from "../style/colors";
import { mutezToTez, tezToMutez } from "../utils/format";
import { Estimation, TEZ_DECIMALS } from "../utils/tezos";

export const AdvancedSettingsAccordion = ({ index = 0 }) => {
type AdvancedSettingsAccordionProps = {
index?: number;
};

export const AdvancedSettingsAccordion = ({ index = 0 }: AdvancedSettingsAccordionProps) => {
const {
register,
getValues,
Expand Down
12 changes: 9 additions & 3 deletions src/components/SendFlow/Multisig/SignPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { EstimatedAccountOperations } from "../../../types/AccountOperations";
import { ApproveOrExecute } from "../../../types/Operation";
import { useAsyncActionHandler } from "../../../utils/hooks/useAsyncActionHandler";
import { executeOperations } from "../../../utils/tezos";
import { AdvancedSettingsAccordion } from "../../AdvancedSettingsAccordion";
import { DynamicModalContext } from "../../DynamicModal";
import { BatchModalBody } from "../BatchModalBody";
import { SignButton } from "../SignButton";
Expand All @@ -28,7 +29,8 @@ export const SignPage: React.FC<{
defaultValues: { executeParams: operation.estimates },
});

// TODO: add advanced execute params component
const updatedOperation = { ...operation, estimates: form.watch("executeParams") };

const approveOrExecute = (tezosToolkit: TezosToolkit) =>
handleAsyncAction(
async () => {
Expand All @@ -48,8 +50,12 @@ export const SignPage: React.FC<{
<FormProvider {...form}>
<ModalContent>
<form>
<BatchModalBody operation={operation} title={title} transactionCount={transactionCount} />

<BatchModalBody
operation={updatedOperation}
title={title}
transactionCount={transactionCount}
/>
<AdvancedSettingsAccordion />
<ModalFooter>
<SignButton onSubmit={approveOrExecute} signer={signer} text={title} />
</ModalFooter>
Expand Down

0 comments on commit 5f601cc

Please sign in to comment.