@akinon/pz-basket-gift-pack 1.106.0 → 1.107.0

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.107.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 72bfcbf2: ZERO-3347: Manage save button disable status
8
+
3
9
  ## 1.106.0
4
10
 
5
11
  ## 1.105.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/pz-basket-gift-pack",
3
- "version": "1.106.0",
3
+ "version": "1.107.0",
4
4
  "license": "MIT",
5
5
  "main": "src/index.tsx",
6
6
  "peerDependencies": {
package/src/index.tsx CHANGED
@@ -30,6 +30,7 @@ const defaultTranslations = {
30
30
  charactersLength: 'characters left',
31
31
  removeNote: 'Remove Note',
32
32
  save: 'SAVE',
33
+ saving: 'SAVING...',
33
34
  close: 'Close'
34
35
  };
35
36
 
@@ -80,7 +81,8 @@ export const BasketGiftPack = ({
80
81
  customGiftNoteFormUIRender
81
82
  }: Props) => {
82
83
  const _translations = { ...defaultTranslations, ...translations };
83
- const [addGiftPackage] = useAddGiftPackageMutation();
84
+ const [addGiftPackage, { isLoading: isAddingGiftPackage }] =
85
+ useAddGiftPackageMutation();
84
86
  const [removeGiftPackage] = useRemoveGiftPackageMutation();
85
87
  const [hasGiftPack, setHasGiftPack] = useState(false);
86
88
  const [hasNote, setHasNote] = useState({
@@ -229,8 +231,14 @@ export const BasketGiftPack = ({
229
231
  type="submit"
230
232
  className="w-28 h-7 font-medium uppercase"
231
233
  data-testid="basket-gift-pack-note-save-button"
234
+ disabled={
235
+ isAddingGiftPackage ||
236
+ textAreaCount === 0 ||
237
+ note.trim() === '' ||
238
+ note === defaultMessage
239
+ }
232
240
  >
233
- {_translations.save}
241
+ {isAddingGiftPackage ? _translations.saving : _translations.save}
234
242
  </Button>
235
243
  </div>
236
244
  </div>
@@ -328,4 +336,4 @@ export const BasketGiftPack = ({
328
336
  translations: _translations
329
337
  })
330
338
  : defaultRender();
331
- };
339
+ };