@lmnto/h-mall-shared 1.0.1

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.
Files changed (262) hide show
  1. package/app.css +457 -0
  2. package/bitbucket-pipelines.yml +223 -0
  3. package/package.json +43 -0
  4. package/public/gif/balloon.gif +0 -0
  5. package/public/gif/gift.gif +0 -0
  6. package/public/img/ai-dialog.png +0 -0
  7. package/public/img/ai-x1-banner.png +0 -0
  8. package/public/img/ai-x1.png +0 -0
  9. package/public/img/alert-Icon.png +0 -0
  10. package/public/img/aleta-payment-kyc-require.png +0 -0
  11. package/public/img/aleta-payment-pending.png +0 -0
  12. package/public/img/aleta-payment-rejected.png +0 -0
  13. package/public/img/aleta-payment-subscription-required.png +0 -0
  14. package/public/img/boost-banner-bg.png +0 -0
  15. package/public/img/boost-banner-right.png +0 -0
  16. package/public/img/boost-banner.png +0 -0
  17. package/public/img/boost-dialog-bg.png +0 -0
  18. package/public/img/boostPower.png +0 -0
  19. package/public/img/boostTooltip.png +0 -0
  20. package/public/img/brand-icon.svg +23 -0
  21. package/public/img/brand-text.svg +11 -0
  22. package/public/img/card-icon.png +0 -0
  23. package/public/img/cashback-Icon.png +0 -0
  24. package/public/img/crown.svg +9 -0
  25. package/public/img/empty-box.png +0 -0
  26. package/public/img/gen3-dialog.png +0 -0
  27. package/public/img/gen3-home-banner-bg.png +0 -0
  28. package/public/img/gen3-image.png +0 -0
  29. package/public/img/gift.png +0 -0
  30. package/public/img/img-placeholder-illustration.svg +6 -0
  31. package/public/img/logo.svg +31 -0
  32. package/public/img/offerBanner.png +0 -0
  33. package/public/img/pagenotfound.png +0 -0
  34. package/public/img/partial-pay-payment-successful.png +0 -0
  35. package/public/img/phoneShippingBG.png +0 -0
  36. package/public/img/placeholder-image.jpg +0 -0
  37. package/public/img/powerIcon.png +0 -0
  38. package/public/img/product-01.png +0 -0
  39. package/public/img/product-02.jpg +0 -0
  40. package/public/img/product-03.jpg +0 -0
  41. package/public/img/product-04.jpg +0 -0
  42. package/public/img/product-05.png +0 -0
  43. package/public/img/product-06.png +0 -0
  44. package/public/img/profile-avatar.svg +12 -0
  45. package/public/img/promotion-icon.png +0 -0
  46. package/public/img/session-expired.png +0 -0
  47. package/public/img/shipping-alert-icon.png +0 -0
  48. package/public/img/shippingIcon.png +0 -0
  49. package/public/img/smart-pay-banner-how.png +0 -0
  50. package/public/img/smart-pay-banner-own.png +0 -0
  51. package/public/img/smart-pay-chose.png +0 -0
  52. package/public/img/smart-pay-easy.png +0 -0
  53. package/public/img/smart-pay-payment.png +0 -0
  54. package/public/img/smart-plan-fire.gif +0 -0
  55. package/public/img/smart-plan-sparkle.gif +0 -0
  56. package/public/img/special.png +0 -0
  57. package/public/img/specialOfferBg.png +0 -0
  58. package/public/img/stop-shipping-banner.png +0 -0
  59. package/public/img/subscriptionBanner.png +0 -0
  60. package/public/img/subscriptionIcon.png +0 -0
  61. package/public/img/successIcon.png +0 -0
  62. package/public/img/wallet-icon.png +0 -0
  63. package/public/img/world-wide-shipping.png +0 -0
  64. package/public/next.svg +1 -0
  65. package/public/vercel.svg +1 -0
  66. package/shared/components/AddressFormComponent.tsx +215 -0
  67. package/shared/components/AddressShippingFormComponent.tsx +223 -0
  68. package/shared/components/AiPaymentDialog.tsx +95 -0
  69. package/shared/components/AppLoadingComponent.tsx +15 -0
  70. package/shared/components/AppLoadingComponentV2.tsx +18 -0
  71. package/shared/components/Button.tsx +48 -0
  72. package/shared/components/BuySubscriptionDialog.tsx +75 -0
  73. package/shared/components/CartDrawerComponent.tsx +324 -0
  74. package/shared/components/CashbackComponent.tsx +48 -0
  75. package/shared/components/CashbackMigrationComponent.tsx +41 -0
  76. package/shared/components/CommissionNonEligibleComponent.tsx +27 -0
  77. package/shared/components/CustomNextImage.tsx +50 -0
  78. package/shared/components/CustomNextLink.tsx +46 -0
  79. package/shared/components/EditAddressFormComponent.tsx +254 -0
  80. package/shared/components/EmptyCartMessageComponent.tsx +25 -0
  81. package/shared/components/EmptyCartMessageForCartPage.tsx +61 -0
  82. package/shared/components/EmptyLegacyOrderMessageForOrdersPage.tsx +52 -0
  83. package/shared/components/EmptyOrderMessageForOrdersPage.tsx +62 -0
  84. package/shared/components/EmptyOrderMessageForShippingOrdersPage.tsx +62 -0
  85. package/shared/components/Footer.tsx +71 -0
  86. package/shared/components/GreetingDialog.tsx +96 -0
  87. package/shared/components/Header.tsx +106 -0
  88. package/shared/components/HoldShippingDialog.tsx +165 -0
  89. package/shared/components/HomeBanners.tsx +298 -0
  90. package/shared/components/InactiveCartDialog.tsx +69 -0
  91. package/shared/components/InputCartQuantity.tsx +342 -0
  92. package/shared/components/Inputfield.tsx +110 -0
  93. package/shared/components/ListItemComponent.tsx +82 -0
  94. package/shared/components/LoadingIconComponent.tsx +284 -0
  95. package/shared/components/OrderNotFoundComponent.tsx +56 -0
  96. package/shared/components/PageHeader.tsx +42 -0
  97. package/shared/components/PhoneNumberCountries.tsx +133 -0
  98. package/shared/components/PhoneShippingDialog.tsx +77 -0
  99. package/shared/components/PickupDialog.tsx +92 -0
  100. package/shared/components/ProductNotFoundComponent.tsx +56 -0
  101. package/shared/components/ProductPriceComponent.tsx +32 -0
  102. package/shared/components/ProfileMenu.tsx +120 -0
  103. package/shared/components/RequestCreditNoteInvoiceDialog.tsx +214 -0
  104. package/shared/components/RequestInvoiceDialog.tsx +194 -0
  105. package/shared/components/SelectCities.tsx +133 -0
  106. package/shared/components/SelectComponent.tsx +334 -0
  107. package/shared/components/SelectCountries.tsx +179 -0
  108. package/shared/components/SelectPickUpStore.tsx +131 -0
  109. package/shared/components/SelectStates.tsx +144 -0
  110. package/shared/components/ServerTime.tsx +68 -0
  111. package/shared/components/SessionDialogComponent.tsx +60 -0
  112. package/shared/components/ShippingAddressFormDialogComponent.tsx +51 -0
  113. package/shared/components/Sidebar.tsx +281 -0
  114. package/shared/components/SpecialOfferDialog.tsx +193 -0
  115. package/shared/components/StatusComponents.tsx +25 -0
  116. package/shared/components/StepperComponent.tsx +79 -0
  117. package/shared/components/StepperSmartPayComponent.tsx +97 -0
  118. package/shared/components/SubscriptionPurchaseDialogComponent.tsx +81 -0
  119. package/shared/components/TableComponent.tsx +144 -0
  120. package/shared/components/TablePaginationComponent.tsx +151 -0
  121. package/shared/components/aleta/AletaManagerComponent.tsx +52 -0
  122. package/shared/components/aleta/KycPendingStatus.tsx +33 -0
  123. package/shared/components/aleta/KycRejectedStatus.tsx +53 -0
  124. package/shared/components/aleta/KycRequiredStatus.tsx +53 -0
  125. package/shared/components/aleta/SubscriptionRequiredStatus.tsx +45 -0
  126. package/shared/components/icons/AletaWalletIcon.tsx +21 -0
  127. package/shared/components/icons/BrandIcon.tsx +97 -0
  128. package/shared/components/icons/BrandText.tsx +47 -0
  129. package/shared/components/icons/CartIcon.tsx +21 -0
  130. package/shared/components/icons/DoneIcon.tsx +27 -0
  131. package/shared/components/icons/HomnifiIcon.tsx +23 -0
  132. package/shared/components/icons/InfoIcon.tsx +16 -0
  133. package/shared/components/icons/SmartPayProductIcon.tsx +31 -0
  134. package/shared/components/payments/DisclaimerAlertDialog.tsx +205 -0
  135. package/shared/components/payments/EmptyAssets.tsx +23 -0
  136. package/shared/components/payments/PaybyWalletItemComponent.tsx +116 -0
  137. package/shared/components/payments/PaymentAssetItemComponent.tsx +101 -0
  138. package/shared/components/payments/RequestProcessingDialog.tsx +123 -0
  139. package/shared/components/payments/WalletSectionManager.tsx +82 -0
  140. package/shared/components/payments/WalletSliderComponent.tsx +326 -0
  141. package/shared/components/payments/WalletTermsAndConditionComponent.tsx +88 -0
  142. package/shared/constants/address-shipping.schema.ts +56 -0
  143. package/shared/constants/address.schema.ts +56 -0
  144. package/shared/constants/app.ts +323 -0
  145. package/shared/constants/environment.ts +23 -0
  146. package/shared/constants/feature-flags.ts +15 -0
  147. package/shared/constants/query-keys.ts +106 -0
  148. package/shared/constants/routes.ts +41 -0
  149. package/shared/constants/socket.ts +15 -0
  150. package/shared/contexts/HomeProductsContext.tsx +51 -0
  151. package/shared/contexts/MainWrapperContext.tsx +289 -0
  152. package/shared/contexts/WebSocketContext.tsx +155 -0
  153. package/shared/hooks/useAddressForm.ts +169 -0
  154. package/shared/hooks/useAddresses.ts +28 -0
  155. package/shared/hooks/useAppForm.ts +39 -0
  156. package/shared/hooks/useCart.ts +207 -0
  157. package/shared/hooks/useCopy.ts +45 -0
  158. package/shared/hooks/useCountries.ts +27 -0
  159. package/shared/hooks/useCustomRouter.ts +51 -0
  160. package/shared/hooks/useDebounce.ts +21 -0
  161. package/shared/hooks/useInvoice.ts +41 -0
  162. package/shared/hooks/useOnlineUser.ts +38 -0
  163. package/shared/hooks/usePayments.ts +101 -0
  164. package/shared/hooks/useShippingAddressForm.ts +70 -0
  165. package/shared/hooks/useShippingAddresses.ts +33 -0
  166. package/shared/hooks/useStores.ts +29 -0
  167. package/shared/hooks/useUserActivity.ts +43 -0
  168. package/shared/i18n/client.ts +27 -0
  169. package/shared/i18n/locales/en.ts +383 -0
  170. package/shared/i18n/locales/it.ts +373 -0
  171. package/shared/i18n/server.ts +7 -0
  172. package/shared/services/addresses.service.ts +27 -0
  173. package/shared/services/api/core/ApiError.ts +29 -0
  174. package/shared/services/api/core/ApiRequestOptions.ts +25 -0
  175. package/shared/services/api/core/ApiResult.ts +11 -0
  176. package/shared/services/api/core/CancelablePromise.ts +130 -0
  177. package/shared/services/api/core/OpenAPI.ts +37 -0
  178. package/shared/services/api/core/request.ts +376 -0
  179. package/shared/services/api/index.ts +64 -0
  180. package/shared/services/api/models/AddAllProductToShippingCartDto.ts +7 -0
  181. package/shared/services/api/models/AddProductToCartDto.ts +8 -0
  182. package/shared/services/api/models/AddProductToShippingCartDto.ts +8 -0
  183. package/shared/services/api/models/AdminPlaceOrderDto.ts +16 -0
  184. package/shared/services/api/models/AssignPickupSerialNumberDto.ts +10 -0
  185. package/shared/services/api/models/CreateUserAddressDto.ts +19 -0
  186. package/shared/services/api/models/DeletCartProductsArrayDto.ts +7 -0
  187. package/shared/services/api/models/GenerateInvoiceDto.ts +7 -0
  188. package/shared/services/api/models/OrderConfirmationEmailDto.ts +8 -0
  189. package/shared/services/api/models/PlaceOrderDto.ts +9 -0
  190. package/shared/services/api/models/PlaceShipmentOrderDto.ts +8 -0
  191. package/shared/services/api/models/ProductBoostDto.ts +18 -0
  192. package/shared/services/api/models/RemoveAssignedSerialNumberDto.ts +9 -0
  193. package/shared/services/api/models/RemoveProductToCartDto.ts +8 -0
  194. package/shared/services/api/models/ShipmentItem.ts +8 -0
  195. package/shared/services/api/models/ShippingCartUpdateBillingAddressesDto.ts +7 -0
  196. package/shared/services/api/models/ShippingCartUpdateShippingMethodDto.ts +7 -0
  197. package/shared/services/api/models/UnfreezeWalletDto.ts +8 -0
  198. package/shared/services/api/models/UpdateCartBillingAddressesDto.ts +7 -0
  199. package/shared/services/api/models/UpdateCartPaymentMethodDto.ts +9 -0
  200. package/shared/services/api/models/UpdateCartShippingMethodDto.ts +7 -0
  201. package/shared/services/api/models/UpdateCartStoreDto.ts +7 -0
  202. package/shared/services/api/models/UpdateProductDto.ts +11 -0
  203. package/shared/services/api/models/UpdateShipmentItemStatusDto.ts +24 -0
  204. package/shared/services/api/models/UpdateShippingCartPaymentMethodDto.ts +9 -0
  205. package/shared/services/api/models/UpdateUserAddressDto.ts +19 -0
  206. package/shared/services/api/models/ValidateAuthCodeDto.ts +8 -0
  207. package/shared/services/api/models/WithdrawOrderWalletDto.ts +8 -0
  208. package/shared/services/api/services/AddressesService.ts +160 -0
  209. package/shared/services/api/services/AdminsDevicesService.ts +28 -0
  210. package/shared/services/api/services/AdminsOrdersService.ts +117 -0
  211. package/shared/services/api/services/AdminsPickupsService.ts +57 -0
  212. package/shared/services/api/services/AdminsProductsService.ts +86 -0
  213. package/shared/services/api/services/CartsService.ts +190 -0
  214. package/shared/services/api/services/CashBackQueueService.ts +39 -0
  215. package/shared/services/api/services/CategoriesService.ts +65 -0
  216. package/shared/services/api/services/DefaultService.ts +19 -0
  217. package/shared/services/api/services/FeaturesFlagsService.ts +20 -0
  218. package/shared/services/api/services/IossQueueService.ts +39 -0
  219. package/shared/services/api/services/OrderCallbackService.ts +67 -0
  220. package/shared/services/api/services/OrderEmailsService.ts +40 -0
  221. package/shared/services/api/services/OrderImportService.ts +228 -0
  222. package/shared/services/api/services/OrdersService.ts +183 -0
  223. package/shared/services/api/services/PaymentGatewayService.ts +19 -0
  224. package/shared/services/api/services/PaymentsService.ts +88 -0
  225. package/shared/services/api/services/ProductsService.ts +67 -0
  226. package/shared/services/api/services/ShipmentOrderCallbackService.ts +67 -0
  227. package/shared/services/api/services/ShipmentOrdersService.ts +88 -0
  228. package/shared/services/api/services/ShipmentsService.ts +30 -0
  229. package/shared/services/api/services/ShippingCartService.ts +247 -0
  230. package/shared/services/api/services/ShippingMethodsService.ts +20 -0
  231. package/shared/services/api/services/StoresService.ts +25 -0
  232. package/shared/services/api/services/SyncServiceQueueService.ts +39 -0
  233. package/shared/services/api/services/UpgradeOrdersService.ts +26 -0
  234. package/shared/services/api/services/UsersAuthService.ts +45 -0
  235. package/shared/services/api/services/UsersService.ts +53 -0
  236. package/shared/services/api/services/XeraQueueService.ts +39 -0
  237. package/shared/services/index.ts +0 -0
  238. package/shared/services/payment-method.service.ts +29 -0
  239. package/shared/stores/cartStore.ts +108 -0
  240. package/shared/stores/countriesStore.ts +62 -0
  241. package/shared/stores/formStore.ts +19 -0
  242. package/shared/stores/loadingStore.ts +12 -0
  243. package/shared/stores/userStore.ts +32 -0
  244. package/shared/types/SelectComponent.types.ts +31 -0
  245. package/shared/types/addressForm.ts +27 -0
  246. package/shared/types/cart.ts +208 -0
  247. package/shared/types/category.ts +6 -0
  248. package/shared/types/creditNote.ts +0 -0
  249. package/shared/types/feature-flags.ts +5 -0
  250. package/shared/types/icon.ts +5 -0
  251. package/shared/types/index.d.ts +84 -0
  252. package/shared/types/order.ts +332 -0
  253. package/shared/types/pagination.ts +5 -0
  254. package/shared/types/payments.ts +68 -0
  255. package/shared/types/product.ts +54 -0
  256. package/shared/types/shoppingCart.ts +219 -0
  257. package/shared/types/upgradeCart.ts +226 -0
  258. package/shared/types/user.ts +36 -0
  259. package/shared/utils/app.util.ts +261 -0
  260. package/shared/utils/notifications.util.ts +39 -0
  261. package/shared/utils/user-session.util.ts +171 -0
  262. package/tailwind.config.ts +234 -0
