@stigg/react-sdk 4.4.0-beta.6 → 4.4.0-beta.7
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/react-sdk.cjs.development.js +11 -9
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +11 -9
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/checkout/steps/addons/CheckoutAddonsStep.tsx +9 -4
package/package.json
CHANGED
|
@@ -63,8 +63,9 @@ function AddonListItem({
|
|
|
63
63
|
setAddon(addon, initialAddonState.quantity);
|
|
64
64
|
} else {
|
|
65
65
|
removeAddon(addon.id);
|
|
66
|
-
onAddonsValidationChange({ addonId: addon.id, isValid: true });
|
|
67
66
|
}
|
|
67
|
+
|
|
68
|
+
onAddonsValidationChange({ addonId: addon.id, isValid: true });
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
return (
|
|
@@ -102,7 +103,12 @@ function AddonListItem({
|
|
|
102
103
|
FormHelperTextProps={{ sx: { margin: '4px' } }}
|
|
103
104
|
onChange={(event) => handleQuantityChange(event?.target?.value ? Number(event?.target?.value) : null)}
|
|
104
105
|
/>
|
|
105
|
-
<TrashButton
|
|
106
|
+
<TrashButton
|
|
107
|
+
color="error"
|
|
108
|
+
onClick={() => {
|
|
109
|
+
removeAddon(addon.id);
|
|
110
|
+
onAddonsValidationChange({ addonId: addon.id, isValid: true });
|
|
111
|
+
}}>
|
|
106
112
|
<Icon icon="Trash" style={{ display: 'flex' }} />
|
|
107
113
|
</TrashButton>
|
|
108
114
|
</>
|
|
@@ -124,8 +130,7 @@ export function CheckoutAddonsStep() {
|
|
|
124
130
|
const { initialAddons, addons, availableAddons, setAddon, removeAddon } = useAddonsStepModel();
|
|
125
131
|
const [addonsValidation, setAddonsValidation] = useState(
|
|
126
132
|
availableAddons?.reduce<Record<string, boolean>>((acc, curr) => {
|
|
127
|
-
|
|
128
|
-
acc[curr.id] = !!addonState && addonState.quantity > 0;
|
|
133
|
+
acc[curr.id] = true;
|
|
129
134
|
return acc;
|
|
130
135
|
}, {}) || {},
|
|
131
136
|
);
|