@springmicro/cart 0.3.5 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@springmicro/cart",
3
3
  "private": false,
4
- "version": "0.3.5",
4
+ "version": "0.4.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@nanostores/persistent": "^0.10.1",
25
25
  "@nanostores/query": "^0.3.3",
26
26
  "@nanostores/react": "^0.7.2",
27
- "@springmicro/utils": "0.3.5",
27
+ "@springmicro/utils": "0.4.1",
28
28
  "dotenv": "^16.4.5",
29
29
  "nanostores": "^0.10.3",
30
30
  "react": "^18.2.0",
@@ -49,5 +49,5 @@
49
49
  "vite-plugin-css-injected-by-js": "^3.5.1",
50
50
  "yup": "^1.4.0"
51
51
  },
52
- "gitHead": "1bbf206d79047e5897172fb794fc876ad6c45498"
52
+ "gitHead": "53937ff954e78bc3053c107c26e1d4d0dc036ccd"
53
53
  }
@@ -110,6 +110,7 @@ export default function ReviewAndCalculateTaxes({
110
110
  setSuccessData,
111
111
  invoiceId = undefined,
112
112
  onPlacement = undefined,
113
+ CollectExtraInfo = undefined,
113
114
  }) {
114
115
  const [formDisabled, setFormDisabled] = useState(true);
115
116
  const [formError, setFormError] = useState(undefined);
@@ -347,7 +348,10 @@ export default function ReviewAndCalculateTaxes({
347
348
  }}
348
349
  />
349
350
  {status === 0 && (
350
- <Box sx={{ flexGrow: 1 }}>
351
+ <Box
352
+ sx={{ flexGrow: 1, display: "flex", flexDirection: "column", gap: 2 }}
353
+ >
354
+ {CollectExtraInfo && <CollectExtraInfo formik={formik} />}
351
355
  <AddCard
352
356
  onSubmit={createOrderAndGetTaxes}
353
357
  stacked={stacked}
@@ -6,6 +6,7 @@ import { cartStore, clearCart } from "../utils/storage";
6
6
  import { StatusBar } from "./components/StatusBar";
7
7
  import ReviewAndCalculateTaxes from "./ReviewCartAndCalculateTaxes";
8
8
  import Invoice from "./components/Invoice";
9
+ import { FormikConfig } from "formik";
9
10
 
10
11
  export default function Checkout({
11
12
  apiBaseUrl,
@@ -13,12 +14,14 @@ export default function Checkout({
13
14
  emptyCartLink = "",
14
15
  disableProductLink = false,
15
16
  disableMissingImage = false,
17
+ CollectExtraInfo,
16
18
  }: {
17
19
  apiBaseUrl: string;
18
20
  taxProvider: string;
19
21
  emptyCartLink?: string;
20
22
  disableProductLink?: boolean;
21
23
  disableMissingImage?: boolean;
24
+ CollectExtraInfo?: React.FC<{ formik: FormikConfig<any> }>;
22
25
  }) {
23
26
  const cart = JSON.parse(useStore(cartStore));
24
27
 
@@ -150,6 +153,7 @@ export default function Checkout({
150
153
  clearCart();
151
154
  setStatus(2);
152
155
  }}
156
+ CollectExtraInfo={CollectExtraInfo}
153
157
  />
154
158
  )}
155
159
  {status === 2 && order !== undefined && (