@sikka/hawa 0.0.95 → 0.0.97
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/dist/styles.css +279 -211
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +19 -6
- package/rollup.config.js +14 -2
- package/src/blocks/Account/{UserProfileForm.js → UserProfileForm.tsx} +42 -41
- package/src/blocks/Account/UserSettingsForm.tsx +28 -0
- package/src/blocks/Account/index.ts +2 -0
- package/src/blocks/AuthForms/AppLanding.tsx +33 -0
- package/src/blocks/AuthForms/CodeConfirmation.tsx +59 -0
- package/src/blocks/AuthForms/{NewPasswordForm.js → NewPasswordForm.tsx} +49 -53
- package/src/blocks/AuthForms/{ResetPasswordForm.js → ResetPasswordForm.tsx} +35 -38
- package/src/blocks/AuthForms/{SignInForm.js → SignInForm.tsx} +73 -65
- package/src/blocks/AuthForms/SignInPhone.tsx +68 -0
- package/src/blocks/AuthForms/{SignUpForm.js → SignUpForm.tsx} +88 -82
- package/src/blocks/AuthForms/index.ts +7 -0
- package/src/blocks/Misc/NotFound.tsx +28 -0
- package/src/blocks/Misc/index.ts +1 -0
- package/src/blocks/Payment/ChargeWalletForm.tsx +70 -0
- package/src/blocks/Payment/{CheckoutForm.js → CheckoutForm.tsx} +82 -81
- package/src/blocks/Payment/Confirmation.tsx +96 -0
- package/src/blocks/Payment/{CreditCardForm.js → CreditCardForm.tsx} +48 -33
- package/src/blocks/Payment/PayWithWallet.tsx +29 -0
- package/src/blocks/Payment/{SelectPayment.js → SelectPayment.tsx} +33 -29
- package/src/blocks/Payment/{index.js → index.ts} +0 -0
- package/src/blocks/Pricing/{ComparingPlans.js → ComparingPlans.tsx} +51 -53
- package/src/blocks/Pricing/PricingPlans.tsx +72 -0
- package/src/blocks/Pricing/{index.js → index.ts} +0 -0
- package/src/blocks/{index.js → index.ts} +0 -0
- package/{countries.js → src/countries.ts} +245 -245
- package/src/elements/{AutoCompleteField.js → AutoCompleteField.tsx} +16 -9
- package/src/elements/{DragDropImages.js → DragDropImages.tsx} +78 -53
- package/src/elements/DraggableCard.tsx +29 -0
- package/src/elements/{HawaAccordian.js → HawaAccordian.tsx} +27 -23
- package/src/elements/HawaAdCard.tsx +48 -0
- package/src/elements/HawaAlert.tsx +30 -0
- package/src/elements/HawaButton.tsx +120 -0
- package/src/elements/HawaCheckbox.tsx +37 -0
- package/src/elements/HawaChip.tsx +12 -0
- package/src/elements/HawaColorPicker.tsx +38 -0
- package/src/elements/{HawaCopyrights.js → HawaCopyrights.tsx} +15 -8
- package/src/elements/HawaDrawer.tsx +84 -0
- package/src/elements/{HawaDrawerItem.js → HawaDrawerItem.tsx} +12 -7
- package/src/elements/{HawaItemCard.js → HawaItemCard.tsx} +35 -36
- package/src/elements/{HawaLogoButton.js → HawaLogoButton.tsx} +52 -56
- package/src/elements/HawaMenu.tsx +75 -0
- package/src/elements/{HawaModal.js → HawaModal.tsx} +30 -21
- package/src/elements/{HawaPanelTabs.js → HawaPanelTabs.tsx} +27 -27
- package/src/elements/HawaPhoneInput.tsx +112 -0
- package/src/elements/{HawaPricingCard.js → HawaPricingCard.tsx} +86 -47
- package/src/elements/HawaRadio.tsx +34 -0
- package/src/elements/HawaRange.tsx +47 -0
- package/src/elements/HawaSearchBar.tsx +9 -0
- package/src/elements/{HawaSelect.js → HawaSelect.tsx} +74 -31
- package/src/elements/HawaSettingsRow.tsx +56 -0
- package/src/elements/HawaSnackbar.tsx +73 -0
- package/src/elements/HawaSwitch.tsx +25 -0
- package/src/elements/{HawaTable.js → HawaTable.tsx} +33 -31
- package/src/elements/{HawaTabs.js → HawaTabs.tsx} +17 -12
- package/src/elements/HawaTextField.tsx +71 -0
- package/src/elements/HawaTooltip.tsx +35 -0
- package/src/elements/HawaTypography.tsx +11 -0
- package/src/elements/{TabPanel.js → TabPanel.tsx} +10 -5
- package/src/elements/{index.js → index.ts} +7 -4
- package/src/index.ts +3 -0
- package/src/layout/Box.tsx +5 -0
- package/src/layout/HawaBottomAppBar.tsx +54 -0
- package/src/layout/HawaContainer.tsx +24 -0
- package/src/layout/{HawaLayout.js → HawaLayout.tsx} +54 -49
- package/src/layout/{index.js → index.ts} +0 -0
- package/src/styles.css +279 -211
- package/src/{util.js → util.ts} +0 -0
- package/storybook-static/229.a3257e00.iframe.bundle.js +1 -0
- package/storybook-static/229.d6fb4f8f665962cef844.manager.bundle.js +1 -0
- package/storybook-static/295.67c251ec00675ab59b60.manager.bundle.js +1 -0
- package/storybook-static/51.786e9bbba427ee454dc0.manager.bundle.js +2 -0
- package/storybook-static/{0.1104ca18.iframe.bundle.js.LICENSE.txt → 51.786e9bbba427ee454dc0.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/51.acbbdb95.iframe.bundle.js +2 -0
- package/storybook-static/{0.cf71f8aa82edef0a7186.manager.bundle.js.LICENSE.txt → 51.acbbdb95.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/551.67cd309b0648b0a52636.manager.bundle.js +1 -0
- package/storybook-static/551.c82ea8f1.iframe.bundle.js +1 -0
- package/storybook-static/701.bcf1e718.iframe.bundle.js +1 -0
- package/storybook-static/733.8d2de9f8.iframe.bundle.js +2 -0
- package/storybook-static/{vendors~main.a40572d0.iframe.bundle.js.LICENSE.txt → 733.8d2de9f8.iframe.bundle.js.LICENSE.txt} +0 -10
- package/storybook-static/767.2f9c96fa3338c8d16078.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.d13ba71108048897ea4a.manager.bundle.js.LICENSE.txt → 767.2f9c96fa3338c8d16078.manager.bundle.js.LICENSE.txt} +0 -10
- package/storybook-static/807.14b8bfa7.iframe.bundle.js +2 -0
- package/storybook-static/{5.5b799f3fbf64cec8e51a.manager.bundle.js.LICENSE.txt → 807.14b8bfa7.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/807.4f52b2d047c5e8c5872f.manager.bundle.js +2 -0
- package/storybook-static/{6.6023eba1.iframe.bundle.js.LICENSE.txt → 807.4f52b2d047c5e8c5872f.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/897.386c170cbd1467abc7ca.manager.bundle.js +2 -0
- package/storybook-static/{8.f9b98ef3e089be1a16d6.manager.bundle.js.LICENSE.txt → 897.386c170cbd1467abc7ca.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/897.d9a35fd0.iframe.bundle.js +2 -0
- package/storybook-static/{9.63a5cf7a.iframe.bundle.js.LICENSE.txt → 897.d9a35fd0.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/935.07c1b6ea.iframe.bundle.js +1 -0
- package/storybook-static/935.0b4e9c201c33f3e66e81.manager.bundle.js +1 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.051275cac7b0dc69501c.manager.bundle.js +1 -0
- package/storybook-static/main.71507dcb.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/runtime~main.25eae181fe0f96887a15.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.4d0bf318.iframe.bundle.js +1 -0
- package/tailwind.config.js +16 -1
- package/tsconfig.json +25 -0
- package/src/blocks/Account/UserSettingsForm.js +0 -17
- package/src/blocks/Account/index.js +0 -2
- package/src/blocks/AuthForms/AppLanding.js +0 -40
- package/src/blocks/AuthForms/CodeConfirmation.js +0 -78
- package/src/blocks/AuthForms/SignInPhone.js +0 -38
- package/src/blocks/AuthForms/index.js +0 -7
- package/src/blocks/Misc/NotFound.js +0 -32
- package/src/blocks/Misc/index.js +0 -1
- package/src/blocks/Payment/ChargeWalletForm.js +0 -81
- package/src/blocks/Payment/Confirmation.js +0 -104
- package/src/blocks/Payment/Form/CForm.js +0 -316
- package/src/blocks/Payment/Form/Card.js +0 -242
- package/src/blocks/Payment/Form/PaymentMethod.js +0 -118
- package/src/blocks/Payment/Gateway/GooglePay.js +0 -251
- package/src/blocks/Payment/Gateway/Payfort.js +0 -90
- package/src/blocks/Payment/Gateway/Paypal.js +0 -138
- package/src/blocks/Payment/Gateway/Wallet.js +0 -148
- package/src/blocks/Payment/PayWithWallet.js +0 -20
- package/src/blocks/Pricing/PricingPlans.js +0 -88
- package/src/elements/DraggableCard.js +0 -24
- package/src/elements/HawaAlert.js +0 -41
- package/src/elements/HawaButton.js +0 -62
- package/src/elements/HawaCheckbox.js +0 -28
- package/src/elements/HawaChip.js +0 -9
- package/src/elements/HawaColorPicker.js +0 -57
- package/src/elements/HawaDrawer.js +0 -68
- package/src/elements/HawaMenu.js +0 -71
- package/src/elements/HawaPhoneInput.js +0 -106
- package/src/elements/HawaRadio.js +0 -31
- package/src/elements/HawaRange.js +0 -54
- package/src/elements/HawaSearchBar.js +0 -15
- package/src/elements/HawaSettingsRow.js +0 -34
- package/src/elements/HawaSnackbar.js +0 -44
- package/src/elements/HawaSwitch.js +0 -21
- package/src/elements/HawaTextField.js +0 -34
- package/src/elements/HawaTooltip.js +0 -19
- package/src/elements/HawaTypography.js +0 -5
- package/src/elements/PinInput.js +0 -141
- package/src/elements/SelectedField.js +0 -46
- package/src/index.js +0 -3
- package/src/layout/Box.js +0 -5
- package/src/layout/HawaAppLayout.js +0 -245
- package/src/layout/HawaAppLayout2.js +0 -254
- package/src/layout/HawaBottomAppBar.js +0 -76
- package/src/layout/HawaContainer.js +0 -8
- package/storybook-static/0.1104ca18.iframe.bundle.js +0 -3
- package/storybook-static/0.1104ca18.iframe.bundle.js.map +0 -1
- package/storybook-static/0.cf71f8aa82edef0a7186.manager.bundle.js +0 -2
- package/storybook-static/1.7e6ec5c45ae5b70c5149.manager.bundle.js +0 -1
- package/storybook-static/1.e3eafd38.iframe.bundle.js +0 -1
- package/storybook-static/2.3841b1a5.iframe.bundle.js +0 -1
- package/storybook-static/5.5b799f3fbf64cec8e51a.manager.bundle.js +0 -2
- package/storybook-static/6.6023eba1.iframe.bundle.js +0 -3
- package/storybook-static/6.6023eba1.iframe.bundle.js.map +0 -1
- package/storybook-static/6.b34ce31193a7fa1dd965.manager.bundle.js +0 -1
- package/storybook-static/7.632f8551.iframe.bundle.js +0 -1
- package/storybook-static/7.72879af713f755a7aa7e.manager.bundle.js +0 -1
- package/storybook-static/8.9a8f8b69.iframe.bundle.js +0 -1
- package/storybook-static/8.f9b98ef3e089be1a16d6.manager.bundle.js +0 -2
- package/storybook-static/9.1e1335092fade49cc986.manager.bundle.js +0 -1
- package/storybook-static/9.63a5cf7a.iframe.bundle.js +0 -3
- package/storybook-static/9.63a5cf7a.iframe.bundle.js.map +0 -1
- package/storybook-static/main.4bd27e4e7faa098302d1.manager.bundle.js +0 -1
- package/storybook-static/main.ea9904c2.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.67ec6e92.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.a58df7ba92d01c5088d3.manager.bundle.js +0 -1
- package/storybook-static/vendors~main.a40572d0.iframe.bundle.js +0 -3
- package/storybook-static/vendors~main.a40572d0.iframe.bundle.js.map +0 -1
- package/storybook-static/vendors~main.d13ba71108048897ea4a.manager.bundle.js +0 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import { HawaButton, HawaTextField } from "../../elements"
|
|
3
|
+
import { Controller, FormProvider, useForm } from "react-hook-form"
|
|
4
|
+
import { HawaContainer } from "../../layout"
|
|
5
|
+
|
|
6
|
+
type ChargeWalletTypes = {
|
|
7
|
+
currency: any
|
|
8
|
+
handleChargeWallet: any
|
|
9
|
+
texts: {
|
|
10
|
+
amountLabel: string
|
|
11
|
+
amountRequired: string
|
|
12
|
+
chargeWallet: string
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export const ChargeWalletForm: React.FunctionComponent<ChargeWalletTypes> = (
|
|
16
|
+
props
|
|
17
|
+
) => {
|
|
18
|
+
const [walletAmount, setWalletAmount] = useState(0)
|
|
19
|
+
const methods = useForm()
|
|
20
|
+
const {
|
|
21
|
+
formState: { errors },
|
|
22
|
+
handleSubmit,
|
|
23
|
+
control,
|
|
24
|
+
} = methods
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<HawaContainer>
|
|
28
|
+
{" "}
|
|
29
|
+
<div className="text-center text-5xl font-extrabold">
|
|
30
|
+
{Number(walletAmount).toLocaleString("en") || "0"}
|
|
31
|
+
<div className="text-sm font-normal">{props.currency || "SAR"}</div>
|
|
32
|
+
</div>
|
|
33
|
+
<FormProvider {...methods}>
|
|
34
|
+
<form onSubmit={handleSubmit(props.handleChargeWallet)}>
|
|
35
|
+
<Controller
|
|
36
|
+
control={control}
|
|
37
|
+
name="amount"
|
|
38
|
+
render={({ field }) => (
|
|
39
|
+
<HawaTextField
|
|
40
|
+
width="full"
|
|
41
|
+
placeholder={props.texts.amountLabel}
|
|
42
|
+
type="number"
|
|
43
|
+
{...field}
|
|
44
|
+
value={field.value ?? ""}
|
|
45
|
+
inputProps={{
|
|
46
|
+
inputMode: "numeric",
|
|
47
|
+
min: "1",
|
|
48
|
+
max: "9999999",
|
|
49
|
+
step: "0.01",
|
|
50
|
+
}}
|
|
51
|
+
onChange={(e: any) => {
|
|
52
|
+
field.onChange(parseFloat(e.target.value))
|
|
53
|
+
setWalletAmount(e.target.value)
|
|
54
|
+
}}
|
|
55
|
+
helperText={errors.amount?.message}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
rules={{
|
|
59
|
+
required: props.texts.amountRequired,
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
<HawaButton color="primary" type="submit" width="full">
|
|
64
|
+
{props.texts.chargeWallet}
|
|
65
|
+
</HawaButton>
|
|
66
|
+
</form>
|
|
67
|
+
</FormProvider>
|
|
68
|
+
</HawaContainer>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -1,23 +1,49 @@
|
|
|
1
|
-
import React from "react"
|
|
1
|
+
import React from "react"
|
|
2
2
|
import {
|
|
3
3
|
HawaTextField,
|
|
4
4
|
HawaTable,
|
|
5
5
|
HawaSelect,
|
|
6
|
-
HawaButton
|
|
7
|
-
} from "../../elements"
|
|
8
|
-
import { Controller, FormProvider, useForm } from "react-hook-form"
|
|
9
|
-
import
|
|
10
|
-
import { HawaContainer } from "../../layout";
|
|
6
|
+
HawaButton,
|
|
7
|
+
} from "../../elements"
|
|
8
|
+
import { Controller, FormProvider, useForm } from "react-hook-form"
|
|
9
|
+
import { HawaContainer } from "../../layout"
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
type CheckoutFormTypes = {
|
|
12
|
+
lang: string
|
|
13
|
+
products: any
|
|
14
|
+
total: any
|
|
15
|
+
handlePayNow: any
|
|
16
|
+
countriesList: any
|
|
17
|
+
texts: {
|
|
18
|
+
orderDetails: string
|
|
19
|
+
billingAddress: string
|
|
20
|
+
payNow: string
|
|
21
|
+
emailLabel: string
|
|
22
|
+
emailRequiredText: string
|
|
23
|
+
emailInvalidText: string
|
|
24
|
+
firstNameLabel: string
|
|
25
|
+
required: string
|
|
26
|
+
lastNameLabel: string
|
|
27
|
+
streetAddressLabel: string
|
|
28
|
+
buildingNumberLabel: string
|
|
29
|
+
cityLabel: string
|
|
30
|
+
stateLabel: string
|
|
31
|
+
countryLabel: string
|
|
32
|
+
zipCodeLabel: string
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
37
|
+
props
|
|
38
|
+
) => {
|
|
39
|
+
let isArabic = props.lang === "ar"
|
|
40
|
+
const methods = useForm()
|
|
15
41
|
const {
|
|
16
42
|
formState: { errors },
|
|
17
43
|
handleSubmit,
|
|
18
44
|
register,
|
|
19
|
-
control
|
|
20
|
-
} = methods
|
|
45
|
+
control,
|
|
46
|
+
} = methods
|
|
21
47
|
|
|
22
48
|
let containerStyle = {
|
|
23
49
|
display: "flex",
|
|
@@ -29,14 +55,13 @@ export const CheckoutForm = (props) => {
|
|
|
29
55
|
sm: "row",
|
|
30
56
|
md: "row",
|
|
31
57
|
lg: "row",
|
|
32
|
-
xl: "row"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
58
|
+
xl: "row",
|
|
59
|
+
},
|
|
60
|
+
}
|
|
35
61
|
return (
|
|
36
|
-
<HawaContainer
|
|
37
|
-
{" "}
|
|
62
|
+
<HawaContainer maxWidth="full">
|
|
38
63
|
<div>
|
|
39
|
-
<div className="
|
|
64
|
+
<div className="mb-2 text-center text-xl font-semibold">
|
|
40
65
|
{props.texts.orderDetails}
|
|
41
66
|
</div>
|
|
42
67
|
<HawaTable
|
|
@@ -47,7 +72,7 @@ export const CheckoutForm = (props) => {
|
|
|
47
72
|
/>
|
|
48
73
|
</div>
|
|
49
74
|
<div>
|
|
50
|
-
<div className="
|
|
75
|
+
<div className="my-2 text-center text-xl font-semibold">
|
|
51
76
|
{props.texts.billingAddress}
|
|
52
77
|
</div>
|
|
53
78
|
|
|
@@ -60,13 +85,11 @@ export const CheckoutForm = (props) => {
|
|
|
60
85
|
rules={{ required: props.texts?.required }}
|
|
61
86
|
render={({ field }) => (
|
|
62
87
|
<HawaTextField
|
|
63
|
-
inForm
|
|
64
|
-
fullWidth
|
|
65
88
|
type="text"
|
|
66
|
-
value={field.value ?? ""}
|
|
67
89
|
label={props.texts?.firstNameLabel + " *"}
|
|
68
90
|
helperText={errors.firstName?.message}
|
|
69
91
|
{...field}
|
|
92
|
+
value={field.value ?? ""}
|
|
70
93
|
/>
|
|
71
94
|
)}
|
|
72
95
|
/>
|
|
@@ -78,13 +101,13 @@ export const CheckoutForm = (props) => {
|
|
|
78
101
|
rules={{ required: props.texts?.required }}
|
|
79
102
|
render={({ field }) => (
|
|
80
103
|
<HawaTextField
|
|
81
|
-
inForm
|
|
82
|
-
|
|
104
|
+
// inForm
|
|
105
|
+
width="full"
|
|
83
106
|
type="text"
|
|
84
|
-
value={field.value ?? ""}
|
|
85
107
|
label={props.texts?.lastNameLabel + " *"}
|
|
86
108
|
helperText={errors.lastName?.message}
|
|
87
109
|
{...field}
|
|
110
|
+
value={field.value ?? ""}
|
|
88
111
|
/>
|
|
89
112
|
)}
|
|
90
113
|
/>
|
|
@@ -94,13 +117,13 @@ export const CheckoutForm = (props) => {
|
|
|
94
117
|
name="email"
|
|
95
118
|
render={({ field }) => (
|
|
96
119
|
<HawaTextField
|
|
97
|
-
inForm
|
|
98
|
-
|
|
120
|
+
// inForm
|
|
121
|
+
width="full"
|
|
99
122
|
type="text"
|
|
100
|
-
value={field.value ?? ""}
|
|
101
123
|
label={props.texts?.emailLabel + " *"}
|
|
102
124
|
helperText={errors.email?.message}
|
|
103
125
|
{...field}
|
|
126
|
+
value={field.value ?? ""}
|
|
104
127
|
/>
|
|
105
128
|
)}
|
|
106
129
|
rules={{
|
|
@@ -108,24 +131,24 @@ export const CheckoutForm = (props) => {
|
|
|
108
131
|
pattern: {
|
|
109
132
|
value:
|
|
110
133
|
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
111
|
-
message: props.texts?.emailInvalidText
|
|
112
|
-
}
|
|
134
|
+
message: props.texts?.emailInvalidText,
|
|
135
|
+
},
|
|
113
136
|
}}
|
|
114
137
|
/>
|
|
115
|
-
<div
|
|
138
|
+
<div className="flex flex-col md:flex-row">
|
|
116
139
|
<Controller
|
|
117
140
|
control={control}
|
|
118
141
|
name="streetAddress"
|
|
119
142
|
rules={{ required: props.texts?.required }}
|
|
120
143
|
render={({ field }) => (
|
|
121
144
|
<HawaTextField
|
|
122
|
-
inForm
|
|
123
|
-
|
|
145
|
+
// inForm
|
|
146
|
+
width="full"
|
|
124
147
|
type="text"
|
|
125
|
-
value={field.value ?? ""}
|
|
126
148
|
label={props.texts?.streetAddressLabel + " *"}
|
|
127
149
|
helperText={errors.streetAddress?.message}
|
|
128
150
|
{...field}
|
|
151
|
+
value={field.value ?? ""}
|
|
129
152
|
/>
|
|
130
153
|
)}
|
|
131
154
|
/>
|
|
@@ -137,31 +160,32 @@ export const CheckoutForm = (props) => {
|
|
|
137
160
|
rules={{ required: props.texts?.required }}
|
|
138
161
|
render={({ field }) => (
|
|
139
162
|
<HawaTextField
|
|
140
|
-
inForm
|
|
141
|
-
|
|
163
|
+
// inForm
|
|
164
|
+
width="full"
|
|
142
165
|
type="text"
|
|
143
|
-
value={field.value ?? ""}
|
|
144
166
|
label={props.texts?.buildingNumberLabel + " *"}
|
|
145
167
|
helperText={errors.buildingNumber?.message}
|
|
146
168
|
{...field}
|
|
169
|
+
value={field.value ?? ""}
|
|
147
170
|
/>
|
|
148
171
|
)}
|
|
149
172
|
/>
|
|
150
173
|
</div>
|
|
151
|
-
|
|
174
|
+
|
|
175
|
+
<div className="flex flex-col md:flex-row">
|
|
152
176
|
<Controller
|
|
153
177
|
control={control}
|
|
154
178
|
name="province"
|
|
155
179
|
rules={{ required: props.texts?.required }}
|
|
156
180
|
render={({ field }) => (
|
|
157
181
|
<HawaTextField
|
|
158
|
-
inForm
|
|
159
|
-
|
|
182
|
+
// inForm
|
|
183
|
+
width="full"
|
|
160
184
|
type="text"
|
|
161
|
-
value={field.value ?? ""}
|
|
162
185
|
label={props.texts?.stateLabel + " *"}
|
|
163
186
|
helperText={errors.province?.message}
|
|
164
187
|
{...field}
|
|
188
|
+
value={field.value ?? ""}
|
|
165
189
|
/>
|
|
166
190
|
)}
|
|
167
191
|
/>
|
|
@@ -173,13 +197,13 @@ export const CheckoutForm = (props) => {
|
|
|
173
197
|
rules={{ required: props.texts?.required }}
|
|
174
198
|
render={({ field }) => (
|
|
175
199
|
<HawaTextField
|
|
176
|
-
inForm
|
|
177
|
-
|
|
200
|
+
// inForm
|
|
201
|
+
width="full"
|
|
178
202
|
type="text"
|
|
179
|
-
value={field.value ?? ""}
|
|
180
203
|
label={props.texts?.cityLabel + " *"}
|
|
181
204
|
helperText={errors.city?.message}
|
|
182
205
|
{...field}
|
|
206
|
+
value={field.value ?? ""}
|
|
183
207
|
/>
|
|
184
208
|
)}
|
|
185
209
|
/>
|
|
@@ -191,14 +215,14 @@ export const CheckoutForm = (props) => {
|
|
|
191
215
|
rules={{ required: props.texts?.required }}
|
|
192
216
|
render={({ field }) => (
|
|
193
217
|
<HawaTextField
|
|
194
|
-
inForm
|
|
195
|
-
|
|
218
|
+
// inForm
|
|
219
|
+
width="full"
|
|
196
220
|
type="number"
|
|
197
|
-
variant="unscrollable"
|
|
198
|
-
value={field.value ?? ""}
|
|
221
|
+
// variant="unscrollable"
|
|
199
222
|
label={props.texts?.zipCodeLabel + " *"}
|
|
200
223
|
helperText={errors.zipCode?.message}
|
|
201
224
|
{...field}
|
|
225
|
+
value={field.value ?? ""}
|
|
202
226
|
/>
|
|
203
227
|
)}
|
|
204
228
|
/>
|
|
@@ -213,51 +237,28 @@ export const CheckoutForm = (props) => {
|
|
|
213
237
|
fullWidth
|
|
214
238
|
native
|
|
215
239
|
label={props.texts?.countryLabel + " *"}
|
|
216
|
-
variant="standard"
|
|
217
|
-
value={field.value ?? ""}
|
|
240
|
+
// variant="standard"
|
|
218
241
|
helperText={errors.country?.message}
|
|
219
|
-
displayEmpty
|
|
220
|
-
disableUnderline
|
|
221
|
-
validators={["required"]}
|
|
242
|
+
// displayEmpty
|
|
243
|
+
// disableUnderline
|
|
244
|
+
// validators={["required"]}
|
|
222
245
|
{...field}
|
|
246
|
+
value={field.value ?? ""}
|
|
223
247
|
>
|
|
224
248
|
<option></option>
|
|
225
|
-
{props.countriesList.map((country, i) => (
|
|
249
|
+
{props.countriesList.map((country: any, i: any) => (
|
|
226
250
|
<option key={i}>{country}</option>
|
|
227
251
|
))}
|
|
228
252
|
</HawaSelect>
|
|
229
253
|
)}
|
|
230
254
|
/>
|
|
231
255
|
</div>
|
|
232
|
-
<HawaButton type="submit"
|
|
256
|
+
<HawaButton color="primary" type="submit" width="full">
|
|
257
|
+
{props.texts.payNow}
|
|
258
|
+
</HawaButton>
|
|
233
259
|
</form>
|
|
234
260
|
</FormProvider>
|
|
235
261
|
</div>
|
|
236
262
|
</HawaContainer>
|
|
237
|
-
)
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
CheckoutForm.propTypes = {
|
|
241
|
-
texts: PropTypes.shape({
|
|
242
|
-
orderDetails: PropTypes.string,
|
|
243
|
-
billingAddress: PropTypes.string,
|
|
244
|
-
payNow: PropTypes.string,
|
|
245
|
-
emailLabel: PropTypes.string,
|
|
246
|
-
emailRequiredText: PropTypes.string,
|
|
247
|
-
emailInvalidText: PropTypes.string,
|
|
248
|
-
firstNameLabel: PropTypes.string,
|
|
249
|
-
required: PropTypes.string,
|
|
250
|
-
lastNameLabel: PropTypes.string,
|
|
251
|
-
streetAddressLabel: PropTypes.string,
|
|
252
|
-
buildingNumberLabel: PropTypes.string,
|
|
253
|
-
cityLabel: PropTypes.string,
|
|
254
|
-
stateLabel: PropTypes.string,
|
|
255
|
-
countryLabel: PropTypes.string,
|
|
256
|
-
zipCodeLabel: PropTypes.string
|
|
257
|
-
}),
|
|
258
|
-
lang: PropTypes.string,
|
|
259
|
-
countriesList: PropTypes.array,
|
|
260
|
-
products: PropTypes.array,
|
|
261
|
-
total: PropTypes.string,
|
|
262
|
-
handlePayNow: PropTypes.func
|
|
263
|
-
};
|
|
263
|
+
)
|
|
264
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { HawaButton, HawaTable } from "../../elements"
|
|
3
|
+
import { HawaContainer } from "../../layout"
|
|
4
|
+
|
|
5
|
+
type ConfirmationPageTypes = {
|
|
6
|
+
texts: {
|
|
7
|
+
print: string
|
|
8
|
+
history: string
|
|
9
|
+
homePage: string
|
|
10
|
+
successMessage: string
|
|
11
|
+
orderDetails: string
|
|
12
|
+
fasterPaymentNote: string
|
|
13
|
+
billingAddress: string
|
|
14
|
+
payNow: string
|
|
15
|
+
yourOrderNumber: string
|
|
16
|
+
emailLabel: string
|
|
17
|
+
emailRequiredText: string
|
|
18
|
+
emailInvalidText: string
|
|
19
|
+
firstNameLabel: string
|
|
20
|
+
required: string
|
|
21
|
+
lastNameLabel: string
|
|
22
|
+
streetAddressLabel: string
|
|
23
|
+
buildingNumberLabel: string
|
|
24
|
+
cityLabel: string
|
|
25
|
+
stateLabel: string
|
|
26
|
+
countryLabel: string
|
|
27
|
+
zipCodeLabel: string
|
|
28
|
+
refundPolicy: string
|
|
29
|
+
}
|
|
30
|
+
products: any
|
|
31
|
+
countriesList: any
|
|
32
|
+
lang: string
|
|
33
|
+
total: string
|
|
34
|
+
userEmail: string
|
|
35
|
+
orderNumber: string
|
|
36
|
+
confirmationTitle: string
|
|
37
|
+
handleHome: any
|
|
38
|
+
handlePrint: any
|
|
39
|
+
handleHistory: any
|
|
40
|
+
handleRefundPolicyLink: any
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const ConfirmationPage: React.FunctionComponent<
|
|
44
|
+
ConfirmationPageTypes
|
|
45
|
+
> = (props) => {
|
|
46
|
+
let isArabic = props.lang === "ar"
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<HawaContainer>
|
|
50
|
+
{" "}
|
|
51
|
+
<div className="py-5 text-center text-3xl font-bold">
|
|
52
|
+
{props.confirmationTitle}
|
|
53
|
+
</div>
|
|
54
|
+
<div className="py-5">
|
|
55
|
+
<div className="mb-2 text-center">
|
|
56
|
+
{props.texts.successMessage} <strong>{props.userEmail}</strong>
|
|
57
|
+
</div>
|
|
58
|
+
<div className="text-center">{props.texts.yourOrderNumber}</div>
|
|
59
|
+
<div className="text-center font-bold">{props.orderNumber}</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div className="py-5">
|
|
62
|
+
<div className="mb-3 text-center text-xl font-semibold">
|
|
63
|
+
{props.texts.orderDetails}
|
|
64
|
+
</div>
|
|
65
|
+
{props.products && (
|
|
66
|
+
<HawaTable
|
|
67
|
+
lang={props.lang}
|
|
68
|
+
columns={["Product", "Price"]}
|
|
69
|
+
rows={props.products}
|
|
70
|
+
// end={["Total", props.total]}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
</div>
|
|
74
|
+
<div className="flex flex-col justify-center py-5 pt-0">
|
|
75
|
+
<HawaButton color="primary" width="full" onClick={props.handlePrint}>
|
|
76
|
+
{props.texts.print}
|
|
77
|
+
</HawaButton>
|
|
78
|
+
<HawaButton color="primary" width="full" onClick={props.handleHistory}>
|
|
79
|
+
{props.texts.history}
|
|
80
|
+
</HawaButton>
|
|
81
|
+
<HawaButton color="primary" width="full" onClick={props.handleHome}>
|
|
82
|
+
{props.texts.homePage}
|
|
83
|
+
</HawaButton>
|
|
84
|
+
<div className="mt-5 mb-5 text-center text-sm">
|
|
85
|
+
{props.texts.fasterPaymentNote}
|
|
86
|
+
</div>
|
|
87
|
+
<a
|
|
88
|
+
className="w-fit cursor-pointer text-center text-xs font-normal"
|
|
89
|
+
onClick={props.handleRefundPolicyLink}
|
|
90
|
+
>
|
|
91
|
+
{props.texts.refundPolicy}
|
|
92
|
+
</a>
|
|
93
|
+
</div>
|
|
94
|
+
</HawaContainer>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
@@ -1,89 +1,104 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { HawaButton, HawaTextField } from "../../elements"
|
|
3
|
-
import { Controller, useForm } from "react-hook-form"
|
|
4
|
-
import { HawaContainer } from "../../layout"
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { HawaButton, HawaTextField } from "../../elements"
|
|
3
|
+
import { Controller, useForm } from "react-hook-form"
|
|
4
|
+
import { HawaContainer } from "../../layout"
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type CreditCardFormTypes = {
|
|
7
|
+
handle: any
|
|
8
|
+
handlePayWithCreditCard: any
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const CreditCardForm: React.FunctionComponent<CreditCardFormTypes> = (
|
|
12
|
+
props
|
|
13
|
+
) => {
|
|
14
|
+
const methods = useForm()
|
|
8
15
|
const {
|
|
9
16
|
formState: { errors },
|
|
10
17
|
handleSubmit,
|
|
11
|
-
control
|
|
12
|
-
} = methods
|
|
18
|
+
control,
|
|
19
|
+
} = methods
|
|
13
20
|
|
|
14
21
|
return (
|
|
15
22
|
<HawaContainer>
|
|
16
23
|
{" "}
|
|
17
24
|
<form onSubmit={handleSubmit(props.handle)}>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
name="
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
<Controller
|
|
26
|
+
control={control}
|
|
27
|
+
name="cardName"
|
|
28
|
+
render={({ field }) => (
|
|
29
|
+
<HawaTextField
|
|
30
|
+
width="full"
|
|
31
|
+
name="password"
|
|
32
|
+
placeholder="Enter password"
|
|
33
|
+
type="tel"
|
|
34
|
+
label="Card Number"
|
|
35
|
+
helperText={errors.password?.message}
|
|
36
|
+
/>
|
|
37
|
+
)}
|
|
24
38
|
rules={{
|
|
25
|
-
required: "Password is rquired"
|
|
39
|
+
required: "Password is rquired",
|
|
26
40
|
}}
|
|
27
|
-
helperText={errors.password?.message}
|
|
28
41
|
/>
|
|
29
42
|
<Controller
|
|
30
43
|
control={control}
|
|
31
44
|
name="cardName"
|
|
32
45
|
render={({ field }) => (
|
|
33
46
|
<HawaTextField
|
|
34
|
-
|
|
47
|
+
width="full"
|
|
35
48
|
name="password"
|
|
36
49
|
placeholder="Enter password"
|
|
37
50
|
type="password"
|
|
38
51
|
label="Name On Card"
|
|
39
|
-
rules={{
|
|
40
|
-
required: "Password is rquired"
|
|
41
|
-
}}
|
|
42
52
|
helperText={errors.password?.message}
|
|
43
53
|
/>
|
|
44
54
|
)}
|
|
55
|
+
rules={{
|
|
56
|
+
required: "Password is rquired",
|
|
57
|
+
}}
|
|
45
58
|
/>
|
|
46
59
|
<Controller
|
|
47
60
|
control={control}
|
|
48
61
|
name="cardName"
|
|
49
62
|
render={({ field }) => (
|
|
50
63
|
<HawaTextField
|
|
51
|
-
|
|
64
|
+
width="full"
|
|
52
65
|
name="password"
|
|
53
66
|
placeholder="Enter password"
|
|
54
67
|
type="password"
|
|
55
68
|
label="Expiry Date"
|
|
56
|
-
rules={{
|
|
57
|
-
required: "Password is rquired"
|
|
58
|
-
}}
|
|
59
69
|
helperText={errors.password?.message}
|
|
60
70
|
/>
|
|
61
71
|
)}
|
|
72
|
+
rules={{
|
|
73
|
+
required: "Password is rquired",
|
|
74
|
+
}}
|
|
62
75
|
/>
|
|
63
76
|
<Controller
|
|
64
77
|
control={control}
|
|
65
78
|
name="cardName"
|
|
66
79
|
render={({ field }) => (
|
|
67
80
|
<HawaTextField
|
|
68
|
-
|
|
81
|
+
width="full"
|
|
69
82
|
name="password"
|
|
70
83
|
placeholder="Enter password"
|
|
71
84
|
type="password"
|
|
72
85
|
label="CCV"
|
|
73
|
-
rules={{
|
|
74
|
-
required: "Password is rquired"
|
|
75
|
-
}}
|
|
76
86
|
helperText={errors.password?.message}
|
|
77
87
|
/>
|
|
78
88
|
)}
|
|
89
|
+
rules={{
|
|
90
|
+
required: "Password is rquired",
|
|
91
|
+
}}
|
|
79
92
|
/>
|
|
80
93
|
<HawaButton
|
|
81
94
|
type="submit"
|
|
82
|
-
|
|
95
|
+
width="full"
|
|
96
|
+
color="primary"
|
|
83
97
|
onClick={props.handlePayWithCreditCard}
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
>
|
|
99
|
+
Pay with Credit Card
|
|
100
|
+
</HawaButton>
|
|
86
101
|
</form>
|
|
87
102
|
</HawaContainer>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
103
|
+
)
|
|
104
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { HawaButton } from "../../elements"
|
|
3
|
+
import { HawaContainer } from "../../layout"
|
|
4
|
+
|
|
5
|
+
type PayWithWalletTypes = {
|
|
6
|
+
walletBalance: any
|
|
7
|
+
currency: any
|
|
8
|
+
handlePayWithWallet: any
|
|
9
|
+
}
|
|
10
|
+
export const PayWithWallet: React.FunctionComponent<PayWithWalletTypes> = (
|
|
11
|
+
props
|
|
12
|
+
) => {
|
|
13
|
+
return (
|
|
14
|
+
<HawaContainer>
|
|
15
|
+
<div className="text-center text-5xl font-extrabold">
|
|
16
|
+
{props.walletBalance || "0"}
|
|
17
|
+
<div className="text-sm font-normal">{props.currency || "SAR"}</div>
|
|
18
|
+
</div>
|
|
19
|
+
<HawaButton
|
|
20
|
+
type="submit"
|
|
21
|
+
width="full"
|
|
22
|
+
color="primary"
|
|
23
|
+
onClick={props.handlePayWithWallet}
|
|
24
|
+
>
|
|
25
|
+
Pay Now
|
|
26
|
+
</HawaButton>
|
|
27
|
+
</HawaContainer>
|
|
28
|
+
)
|
|
29
|
+
}
|