Skip to content

Commit

Permalink
embed: use real order type (#842)
Browse files Browse the repository at this point in the history
* embed: use real order type

* changeset
  • Loading branch information
mPaella authored Oct 29, 2024
1 parent ab3e629 commit ea8ce4d
Show file tree
Hide file tree
Showing 7 changed files with 4,509 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .changeset/silent-countries-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@crossmint/client-sdk-react-ui": patch
"@crossmint/client-sdk-base": patch
---

embed: add Order type
2 changes: 2 additions & 0 deletions packages/client/base/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from "./lib";

export * from "./utils";
export * from "./types";
export * from "./services";
Expand Down
4,493 changes: 4,493 additions & 0 deletions packages/client/base/src/lib/hosted-checkout/Order.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/client/base/src/lib/hosted-checkout/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Order";
1 change: 1 addition & 0 deletions packages/client/base/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./hosted-checkout";
4 changes: 2 additions & 2 deletions packages/client/ui/react-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"types": "./dist/index.d.ts",
"files": ["dist", "src", "LICENSE"],
"scripts": {
"build": "NODE_OPTIONS='--max-old-space-size=8192' tsup",
"dev": "NODE_OPTIONS='--max-old-space-size=8192' tsup --watch",
"build": "cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",
"dev": "cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch",
"test": "vitest run"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { createContext, type ReactNode, useContext, useEffect, useState } from "react";
import type { embeddedCheckoutV3IncomingEvents } from "@crossmint/client-sdk-base";
import type { embeddedCheckoutV3IncomingEvents, Order } from "@crossmint/client-sdk-base";
import type { z } from "zod";
import { useCrossmint } from "./useCrossmint";
import { createCrossmintApiClient } from "@/utils/createCrossmintApiClient";

export interface CrossmintCheckoutContext {
order?: any;
order?: Order;
orderClientSecret?: string;
}

const CrossmintCheckoutContext = createContext<CrossmintCheckoutContext | undefined>(undefined);

export function CrossmintCheckoutProvider({ children }: { children: ReactNode }) {
const [order, setOrder] = useState<any>();
const [orderClientSecret, setOrderClientSecret] = useState<string>();
const [order, setOrder] = useState<Order | undefined>(undefined);
const [orderClientSecret, setOrderClientSecret] = useState<string | undefined>(undefined);

const { crossmint } = useCrossmint();
const apiClient = createCrossmintApiClient(crossmint);
Expand Down

0 comments on commit ea8ce4d

Please sign in to comment.