Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarciaegido committed Oct 18, 2024
1 parent 64ccf3e commit 7b655a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ import type { CrossmintApiClient } from "@crossmint/common-sdk-base";

export type CrossmintEmbeddedCheckoutV3ServiceProps = {
apiClient: CrossmintApiClient,
sdkMetadata: {
name: string;
version: string;
}
};

export function crossmintEmbeddedCheckoutV3Service({ apiClient, sdkMetadata }: CrossmintEmbeddedCheckoutV3ServiceProps) {
export function crossmintEmbeddedCheckoutV3Service({ apiClient }: CrossmintEmbeddedCheckoutV3ServiceProps) {
function getIFrameUrl(props: CrossmintEmbeddedCheckoutV3Props) {
const sdkMetadata = apiClient["internalConfig"].sdkMetadata;
const urlWithPath = apiClient.buildUrl("/sdk/2024-03-05/embedded-checkout");
const queryParams = new URLSearchParams();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ export function EmbeddedCheckoutV3IFrame(props: CrossmintEmbeddedCheckoutV3Props
const [height, setHeight] = useState(0);

const { crossmint } = useCrossmint();
const sdkMetadata = {
name: "@crossmint/client-sdk-react-ui",
version: LIB_VERSION,
};
const apiClient = new CrossmintApiClient(crossmint, {
internalConfig: {
sdkMetadata,
sdkMetadata: {
name: "@crossmint/client-sdk-react-ui",
version: LIB_VERSION,
},
},
});
const embedV3Service = crossmintEmbeddedCheckoutV3Service({ apiClient, sdkMetadata });
const embedV3Service = crossmintEmbeddedCheckoutV3Service({ apiClient });

const ref = useRef<HTMLIFrameElement>(null);

Expand Down

0 comments on commit 7b655a0

Please sign in to comment.