@akinon/pz-basket-gift-pack 1.89.0-rc.10 → 1.89.0-rc.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @akinon/pz-basket-gift-pack
2
2
 
3
+ ## 1.89.0-rc.11
4
+
5
+ ### Minor Changes
6
+
7
+ - 72bfcbf: ZERO-3347: Manage save button disable status
8
+
3
9
  ## 1.89.0-rc.10
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/pz-basket-gift-pack",
3
- "version": "1.89.0-rc.10",
3
+ "version": "1.89.0-rc.11",
4
4
  "license": "MIT",
5
5
  "main": "src/index.tsx",
6
6
  "peerDependencies": {
package/src/index.tsx CHANGED
@@ -60,6 +60,7 @@ export const BasketGiftPack = ({
60
60
  charactersLength: 'characters left',
61
61
  removeNote: 'Remove Note',
62
62
  save: 'SAVE',
63
+ saving: 'SAVING...',
63
64
  close: 'Close'
64
65
  };
65
66
 
@@ -68,7 +69,8 @@ export const BasketGiftPack = ({
68
69
  ...translations
69
70
  };
70
71
 
71
- const [addGiftPackage] = useAddGiftPackageMutation();
72
+ const [addGiftPackage, { isLoading: isAddingGiftPackage }] =
73
+ useAddGiftPackageMutation();
72
74
  const [removeGiftPackage] = useRemoveGiftPackageMutation();
73
75
  const [hasGiftPack, setHasGiftPack] = useState(false);
74
76
  const [hasNote, setHasNote] = useState({
@@ -190,8 +192,14 @@ export const BasketGiftPack = ({
190
192
  type="submit"
191
193
  className="w-28 h-7 font-medium uppercase"
192
194
  data-testid="basket-gift-pack-note-save-button"
195
+ disabled={
196
+ isAddingGiftPackage ||
197
+ textAreaCount === 0 ||
198
+ note.trim() === '' ||
199
+ note === defaultMessage
200
+ }
193
201
  >
194
- {_translations.save}
202
+ {isAddingGiftPackage ? _translations.saving : _translations.save}
195
203
  </Button>
196
204
  </div>
197
205
  </div>