@akinon/pz-checkout-gift-pack 2.0.0-beta.7 → 2.0.0-beta.9
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 +8 -0
- package/README.md +6 -3
- package/package.json +1 -1
- package/src/index.tsx +17 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
# @akinon/pz-checkout-gift-package
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
You can use the following command to install the extension with the latest plugins:
|
|
4
6
|
|
|
5
7
|
```bash
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
npx @akinon/projectzero@latest --plugins
|
|
10
|
+
|
|
8
11
|
```
|
|
9
12
|
|
|
10
13
|
### Props
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -126,13 +126,17 @@ export const CheckoutGiftPack = ({
|
|
|
126
126
|
rows={4}
|
|
127
127
|
placeholder={_translations.placeholderInput}
|
|
128
128
|
{...register('message')}
|
|
129
|
+
data-testid="gift-note-input"
|
|
129
130
|
/>
|
|
130
131
|
{errors.message && (
|
|
131
|
-
<span
|
|
132
|
+
<span
|
|
133
|
+
className="text-sm text-[#d72a04] text-[0.875rem]"
|
|
134
|
+
data-testid="error-message"
|
|
135
|
+
>
|
|
132
136
|
{errors.message.message}
|
|
133
137
|
</span>
|
|
134
138
|
)}
|
|
135
|
-
<div className="text-[0.75rem]">
|
|
139
|
+
<div className="text-[0.75rem]" data-testid="characters-length">
|
|
136
140
|
{noteLength} / 160 {_translations.charactersLength}
|
|
137
141
|
</div>
|
|
138
142
|
<div className="flex justify-end items-end gap-2">
|
|
@@ -141,6 +145,7 @@ export const CheckoutGiftPack = ({
|
|
|
141
145
|
appearance="ghost"
|
|
142
146
|
className="text-[0.75rem] underline cursor-pointer border-0 px-0 py-0 h-auto hover:bg-transparent hover:text-[#e95151]"
|
|
143
147
|
onClick={removeGiftNote}
|
|
148
|
+
data-testid="remove-gift-note-button"
|
|
144
149
|
>
|
|
145
150
|
{_translations.removeGiftNoteText}
|
|
146
151
|
</Button>
|
|
@@ -149,6 +154,7 @@ export const CheckoutGiftPack = ({
|
|
|
149
154
|
type="submit"
|
|
150
155
|
className="w-[7rem] h-[1.75rem] font-[0.75rem] uppercase"
|
|
151
156
|
appearance="outlined"
|
|
157
|
+
data-testid="save-gift-pack-button"
|
|
152
158
|
>
|
|
153
159
|
{_translations.save}
|
|
154
160
|
</Button>
|
|
@@ -175,6 +181,7 @@ export const CheckoutGiftPack = ({
|
|
|
175
181
|
appearance="ghost"
|
|
176
182
|
className="cursor-pointer border-0 px-0 py-0 text-[1rem] font-light h-auto hover:bg-transparent hover:text-[#000000]"
|
|
177
183
|
onClick={() => addGiftPack({ note: DEFAULT_NOTE })}
|
|
184
|
+
data-testid="add-gift-pack-button"
|
|
178
185
|
>
|
|
179
186
|
{_translations.addGiftPackText}
|
|
180
187
|
</Button>
|
|
@@ -193,6 +200,7 @@ export const CheckoutGiftPack = ({
|
|
|
193
200
|
await removeGiftPack().unwrap();
|
|
194
201
|
setIsNoteFormOpen(false);
|
|
195
202
|
}}
|
|
203
|
+
data-testid="remove-gift-pack-button"
|
|
196
204
|
>
|
|
197
205
|
{_translations.removeGiftPackText}
|
|
198
206
|
</Button>
|
|
@@ -206,15 +214,20 @@ export const CheckoutGiftPack = ({
|
|
|
206
214
|
)}
|
|
207
215
|
>
|
|
208
216
|
<div className="flex justify-between items-center">
|
|
209
|
-
<span>
|
|
217
|
+
<span data-testid="information-text">
|
|
218
|
+
{_translations.informationText}
|
|
219
|
+
</span>
|
|
210
220
|
<Icon name="giftbox" size={14} className="fill-[#58585a]" />
|
|
211
221
|
</div>
|
|
212
222
|
<div className="flex justify-between items-center gap-8">
|
|
213
|
-
<span
|
|
223
|
+
<span data-testid="saved-gift-note">
|
|
224
|
+
{giftBox?.note !== DEFAULT_NOTE ? giftBox?.note : ''}
|
|
225
|
+
</span>
|
|
214
226
|
<Button
|
|
215
227
|
appearance="ghost"
|
|
216
228
|
className="underline cursor-pointer shrink-0 border-0 px-0 py-0 h-auto hover:bg-transparent hover:text-[#000000]"
|
|
217
229
|
onClick={() => setIsNoteFormOpen(true)}
|
|
230
|
+
data-testid="update-gift-pack-button"
|
|
218
231
|
>
|
|
219
232
|
{_translations.updateNote}
|
|
220
233
|
</Button>
|