sprint-asia-custom-component 0.1.87 → 0.1.89

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sprint-asia-custom-component",
3
3
  "main": "dist/index.js",
4
- "version": "0.1.87",
4
+ "version": "0.1.89",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -14,22 +14,18 @@ import {
14
14
  IoReturnUpForwardSharp,
15
15
  IoAdd,
16
16
  } from "react-icons/io5";
17
- import { PiMicrophone } from "react-icons/pi";
17
+ import { PiMicrophone, PiCopy } from "react-icons/pi";
18
18
  import { MdOutlineLabelImportant } from "react-icons/md";
19
19
  import { PiCamera } from "react-icons/pi";
20
20
  import { BsSticky } from "react-icons/bs";
21
21
  import { BsTelephonePlus } from "react-icons/bs";
22
22
  import BackgroundWA from "../../assets/images/background_whatsapp.png";
23
23
  import PrimaryButton from "../button/primarybutton";
24
+ import VoucherPhoto from "../../assets/images/voucher_photo.jpg";
25
+ import SandezaBills from "../../assets/images/logo_switching_biller_hidden.png";
26
+ import KonnekLogo from "../../assets/images/konnek_logo.png";
24
27
 
25
- const CustomPhone = ({
26
- mode = "Empty",
27
- data,
28
- voucherTitle = "Happy Birthday, Congratulation!",
29
- voucherMessage = "You've won a Voucher Belanja MAP Rp100.000 as a special birthday gift from us. Enjoy your day with extra joy!",
30
- voucherBackgroundType = "color",
31
- voucherBackground,
32
- }) => {
28
+ const CustomPhone = ({ mode = "Empty", data }) => {
33
29
  return (
34
30
  <div
35
31
  style={{ width: "250px", height: "500px", border: "10px solid #000", position: "relative", borderRadius: "25px" }}
@@ -61,7 +57,7 @@ const CustomPhone = ({
61
57
  <div className="h-full w-full bg-white flex justify-center items-center text-center">
62
58
  <div>
63
59
  <div className="flex justify-center">
64
- <img src={LogoEmptyVoucher} className="w-16 h-16 mb-2" />
60
+ <img alt="voucher-img" src={LogoEmptyVoucher} className="w-16 h-16 mb-2" />
65
61
  </div>
66
62
  <div className="w-32">
67
63
  <p className="font-semibold text-xs">Please click voucher!</p>
@@ -77,7 +73,7 @@ const CustomPhone = ({
77
73
  <div className="w-full bg-neutral20 pt-6 px-2 pb-1 flex justify-between items-center">
78
74
  <div className="flex items-center">
79
75
  <IoIosArrowBack className="w-4 h-4 text-info500 mr-1" />
80
- <img src={LogoPrezentHidden} className="rounded-full w-5 h-5 bg-white mx-2 p-0.5" />
76
+ <img alt="prezent-logo" src={LogoPrezentHidden} className="rounded-full w-5 h-5 bg-white mx-2 p-0.5" />
81
77
  <div>
82
78
  <p className="text-xs text-bold">Prezent</p>
83
79
  <p className="text-neutral80" style={{ fontSize: "8px" }}>
@@ -88,7 +84,11 @@ const CustomPhone = ({
88
84
  <BsTelephonePlus className="w-4 h-4 text-info500" />
89
85
  </div>
90
86
  <div className="relative w-full h-screen">
91
- <img src={BackgroundWA} className="absolute top-0 left-0 w-full h-full object-cover" />
87
+ <img
88
+ alt="background-img"
89
+ src={BackgroundWA}
90
+ className="absolute top-0 left-0 w-full h-full object-cover"
91
+ />
92
92
  <div className="relative z-10 px-3 py-2">
93
93
  <div className="flex justify-center">
94
94
  <div className="bg-info50 px-6 rounded w-fit">
@@ -134,59 +134,75 @@ const CustomPhone = ({
134
134
  {mode === "Voucher" && (
135
135
  <div className="h-screen">
136
136
  <div className="overflow-y-auto no-scrollbar" style={{ height: "450px" }}>
137
- {voucherBackgroundType === "color" && (
138
- <div className="w-full h-54 pt-6 pb-4" style={{ background: voucherBackground || "black" }}>
139
- <div className="bg-white rounded-md p-3 mx-3 mt-12">
140
- <p className="font-semibold text-sm">Voucher Belanja MAP</p>
141
- <p className="font-semibold text-sm">Rp 100.000</p>
142
- <p className="font-normal text-neutral100 mt-1 text-xs" style={{ fontSize: "10px" }}>
143
- Order ID: 12345
144
- </p>
145
- <div className="flex justify-between items-center">
146
- <p className="text-xs" style={{ fontSize: "10px" }}>
147
- 21 Jan 2022 - 22 Mar 2023
148
- </p>
149
- <div className="w-12 h-12 rounded-full bg-primary500"></div>
150
- </div>
151
- </div>
137
+ {data?.voucherBackgroundType === "image" ? (
138
+ <div
139
+ className="w-full h-54 pt-6 pb-4 px-4"
140
+ style={{ backgroundImage: `url(${data?.voucherBackground})`, backgroundSize: "cover" }}
141
+ >
142
+ <img alt="voucher-img" src={data?.voucherPhoto || VoucherPhoto} className="rounded-md mt-12" />
152
143
  </div>
153
- )}
154
-
155
- {voucherBackgroundType === "image" && (
144
+ ) : (
156
145
  <div
157
- className="w-full h-54 pt-6 pb-4"
158
- style={{ backgroundImage: `url(${voucherBackground})`, backgroundSize: "cover" }}
146
+ className="w-full h-54 pt-6 pb-4 px-4"
147
+ style={{ background: data?.voucherBackground || "#e5e5e5" }}
159
148
  >
160
- <div className="bg-white rounded-md p-3 mx-3 mt-12">
161
- <p className="font-semibold text-sm">Voucher Belanja MAP</p>
162
- <p className="font-semibold text-sm">Rp 100.000</p>
163
- <p className="font-normal text-neutral100 mt-1 text-xs" style={{ fontSize: "10px" }}>
164
- Order ID: 12345
149
+ <img alt="voucher-img" src={data?.voucherPhoto || VoucherPhoto} className="rounded-md mt-12" />
150
+ </div>
151
+ )}
152
+ <div className="bg-white p-3 flex flex-row gap-1 items-center">
153
+ <img
154
+ alt="client-logo"
155
+ src={data?.clientLogo || SandezaBills}
156
+ className="rounded-md h-9 w-9 object-cover"
157
+ />
158
+ <div>
159
+ <p className="text-xs font-semibold">{data?.productName}</p>
160
+ <div className="flex items-center gap-1">
161
+ <p className="text-neutral300" style={{ fontSize: "10px" }}>
162
+ Order ID : {data?.orderNumber}
165
163
  </p>
166
- <div className="flex justify-between items-center">
167
- <p className="text-xs" style={{ fontSize: "10px" }}>
168
- 21 Jan 2022 - 22 Mar 2023
169
- </p>
170
- <div className="w-12 h-12 rounded-full bg-primary500"></div>
171
- </div>
164
+
165
+ <PiCopy size={14} className="text-neutral300 cursor-pointer" />
172
166
  </div>
167
+ <p className="text-neutral300" style={{ fontSize: "10px" }}>
168
+ Valid until {data?.validDate}
169
+ </p>
173
170
  </div>
174
- )}
175
- <div className="bg-white p-3">
176
- <p className="text-md font-semibold">{voucherTitle}</p>
177
- <p className="text-neutral300" style={{ fontSize: "10px" }}>
178
- {voucherMessage}
179
- </p>
180
171
  </div>
181
- <div className="bg-neutral20 p-3 pb-16">
182
- <p className="text-xs font-semibold">Description</p>
183
- <p className="text-neutral300 mt-2" style={{ fontSize: "10px" }}>
184
- MAP Gift Voucher is the official gift voucher of PT Mitra Adiperkasa Tbk. Accepted in2 retail stores
185
- managed under MAP Group Indonesia, with a wide range of product brands. It is a perfect gift for
186
- Birthdays, Annivesaries, Valentines, Holidays, Festivals
187
- </p>
172
+
173
+ <div className="bg-neutral20 p-3 pb-8 flex flex-col gap-4">
174
+ <div>
175
+ <p className="text-sm font-semibold">{data?.voucherTitle}</p>
176
+ <p className="text-neutral300 mt-1" style={{ fontSize: "10px" }}>
177
+ {data?.voucherMessage}
178
+ </p>
179
+ </div>
180
+
181
+ <div>
182
+ <p className="text-xs font-semibold">Description</p>
183
+ <p className="text-neutral300 mt-1" style={{ fontSize: "10px" }}>
184
+ {data?.voucherDescription}
185
+ </p>
186
+ </div>
187
+
188
+ <div>
189
+ <p className="text-xs font-semibold">How to redeem</p>
190
+ <p className="text-neutral300 mt-1" style={{ fontSize: "10px" }}>
191
+ {data?.howToRedeem}
192
+ </p>
193
+ </div>
194
+
195
+ <div>
196
+ <p className="text-xs font-semibold">Terms & conditions</p>
197
+ <p className="text-neutral300 mt-1" style={{ fontSize: "10px" }}>
198
+ {data?.terms}
199
+ </p>
200
+ </div>
201
+ </div>
202
+
203
+ <div className="w-12 h-12 rounded-full bg-primary50 absolute bottom-0 right-0 mb-12 mr-2 flex justify-center items-center">
204
+ <img alt="konnek-logo" src={KonnekLogo} className="w-6 h-6" />
188
205
  </div>
189
- <div className="w-12 h-12 rounded-full bg-primary500 absolute bottom-0 right-0 mb-12 mr-2"></div>
190
206
  <div className="w-full bg-white absolute bottom-0 p-2 rounded-md-lb rounded-b-xl">
191
207
  <PrimaryButton title="Redeem Voucher" type="full" size="small" />
192
208
  </div>
@@ -217,7 +233,7 @@ const CustomPhone = ({
217
233
  </div>
218
234
  <div className="w-full bg-white pt-2 px-2 flex justify-between items-center">
219
235
  <div className="flex items-center ml-1">
220
- <img src={LogoPrezentHidden} className="rounded-full w-5 h-5 bg-white" />
236
+ <img alt="prezent-logo" src={LogoPrezentHidden} className="rounded-full w-5 h-5 bg-white" />
221
237
  <div className="ml-1">
222
238
  <p className="font-semibold" style={{ fontSize: "10px" }}>
223
239
  Prezent@sprint.id
@@ -271,7 +287,7 @@ const CustomPhone = ({
271
287
  <IoIosArrowBack className="w-5 h-5 text-primary300 mt-2" />
272
288
  <div>
273
289
  <div className="flex justify-center mt-2">
274
- <img src={LogoPrezentHidden} className="rounded-full w-8 h-8 bg-white" />
290
+ <img alt="prezent-logo" src={LogoPrezentHidden} className="rounded-full w-8 h-8 bg-white" />
275
291
  </div>
276
292
  <p className="mb-1" style={{ fontSize: "10px" }}>
277
293
  Prezent
@@ -844,13 +844,20 @@ const Templates = () => {
844
844
  <CustomPhone mode="SMS" data="Ini message" />
845
845
  <CustomPhone mode="Email" data="Ini message" />
846
846
  <CustomPhone
847
+ data={{
848
+ productName: "Voucher MAP 100.000",
849
+ orderNumber: "1234567890",
850
+ validDate: "29 December 2024",
851
+ voucherDescription:
852
+ "MAP Gift Voucher is the official gift voucher of PT Mitra Adiperkasa Tbk. Accepted in2 retail stores managed under MAP Group Indonesia, with a wide range of product brands. It is a perfect gift for Birthdays, Annivesaries, Valentines, Holidays, Festivals",
853
+ // voucherBackgroundType: "color",
854
+ // voucherBackground: "#000000",
855
+ voucherTitle: "One Piece Special Edition!",
856
+ voucherMessage: "This is One Piece special edition card",
857
+ howToRedeem: "This is how to redeem",
858
+ terms: "This is terms and conditions",
859
+ }}
847
860
  mode="Voucher"
848
- voucherBackgroundType="image"
849
- voucherBackground={
850
- "https://static.promediateknologi.id/crop/0x0:0x0/0x0/webp/photo/jawapos/2022/09/one-piece-red.jpeg"
851
- }
852
- voucherTitle="One Piece Special Edition!"
853
- voucherMessage="This is One Piece special edition card"
854
861
  />
855
862
  </div>
856
863