Skip to content

Commit

Permalink
fix: renamed sdk files
Browse files Browse the repository at this point in the history
  • Loading branch information
dianasavvatina committed Nov 12, 2024
1 parent 07496d1 commit 6a5c602
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 12 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { type ContractOrigination } from "@umami/core";
import { capitalize } from "lodash";
import { FormProvider } from "react-hook-form";

import { useSignWithBeacon } from "./useSignWithBeacon";
import { CodeSandboxIcon } from "../../../assets/icons";
import { useColor } from "../../../styles/useColor";
import { AdvancedSettingsAccordion } from "../../AdvancedSettingsAccordion";
Expand All @@ -32,10 +31,7 @@ export const OriginationOperationSignPage = (
{ operation, headerProps }: SdkSignPageProps,
calculatedSignProps: CalculatedSignProps
) => {
const { isSigning, onSign, network, form, fee } = useSignWithBeacon(
operation,
calculatedSignProps
);
const { isSigning, onSign, network, form, fee } = calculatedSignProps;
const color = useColor();
const { code, storage } = operation.operations[0] as ContractOrigination;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/components/beacon/useHandleBeaconMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -121,7 +121,7 @@ export const useHandleBeaconMessage = () => {
};

if (operation.operations.length === 1) {
modal = <BeaconSignPage {...signProps} />;
modal = <SingleSignPage {...signProps} />;
} else {
modal = <BatchSignPage {...signProps} {...message.operationDetails} />;
}
Expand Down

0 comments on commit 6a5c602

Please sign in to comment.