@@ -0,0 +1,254 @@
1
+ import { FormEventHandler, useCallback, useEffect, useState } from "react";
2
+ import { UseFormReturn } from "react-hook-form";
3
+
4
+ import ButtonCustom from "../components/Button";
5
+ import Inputfield from "../components/Inputfield";
6
+ import { PhoneNumberCountries } from "../components/PhoneNumberCountries";
7
+ import { SelectCountries } from "../components/SelectCountries";
8
+ import { useAddressForm } from "../hooks/useAddressForm";
9
+ import { _useScopedI18n } from "../i18n/client";
10
+ import { countriesStore } from "../stores/countriesStore";
11
+ import { useFormStore } from "../stores/formStore";
12
+ import { UserAddress } from "../types/cart";
13
+ import { SelectCities } from "./SelectCities";
14
+ import { SelectStates } from "./SelectStates";
15
+
16
+ export type EditAddressFormComponentProps = {
17
+ formId: string;
18
+ isLoading: boolean;
19
+ forShipping?: boolean;
20
+ proceedSubmit: FormEventHandler<HTMLButtonElement>;
21
+ selectedAddress?: UserAddress[];
22
+ onCancel?: () => void;
23
+ };
24
+
25
+ export default function EditAddressFormComponent({
26
+ formId,
27
+ isLoading,
28
+ proceedSubmit,
29
+ selectedAddress,
30
+ forShipping = false,
31
+ }: EditAddressFormComponentProps) {
32
+ const scopeT = _useScopedI18n("sharedComponents.addressFormComponent");
33
+
34
+ const [fieldValue, setFieldValue] = useState(selectedAddress || {});
35
+
36
+ const { reactHookUseForm } = useFormStore();
37
+ const { watch } =
38
+ (reactHookUseForm as { [key: string]: UseFormReturn<any> })?.[formId] ?? {};
39
+ const countryIdField = watch?.(`countryId`);
40
+ const zipCodeExampleField = watch?.(`zipCodeExample`);
41
+
42
+ const {
43
+ states,
44
+ cities,
45
+ loading,
46
+ loadingCities,
47
+ setLoading,
48
+ setLoadingCities,
49
+ } = countriesStore();
50
+
51
+ const { getStatesByCountry, getCityByStateAndCountry } = useAddressForm();
52
+
53
+ const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
54
+ const { name, value } = e.target;
55
+ setFieldValue((prevValue) => ({
56
+ ...prevValue,
57
+ [name]: value, // Dynamically update the field based on its name
58
+ }));
59
+ };
60
+
61
+ // const { countries } = countriesStore();
62
+ // const selectedCountry = countries.find((country) => country.id === countryIdField);
63
+
64
+ const handleGetCities = useCallback(
65
+ (state: any) => {
66
+ setLoadingCities(true);
67
+ getCityByStateAndCountry.mutate(state);
68
+ },
69
+ // eslint-disable-next-line react-hooks/exhaustive-deps
70
+ [],
71
+ );
72
+
73
+ const handleGetState = useCallback(
74
+ async (country: number) => {
75
+ setFieldValue((prevValue) => ({
76
+ ...prevValue,
77
+ city: null,
78
+ state: null,
79
+ }));
80
+ setLoading(true);
81
+ setLoadingCities(true);
82
+
83
+ const data = await getStatesByCountry.mutateAsync(country);
84
+ if (data && data?.length > 0) {
85
+ setLoadingCities(false);
86
+ } else {
87
+ handleGetCities({
88
+ countryId: country,
89
+ });
90
+ }
91
+ },
92
+ [setLoading, setLoadingCities, handleGetCities, getStatesByCountry],
93
+ );
94
+
95
+ const handleStateFromTheOldAddress = useCallback(
96
+ async () => {
97
+ await handleGetState(fieldValue?.["country"]?.id);
98
+ setLoadingCities(true);
99
+ await getCityByStateAndCountry.mutateAsync({
100
+ countryId: fieldValue?.["country"]?.id,
101
+ stateId: states?.find((item) => item?.name === fieldValue?.["state"])
102
+ ?.id,
103
+ });
104
+ setLoadingCities(false);
105
+ },
106
+ // eslint-disable-next-line react-hooks/exhaustive-deps
107
+ [],
108
+ );
109
+
110
+ useEffect(() => {
111
+ handleStateFromTheOldAddress();
112
+ // eslint-disable-next-line react-hooks/exhaustive-deps
113
+ }, []);
114
+
115
+ return (
116
+ <>
117
+ <form action="" method="post">
118
+ <div className="grid grid-cols-12 gap-y-4 md:gap-y-4 md:gap-x-4 mb-5">
119
+ <div className="col-span-12 md:col-span-6 relative">
120
+ <Inputfield
121
+ title={`${scopeT("firstName")} *`}
122
+ placeholder={scopeT("firstName")}
123
+ name="firstName"
124
+ formId={formId}
125
+ value={fieldValue["firstName"] || ""}
126
+ onChange={handleChange}
127
+ />
128
+ </div>
129
+ <div className="col-span-12 md:col-span-6 relative">
130
+ <Inputfield
131
+ title={`${scopeT("lastName")} *`}
132
+ placeholder={scopeT("lastName")}
133
+ name="lastName"
134
+ formId={formId}
135
+ value={fieldValue["lastName"] || ""}
136
+ onChange={handleChange}
137
+ />
138
+ </div>
139
+ <div className="col-span-12 relative">
140
+ <Inputfield
141
+ title={`${scopeT("address")} *`}
142
+ placeholder={scopeT("address")}
143
+ name="address"
144
+ formId={formId}
145
+ value={fieldValue["address"] || ""}
146
+ onChange={handleChange}
147
+ />
148
+ </div>
149
+ <div className="col-span-12 relative">
150
+ <Inputfield
151
+ title={`${scopeT("flatHouseBuilding")}`}
152
+ placeholder={`${scopeT("flatHouseBuilding")}`}
153
+ name="buildingInfo"
154
+ formId={formId}
155
+ value={fieldValue["buildingInfo"] || ""}
156
+ onChange={handleChange}
157
+ />
158
+ </div>
159
+ <div className="col-span-12 md:col-span-6 relative">
160
+ <SelectCountries
161
+ title={`${scopeT("selectCountry")} *`}
162
+ placeholder={scopeT("selectCountry")}
163
+ name="countryId"
164
+ formId={formId}
165
+ onCountrySelected={handleGetState}
166
+ className={undefined}
167
+ forShipping={forShipping}
168
+ />
169
+ </div>
170
+ <div className="col-span-12 md:col-span-6 relative">
171
+ {states?.length > 0 && countryIdField ? (
172
+ <SelectStates
173
+ title={`${scopeT("state")} *`}
174
+ className={undefined}
175
+ placeholder={scopeT("state")}
176
+ name="state"
177
+ formId={formId}
178
+ onStateSelected={handleGetCities}
179
+ />
180
+ ) : (
181
+ <Inputfield
182
+ title={`${scopeT("state")} *`}
183
+ className={undefined}
184
+ placeholder={scopeT("state")}
185
+ name="state"
186
+ formId={formId}
187
+ disabled={loading}
188
+ value={fieldValue["state"] || ""}
189
+ onChange={handleChange}
190
+ />
191
+ )}
192
+ </div>
193
+ <div className="col-span-12 md:col-span-6 relative">
194
+ {cities?.length > 0 && countryIdField ? (
195
+ <SelectCities
196
+ title={`${scopeT("city")} *`}
197
+ className={undefined}
198
+ placeholder={scopeT("city")}
199
+ name="city"
200
+ formId={formId}
201
+ />
202
+ ) : (
203
+ <Inputfield
204
+ title={`${scopeT("city")} *`}
205
+ className={undefined}
206
+ placeholder={scopeT("city")}
207
+ name="city"
208
+ formId={formId}
209
+ disabled={loadingCities}
210
+ value={fieldValue["city"] || ""}
211
+ onChange={handleChange}
212
+ />
213
+ )}
214
+ </div>
215
+ <div className="col-span-12 md:col-span-6 relative">
216
+ <Inputfield
217
+ title={`${scopeT("zipCode")} *`}
218
+ className={undefined}
219
+ name="postalCode"
220
+ formId={formId}
221
+ placeholder={
222
+ zipCodeExampleField && zipCodeExampleField.length > 0
223
+ ? zipCodeExampleField
224
+ : scopeT("zipCode")
225
+ }
226
+ format={
227
+ zipCodeExampleField && zipCodeExampleField.length > 0
228
+ ? zipCodeExampleField
229
+ : ""
230
+ }
231
+ value={fieldValue["postalCode"] || ""}
232
+ onChange={handleChange}
233
+ />
234
+ </div>
235
+ <div className="col-span-12 relative">
236
+ <PhoneNumberCountries formId={formId} fieldName="countryCode" />
237
+ </div>
238
+ </div>
239
+ <div className="flex gap-3 justify-end w-full">
240
+ <ButtonCustom
241
+ className="!text-sm !px-5 !py-3"
242
+ icon={undefined}
243
+ type="submit"
244
+ onClick={proceedSubmit}
245
+ loading={isLoading}
246
+ disabled={isLoading}
247
+ >
248
+ {scopeT("updateBtn")}
249
+ </ButtonCustom>
250
+ </div>
251
+ </form>
252
+ </>
253
+ );
254
+ }
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ import { Typography } from "@material-tailwind/react";
4
+ import Image from "next/image";
5
+
6
+ import emptyBox from "../../public/img/empty-box.png";
7
+ import { _useScopedI18n } from "../i18n/client";
8
+
9
+ export default function EmptyCartMessageComponent() {
10
+ const scopeT = _useScopedI18n("sharedComponents.emptyCartMessageComponent");
11
+
12
+ return (
13
+ <>
14
+ <div className="flex items-center justify-center flex-col w-full h-full">
15
+ <Image src={emptyBox.src} alt="emptyBox" width={100} height={100} />
16
+ <Typography
17
+ variant="h6"
18
+ className="text-base font-medium text-slate-400"
19
+ >
20
+ {scopeT("title")}
21
+ </Typography>
22
+ </div>
23
+ </>
24
+ );
25
+ }
@@ -0,0 +1,61 @@
1
+ "use client";
2
+
3
+ import { Typography } from "@material-tailwind/react";
4
+ import Image from "next/image";
5
+
6
+ import emptyBox from "../../public/img/empty-box.png";
7
+ import { ROUTES } from "../constants/routes";
8
+ import useCustomRouter from "../hooks/useCustomRouter";
9
+ import { _useScopedI18n } from "../i18n/client";
10
+ import ButtonCustom from "./Button";
11
+
12
+ export default function EmptyCartMessageForCartPage() {
13
+ const scopeT = _useScopedI18n("sharedComponents.emptyCartMessageForCartPage");
14
+
15
+ const { push } = useCustomRouter();
16
+
17
+ return (
18
+ <>
19
+ <div className="px-3 md:px-5 mr-1 flex cartAutoHeight">
20
+ <div className="">
21
+ <ul className="flex flex-col gap-y-6">{}</ul>
22
+ </div>
23
+ <div className="flex items-center justify-center flex-col w-full">
24
+ <Image
25
+ src={emptyBox.src}
26
+ alt="emptyBox"
27
+ width={100}
28
+ height={100}
29
+ className="mb-5"
30
+ />
31
+ <Typography
32
+ variant="h6"
33
+ className="text-center md:text-lg font-semibold text-black-500 mb-5"
34
+ >
35
+ {scopeT("title")}
36
+ </Typography>
37
+ <Typography
38
+ variant="h6"
39
+ className="text-center font-medium text-slate-400"
40
+ >
41
+ {scopeT("subTitle")}
42
+ </Typography>
43
+ <Typography
44
+ variant="h6"
45
+ className="text-center font-medium text-slate-400"
46
+ >
47
+ {scopeT("message")}
48
+ </Typography>
49
+
50
+ <ButtonCustom
51
+ onClick={() => push(ROUTES.dashboard.products)}
52
+ className="font-normal mt-7"
53
+ icon={undefined}
54
+ >
55
+ {scopeT("redirectBtn")}
56
+ </ButtonCustom>
57
+ </div>
58
+ </div>
59
+ </>
60
+ );
61
+ }
@@ -0,0 +1,52 @@
1
+ "use client";
2
+
3
+ import { Typography } from "@material-tailwind/react";
4
+ import Image from "next/image";
5
+
6
+ import emptyBox from "../../public/img/empty-box.png";
7
+ import { _useScopedI18n } from "../i18n/client";
8
+
9
+ export default function EmptyLegacyOrderMessageForOrdersPage() {
10
+ const scopeT = _useScopedI18n(
11
+ "sharedComponents.emptyLegacyOrderMessageForOrdersPage",
12
+ );
13
+
14
+ return (
15
+ <>
16
+ <div className="px-3 md:px-5 mr-1 flex cartAutoHeight">
17
+ <div className="">
18
+ <ul className="flex flex-col gap-y-6">{}</ul>
19
+ </div>
20
+ <div className="flex items-center justify-center flex-col w-full">
21
+ <Image
22
+ src={emptyBox.src}
23
+ alt="emptyBox"
24
+ width={100}
25
+ height={100}
26
+ className="mb-5"
27
+ />
28
+ <Typography
29
+ variant="h6"
30
+ className="text-center md:text-lg font-semibold text-black-500 mb-5"
31
+ >
32
+ {scopeT("title")}
33
+ </Typography>
34
+ {/* <Typography
35
+ variant="h6"
36
+ className="text-center font-medium text-slate-400"
37
+ >
38
+ {scopeT('subTitle')}
39
+ <Link
40
+ href="https://kmall.io/auth"
41
+ target="_blank"
42
+ className="font-bold"
43
+ >
44
+ {scopeT('linkText')}
45
+ </Link>
46
+ {scopeT('message')}
47
+ </Typography> */}
48
+ </div>
49
+ </div>
50
+ </>
51
+ );
52
+ }
@@ -0,0 +1,62 @@
1
+ "use client";
2
+
3
+ import { Typography } from "@material-tailwind/react";
4
+ import Image from "next/image";
5
+
6
+ import emptyBox from "../../public/img/empty-box.png";
7
+ import { ROUTES } from "../constants/routes";
8
+ import useCustomRouter from "../hooks/useCustomRouter";
9
+ import { _useScopedI18n } from "../i18n/client";
10
+ import ButtonCustom from "./Button";
11
+
12
+ export default function EmptyOrderMessageForOrdersPage() {
13
+ const scopeT = _useScopedI18n(
14
+ "sharedComponents.emptyOrderMessageForOrdersPage",
15
+ );
16
+ const { push } = useCustomRouter();
17
+
18
+ return (
19
+ <>
20
+ <div className="px-3 md:px-5 mr-1 flex cartAutoHeight">
21
+ <div className="">
22
+ <ul className="flex flex-col gap-y-6">{}</ul>
23
+ </div>
24
+ <div className="flex items-center justify-center flex-col w-full">
25
+ <Image
26
+ src={emptyBox.src}
27
+ alt="emptyBox"
28
+ width={100}
29
+ height={100}
30
+ className="mb-5"
31
+ />
32
+ <Typography
33
+ variant="h6"
34
+ className="text-center md:text-lg font-semibold text-black-500 mb-5"
35
+ >
36
+ {scopeT("title")}
37
+ </Typography>
38
+ <Typography
39
+ variant="h6"
40
+ className="text-center font-medium text-slate-400"
41
+ >
42
+ {scopeT("subTitle")}
43
+ </Typography>
44
+ <Typography
45
+ variant="h6"
46
+ className="text-center font-medium text-slate-400"
47
+ >
48
+ {scopeT("message")}
49
+ </Typography>
50
+
51
+ <ButtonCustom
52
+ onClick={() => push(ROUTES.dashboard.products)}
53
+ className="font-normal mt-7"
54
+ icon={undefined}
55
+ >
56
+ {scopeT("redirectBtn")}
57
+ </ButtonCustom>
58
+ </div>
59
+ </div>
60
+ </>
61
+ );
62
+ }
@@ -0,0 +1,62 @@
1
+ "use client";
2
+
3
+ import { Typography } from "@material-tailwind/react";
4
+ import Image from "next/image";
5
+
6
+ import emptyBox from "../../public/img/empty-box.png";
7
+ import { ROUTES } from "../constants/routes";
8
+ import useCustomRouter from "../hooks/useCustomRouter";
9
+ import { _useScopedI18n } from "../i18n/client";
10
+ import ButtonCustom from "./Button";
11
+
12
+ export default function EmptyOrderMessageForShippingOrdersPage() {
13
+ const scopeT = _useScopedI18n(
14
+ "sharedComponents.emptyOrderMessageForShippingOrdersPage",
15
+ );
16
+ const { push } = useCustomRouter();
17
+
18
+ return (
19
+ <>
20
+ <div className="px-3 md:px-5 mr-1 flex cartAutoHeight">
21
+ <div className="">
22
+ <ul className="flex flex-col gap-y-6">{}</ul>
23
+ </div>
24
+ <div className="flex items-center justify-center flex-col w-full">
25
+ <Image
26
+ src={emptyBox.src}
27
+ alt="emptyBox"
28
+ width={100}
29
+ height={100}
30
+ className="mb-5"
31
+ />
32
+ <Typography
33
+ variant="h6"
34
+ className="text-center md:text-lg font-semibold text-black-500 mb-5"
35
+ >
36
+ {scopeT("title")}
37
+ </Typography>
38
+ <Typography
39
+ variant="h6"
40
+ className="text-center font-medium text-slate-400"
41
+ >
42
+ {scopeT("subTitle")}
43
+ </Typography>
44
+ <Typography
45
+ variant="h6"
46
+ className="text-center font-medium text-slate-400"
47
+ >
48
+ {scopeT("message")}
49
+ </Typography>
50
+
51
+ <ButtonCustom
52
+ onClick={() => push(ROUTES.dashboard.orders)}
53
+ className="font-normal mt-7"
54
+ icon={undefined}
55
+ >
56
+ {scopeT("redirectBtn")}
57
+ </ButtonCustom>
58
+ </div>
59
+ </div>
60
+ </>
61
+ );
62
+ }
@@ -0,0 +1,71 @@
1
+ "use client";
2
+
3
+ import { Typography } from "@material-tailwind/react";
4
+
5
+ import { ROUTES } from "../constants/routes";
6
+ import { _useScopedI18n } from "../i18n/client";
7
+ import { BrandIcon } from "./icons/BrandIcon";
8
+
9
+ export function Footer() {
10
+ //
11
+ const scopeT = _useScopedI18n("sharedComponents.footerComponent");
12
+ const currentYear = new Date().getFullYear();
13
+
14
+ return (
15
+ <>
16
+ <footer
17
+ className="bg-white rounded-none fixed bottom-0 z-[9999]
18
+ p-3 lg:p-5 gap-3 lg:gap-5
19
+ flex flex-col items-center
20
+ xl:flex xl:flex-row xl:justify-between xl:items-center
21
+ w-full left-0
22
+ lg:w-[calc(100%-190px)] lg:left-[190px]
23
+ xl:w-[calc(100%-215px)] xl:left-[215px]
24
+ "
25
+ >
26
+ <div className="flex flex-col md:flex-row md:items-center gap-2 md:gap-10 ">
27
+ <div>
28
+ <a href="/products">
29
+ <div className="flex items-baseline justify-center gap-2 w-28 mx-auto">
30
+ <BrandIcon width={120} height={34} />
31
+ </div>
32
+ </a>
33
+ </div>
34
+ <ul className="flex gap-3 lg:gap-5 items-center text-center">
35
+ <li>
36
+ <a
37
+ href={ROUTES.dashboard.termsAndConditions}
38
+ className="text-xs md:text-sm font-medium text-black-400 hover:text-purple-500 hover:underline"
39
+ target="_blank"
40
+ >
41
+ {scopeT("termsAndC")}
42
+ </a>
43
+ </li>
44
+ <li>
45
+ <a
46
+ href={ROUTES.dashboard.privacyPolicy}
47
+ className="text-xs md:text-sm font-medium text-black-400 hover:text-purple-500 hover:underline"
48
+ target="_blank"
49
+ >
50
+ {scopeT("privacy")}
51
+ </a>
52
+ </li>
53
+ <li>
54
+ <a
55
+ href={ROUTES.dashboard.riskDisclosure}
56
+ className="text-xs md:text-sm font-medium text-black-400 hover:text-purple-500 hover:underline"
57
+ target="_blank"
58
+ >
59
+ {scopeT("risk")}
60
+ </a>
61
+ </li>
62
+ </ul>
63
+ </div>
64
+
65
+ <Typography className="text-xs md:text-sm font-medium text-gray-500 text-center">
66
+ COPYRIGHT Β©{currentYear} | HMall Technologies LTD All Rights Reserved
67
+ </Typography>
68
+ </footer>
69
+ </>
70
+ );
71
+ }
@@ -0,0 +1,96 @@
1
+ import {
2
+ Dialog,
3
+ DialogBody,
4
+ DialogFooter,
5
+ DialogHeader,
6
+ IconButton,
7
+ Typography,
8
+ } from "@material-tailwind/react";
9
+ import React, { useCallback } from "react";
10
+ import { IoIosCloseCircleOutline } from "react-icons/io";
11
+
12
+ import {
13
+ GREETING_DIALOG_STATUS,
14
+ GREETING_DIALOG_STATUS_KEY,
15
+ } from "../constants/app";
16
+ import useCustomRouter from "../hooks/useCustomRouter";
17
+ import ButtonCustom from "./Button";
18
+
19
+ export function GreetingDialog({ handleOpen, open }) {
20
+ const { push } = useCustomRouter();
21
+
22
+ const buyNowAction = useCallback(() => {
23
+ push(`/products?category=subscription`);
24
+ }, [push]);
25
+
26
+ return (
27
+ <>
28
+ <Dialog size="xs" open={open} handler={handleOpen} className="px-3 py-4">
29
+ <DialogHeader className="justify-center">
30
+ <Typography
31
+ variant="h2"
32
+ className=" text-xl font-semibold text-black-500 mb-0"
33
+ >
34
+ 🌟 Exciting News! 🌟
35
+ </Typography>
36
+ <IconButton
37
+ size="sm"
38
+ variant="text"
39
+ className="!absolute right-3 top-3 outline-none"
40
+ onClick={async () => {
41
+ await localStorage.setItem(
42
+ GREETING_DIALOG_STATUS_KEY,
43
+ GREETING_DIALOG_STATUS.seen,
44
+ );
45
+ handleOpen(false);
46
+ }}
47
+ >
48
+ <IoIosCloseCircleOutline className="w-6 h-6 text-gray-500 cursor-pointer" />
49
+ </IconButton>
50
+ </DialogHeader>
51
+ <DialogBody>
52
+ <Typography
53
+ variant="h6"
54
+ className="text-sm leading-6 font-normal text-black-400 text-center"
55
+ >
56
+ 🌟 We’re thrilled to announce the launch of the Homni Advantage
57
+ Membership! This exclusive membership is designed for users who want
58
+ to unlock premium benefits and features. πŸŽ‰ Be among the first to
59
+ explore this exciting new offering! πŸ‘‰ Visit the Subscription page
60
+ now to learn more and grab your membership today! Don’t miss out on
61
+ the chance to elevate your experience with Homni Advantage. πŸš€
62
+ </Typography>
63
+ </DialogBody>
64
+ <DialogFooter className="justify-center">
65
+ <ButtonCustom
66
+ icon={""}
67
+ className={""}
68
+ onClick={async () => {
69
+ buyNowAction();
70
+ await localStorage.setItem(
71
+ GREETING_DIALOG_STATUS_KEY,
72
+ GREETING_DIALOG_STATUS.seen,
73
+ );
74
+ handleOpen(false);
75
+ }}
76
+ >
77
+ Buy Now
78
+ </ButtonCustom>
79
+ {/* <ButtonCustom
80
+ icon={''}
81
+ onClick={async () => {
82
+ await localStorage.setItem(
83
+ GREETING_DIALOG_STATUS_KEY,
84
+ GREETING_DIALOG_STATUS.seen,
85
+ );
86
+ handleOpen(false);
87
+ }}
88
+ className="mr-1"
89
+ >
90
+ <span>close</span>
91
+ </ButtonCustom> */}
92
+ </DialogFooter>
93
+ </Dialog>
94
+ </>
95
+ );
96
+ }