@springmicro/cart 0.5.13 → 0.5.15
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/dist/index.js +3204 -3166
- package/dist/index.umd.cjs +59 -59
- package/package.json +3 -3
- package/src/CartButton.tsx +15 -7
- package/src/checkout/ReviewCartAndCalculateTaxes.tsx +41 -23
- package/src/checkout/components/AddCard.tsx +128 -107
- package/src/checkout/components/Address.tsx +1 -1
- package/src/checkout/components/CartList.tsx +39 -23
- package/src/checkout/components/StatusBar.tsx +6 -4
- package/src/checkout/index.tsx +5 -2
package/src/checkout/index.tsx
CHANGED
|
@@ -16,6 +16,7 @@ export default function Checkout({
|
|
|
16
16
|
disableMissingImage = false,
|
|
17
17
|
CollectExtraInfo,
|
|
18
18
|
defaultValues,
|
|
19
|
+
dev,
|
|
19
20
|
}: {
|
|
20
21
|
apiBaseUrl: string;
|
|
21
22
|
taxProvider: string;
|
|
@@ -24,6 +25,7 @@ export default function Checkout({
|
|
|
24
25
|
disableMissingImage?: boolean;
|
|
25
26
|
CollectExtraInfo?: React.FC<{ formik: FormikConfig<any> }>;
|
|
26
27
|
defaultValues?: Record<string, any>;
|
|
28
|
+
dev?: boolean;
|
|
27
29
|
}) {
|
|
28
30
|
const store = useStore(cartStore);
|
|
29
31
|
const cart = useMemo(() => JSON.parse(store), [store]);
|
|
@@ -32,7 +34,7 @@ export default function Checkout({
|
|
|
32
34
|
const [products, setProducts] = useState({});
|
|
33
35
|
const [prices, setPrices] = useState({});
|
|
34
36
|
const [subtotal, setSubtotal] = useState("Loading prices...");
|
|
35
|
-
const taxState = useState({ tax_amount: "TBD" });
|
|
37
|
+
const taxState = useState<any>({ tax_amount: "TBD" });
|
|
36
38
|
const shipping = 0;
|
|
37
39
|
const discount = 0;
|
|
38
40
|
|
|
@@ -189,7 +191,7 @@ export default function Checkout({
|
|
|
189
191
|
*
|
|
190
192
|
*/}
|
|
191
193
|
|
|
192
|
-
{status
|
|
194
|
+
{status < 2 && (
|
|
193
195
|
<ReviewAndCalculateTaxes
|
|
194
196
|
subtotal={subtotal}
|
|
195
197
|
discount={discount}
|
|
@@ -211,6 +213,7 @@ export default function Checkout({
|
|
|
211
213
|
}}
|
|
212
214
|
CollectExtraInfo={CollectExtraInfo}
|
|
213
215
|
defaultValues={defaultValues}
|
|
216
|
+
dev={dev}
|
|
214
217
|
/>
|
|
215
218
|
)}
|
|
216
219
|
{status === 2 && order !== undefined && (
|