diff --git a/apps/web/src/components/SendFlow/Beacon/BeaconSignPageProps.ts b/apps/web/src/components/SendFlow/Beacon/BeaconSignPageProps.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/apps/web/src/components/SendFlow/Beacon/BatchSignPage.tsx b/apps/web/src/components/SendFlow/sdk/BatchSignPage.tsx similarity index 97% rename from apps/web/src/components/SendFlow/Beacon/BatchSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/BatchSignPage.tsx index 59469e74d1..8616529ef8 100644 --- a/apps/web/src/components/SendFlow/Beacon/BatchSignPage.tsx +++ b/apps/web/src/components/SendFlow/sdk/BatchSignPage.tsx @@ -16,10 +16,10 @@ import { import { FormProvider } from "react-hook-form"; import { Header } from "./Header"; -import { useSignWithBeacon } from "./useSignWithBeacon"; import { useColor } from "../../../styles/useColor"; import { AddressTile } from "../../AddressTile/AddressTile"; import { JsValueWrap } from "../../JsValueWrap"; +import { useSignWithBeacon } from "../Beacon/useSignWithBeacon"; import { SignButton } from "../SignButton"; import { SignPageFee } from "../SignPageFee"; import { type SdkSignPageProps } from "../utils"; diff --git a/apps/web/src/components/SendFlow/Beacon/ContractCallSignPage.tsx b/apps/web/src/components/SendFlow/sdk/ContractCallSignPage.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/ContractCallSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/ContractCallSignPage.tsx diff --git a/apps/web/src/components/SendFlow/Beacon/DelegationSignPage.tsx b/apps/web/src/components/SendFlow/sdk/DelegationSignPage.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/DelegationSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/DelegationSignPage.tsx diff --git a/apps/web/src/components/SendFlow/Beacon/FinalizeUnstakeSignPage.tsx b/apps/web/src/components/SendFlow/sdk/FinalizeUnstakeSignPage.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/FinalizeUnstakeSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/FinalizeUnstakeSignPage.tsx diff --git a/apps/web/src/components/SendFlow/Beacon/Header.tsx b/apps/web/src/components/SendFlow/sdk/Header.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/Header.tsx rename to apps/web/src/components/SendFlow/sdk/Header.tsx diff --git a/apps/web/src/components/SendFlow/Beacon/OriginationOperationSignPage.test.tsx b/apps/web/src/components/SendFlow/sdk/OriginationOperationSignPage.test.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/OriginationOperationSignPage.test.tsx rename to apps/web/src/components/SendFlow/sdk/OriginationOperationSignPage.test.tsx diff --git a/apps/web/src/components/SendFlow/Beacon/OriginationOperationSignPage.tsx b/apps/web/src/components/SendFlow/sdk/OriginationOperationSignPage.tsx similarity index 98% rename from apps/web/src/components/SendFlow/Beacon/OriginationOperationSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/OriginationOperationSignPage.tsx index 14dd0911f8..e9d5431bda 100644 --- a/apps/web/src/components/SendFlow/Beacon/OriginationOperationSignPage.tsx +++ b/apps/web/src/components/SendFlow/sdk/OriginationOperationSignPage.tsx @@ -31,11 +31,10 @@ export const OriginationOperationSignPage = ( { operation, headerProps }: SdkSignPageProps, calculatedSignProps: CalculatedSignProps ) => { + const { isSigning, onSign, network, form, fee } = calculatedSignProps; const color = useColor(); const { code, storage } = operation.operations[0] as ContractOrigination; - const { isSigning, onSign, network, fee, form } = calculatedSignProps; - return ( diff --git a/apps/web/src/components/SendFlow/Beacon/BeaconSignPage.tsx b/apps/web/src/components/SendFlow/sdk/SingleSignPage.tsx similarity index 93% rename from apps/web/src/components/SendFlow/Beacon/BeaconSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/SingleSignPage.tsx index 07cae37f7c..c51abd0d7a 100644 --- a/apps/web/src/components/SendFlow/Beacon/BeaconSignPage.tsx +++ b/apps/web/src/components/SendFlow/sdk/SingleSignPage.tsx @@ -7,9 +7,9 @@ import { StakeSignPage } from "./StakeSignPage"; import { TezSignPage } from "./TezSignPage"; import { UndelegationSignPage } from "./UndelegationSignPage"; import { UnstakeSignPage } from "./UnstakeSignPage"; -import { useSignWithBeacon } from "./useSignWithBeacon"; +import { useSignWithBeacon } from "../Beacon/useSignWithBeacon"; -export const BeaconSignPage = (signProps: SdkSignPageProps) => { +export const SingleSignPage = (signProps: SdkSignPageProps) => { const operationType = signProps.operation.operations[0].type; const calculatedProps = useSignWithBeacon({ ...signProps }); diff --git a/apps/web/src/components/SendFlow/Beacon/StakeSignPage.tsx b/apps/web/src/components/SendFlow/sdk/StakeSignPage.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/StakeSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/StakeSignPage.tsx diff --git a/apps/web/src/components/SendFlow/Beacon/TezSignPage.test.tsx b/apps/web/src/components/SendFlow/sdk/TezSignPage.test.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/TezSignPage.test.tsx rename to apps/web/src/components/SendFlow/sdk/TezSignPage.test.tsx diff --git a/apps/web/src/components/SendFlow/Beacon/TezSignPage.tsx b/apps/web/src/components/SendFlow/sdk/TezSignPage.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/TezSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/TezSignPage.tsx diff --git a/apps/web/src/components/SendFlow/Beacon/UndelegationSignPage.tsx b/apps/web/src/components/SendFlow/sdk/UndelegationSignPage.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/UndelegationSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/UndelegationSignPage.tsx diff --git a/apps/web/src/components/SendFlow/Beacon/UnstakeSignPage.tsx b/apps/web/src/components/SendFlow/sdk/UnstakeSignPage.tsx similarity index 100% rename from apps/web/src/components/SendFlow/Beacon/UnstakeSignPage.tsx rename to apps/web/src/components/SendFlow/sdk/UnstakeSignPage.tsx diff --git a/apps/web/src/components/beacon/useHandleBeaconMessage.test.tsx b/apps/web/src/components/beacon/useHandleBeaconMessage.test.tsx index 8a838b270f..3e07fcb708 100644 --- a/apps/web/src/components/beacon/useHandleBeaconMessage.test.tsx +++ b/apps/web/src/components/beacon/useHandleBeaconMessage.test.tsx @@ -19,8 +19,8 @@ import { executeParams } from "@umami/test-utils"; import { mockImplicitAddress } from "@umami/tezos"; import { useHandleBeaconMessage } from "./useHandleBeaconMessage"; -import { BatchSignPage } from "../../components/SendFlow/Beacon/BatchSignPage"; -import { BeaconSignPage } from "../../components/SendFlow/Beacon/BeaconSignPage"; +import { BatchSignPage } from "../../components/SendFlow/sdk/BatchSignPage"; +import { SingleSignPage } from "../../components/SendFlow/sdk/SingleSignPage"; import { act, dynamicModalContextMock, renderHook, screen, waitFor } from "../../testUtils"; import { type SdkSignPageProps } from "../SendFlow/utils"; @@ -326,7 +326,7 @@ describe("", () => { }); describe("single operation", () => { - it("opens a modal with the BeaconSignPage for 1 operation", async () => { + it("opens a modal with the SingleSignPage for 1 operation", async () => { jest.mocked(estimate).mockResolvedValueOnce({ ...makeAccountOperations(account, account, [ { type: "tez", amount: "1", recipient: mockImplicitAddress(2) }, @@ -375,7 +375,7 @@ describe("", () => { await waitFor(() => expect(dynamicModalContextMock.openWith).toHaveBeenCalledWith( - , + , { onClose: expect.any(Function) } ) ); diff --git a/apps/web/src/components/beacon/useHandleBeaconMessage.tsx b/apps/web/src/components/beacon/useHandleBeaconMessage.tsx index 13c9a7c05e..49dc19fac8 100644 --- a/apps/web/src/components/beacon/useHandleBeaconMessage.tsx +++ b/apps/web/src/components/beacon/useHandleBeaconMessage.tsx @@ -17,15 +17,15 @@ import { type Network } from "@umami/tezos"; import { PermissionRequestModal } from "./PermissionRequestModal"; import { SignPayloadRequestModal } from "./SignPayloadRequestModal"; -import { BatchSignPage } from "../../components/SendFlow/Beacon/BatchSignPage"; -import { BeaconSignPage } from "../../components/SendFlow/Beacon/BeaconSignPage"; +import { BatchSignPage } from "../../components/SendFlow/sdk/BatchSignPage"; +import { SingleSignPage } from "../../components/SendFlow/sdk/SingleSignPage"; import { type SdkSignPageProps } from "../SendFlow/utils"; /** * @returns a function that handles a beacon message and opens a modal with the appropriate content * * For operation requests it will also try to convert the operation(s) to our {@link Operation} format, - * estimate the fee and open the BeaconSignPage only if it succeeds + * estimate the fee and open the SingleSignPage only if it succeeds */ export const useHandleBeaconMessage = () => { const { openWith } = useDynamicModalContext(); @@ -121,7 +121,7 @@ export const useHandleBeaconMessage = () => { }; if (operation.operations.length === 1) { - modal = ; + modal = ; } else { modal = ; }