@sikka/hawa 0.0.10 → 0.0.13
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/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +5 -4
- package/src/blocks/Account/UserProfileForm.js +79 -0
- package/src/blocks/Account/UserSettingsForm.js +13 -0
- package/src/blocks/Account/index.js +2 -2
- package/src/blocks/AuthForms/NewPasswordForm.js +58 -86
- package/src/blocks/AuthForms/ResetPasswordForm.js +44 -43
- package/src/blocks/AuthForms/SignInForm.js +99 -103
- package/src/blocks/AuthForms/SignUpForm.js +106 -104
- package/src/blocks/Payment/ChargeWalletForm.js +40 -37
- package/src/blocks/Payment/CreditCardForm.js +50 -45
- package/src/blocks/Payment/PayWithWallet.js +17 -7
- package/src/blocks/Payment/PaymentMethod.js +0 -1
- package/src/blocks/Payment/SelectPayment.js +54 -56
- package/src/blocks/Pricing/SignInForm.js +126 -0
- package/src/elements/ActionButton.js +38 -0
- package/src/elements/AdaptiveButton.js +32 -0
- package/src/{ui → elements}/AutoCompleteField.js +0 -0
- package/src/{ui → elements}/DragDropImages.js +0 -0
- package/src/{ui → elements}/Hawa.js +0 -0
- package/src/elements/HawaAlert.js +35 -0
- package/src/elements/HawaButton.js +47 -0
- package/src/elements/HawaCard.js +77 -0
- package/src/{ui → elements}/HawaCheckbox.js +0 -0
- package/src/elements/HawaInputLabel.js +31 -0
- package/src/{ui → elements}/HawaLogoButton.js +7 -45
- package/src/elements/HawaRadio.js +32 -0
- package/src/elements/HawaSettingsRow.js +27 -0
- package/src/elements/HawaSwitch.js +6 -0
- package/src/{ui → elements}/HawaTextArea.js +1 -1
- package/src/elements/HawaTextField.js +160 -0
- package/src/elements/HawaTypography.js +26 -0
- package/src/{ui → elements}/RadioBox.js +0 -0
- package/src/{ui → elements}/Row.js +1 -1
- package/src/{ui → elements}/SelectedField.js +0 -0
- package/src/{ui → elements}/StyledTooltip.js +1 -1
- package/src/{ui → elements}/TabPanel.js +1 -1
- package/src/{ui → elements}/index.js +1 -1
- package/src/index.js +0 -2
- package/src/layout/Box.js +36 -33
- package/src/stories/BlocksStories/Account/UserProfile.stories.js +21 -0
- package/src/stories/BlocksStories/Account/UserSettings.stories.js +55 -0
- package/src/stories/BlocksStories/Auth/NewPassword.stories.js +60 -0
- package/src/stories/BlocksStories/Auth/ResetPassword.stories.js +59 -0
- package/src/stories/BlocksStories/Auth/SignIn.stories.js +89 -0
- package/src/stories/BlocksStories/Auth/SignUp.stories.js +90 -0
- package/src/stories/BlocksStories/Payment/ChargeWallet.stories.js +30 -0
- package/src/stories/BlocksStories/Payment/PayWithCreditCard.stories.js +37 -0
- package/src/stories/BlocksStories/Payment/PayWithWallet.stories.js +17 -0
- package/src/stories/BlocksStories/Payment/PaymentSelection.stories.js +60 -0
- package/src/stories/ElementsStories/AdaptiveButton.stories.js +51 -0
- package/src/stories/{UIStories → ElementsStories}/Alert.stories.js +3 -4
- package/src/stories/{UIStories → ElementsStories}/InputLabel.stories.js +1 -1
- package/src/stories/ElementsStories/ItemCard.stories.js +18 -0
- package/src/stories/ElementsStories/LogoButtons.stories.js +73 -0
- package/src/stories/ElementsStories/PricingCard.stories.js +27 -0
- package/src/stories/ElementsStories/RadioSelector.stories.js +36 -0
- package/src/stories/ElementsStories/SettingsRow.stories.js +63 -0
- package/src/stories/{UIStories → ElementsStories}/TextField.stories.js +1 -1
- package/src/stories/LayoutStories/Box.stories.js +11 -31
- package/storybook-static/8.1bf48ea7.iframe.bundle.js +1 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.00b064cb.iframe.bundle.js +1 -0
- package/storybook-static/{runtime~main.cfefe972.iframe.bundle.js → runtime~main.f1ebae9b.iframe.bundle.js} +1 -1
- package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt → vendors~main.5eab66d3.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js.map +1 -0
- package/src/blocks/Account/UserProfile.js +0 -65
- package/src/blocks/Account/UserSettings.js +0 -15
- package/src/stories/BlocksStories/AuthForm.stories.js +0 -105
- package/src/stories/BlocksStories/PaymentForm.stories.js +0 -86
- package/src/stories/BlocksStories/UserForm.stories.js +0 -41
- package/src/stories/HawaProvider.stories.js +0 -22
- package/src/stories/UIStories/ActionButton.stories.js +0 -46
- package/src/stories/UIStories/AdaptiveButton.stories.js +0 -81
- package/src/stories/UIStories/CheckBox.stories.js +0 -34
- package/src/stories/UIStories/LogoButtons.stories.js +0 -90
- package/src/stories/UIStories/RadioSelector.stories.js +0 -53
- package/src/stories/UIStories/SettingsRow.stories.js +0 -64
- package/src/themes/HawaProvider.js +0 -183
- package/src/ui/ActionButton.js +0 -41
- package/src/ui/AdaptiveButton.js +0 -136
- package/src/ui/HawaAlert.js +0 -37
- package/src/ui/HawaButton.js +0 -48
- package/src/ui/HawaInputLabel.js +0 -32
- package/src/ui/HawaRadio.js +0 -73
- package/src/ui/HawaSettingsRow.js +0 -71
- package/src/ui/HawaTextField.js +0 -107
- package/src/ui/HawaTypography.js +0 -28
- package/storybook-static/8.c4cb6081.iframe.bundle.js +0 -1
- package/storybook-static/main.5731dbe3.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +0 -1
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
HawaTextField,
|
|
4
|
-
ActionButton,
|
|
5
|
-
HawaAlert,
|
|
6
|
-
HawaTypography,
|
|
7
|
-
HawaLogoButton
|
|
8
|
-
} from "../../ui";
|
|
9
|
-
import { Box } from "../../layout";
|
|
2
|
+
import { HawaTextField, HawaLogoButton } from "../../elements";
|
|
10
3
|
import { FormProvider, useForm } from "react-hook-form";
|
|
11
|
-
|
|
12
4
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
13
5
|
import EmailIcon from "@mui/icons-material/MailOutline";
|
|
14
6
|
import PasswordIcon from "@mui/icons-material/HttpsOutlined";
|
|
7
|
+
import Container from "@mui/material/Container";
|
|
8
|
+
import Typography from "@mui/material/Typography";
|
|
9
|
+
import Button from "@mui/material/Button";
|
|
10
|
+
import Alert from "@mui/material/Alert";
|
|
11
|
+
import AlertTitle from "@mui/material/AlertTitle";
|
|
15
12
|
|
|
16
13
|
export const SignInForm = (props) => {
|
|
17
14
|
const methods = useForm();
|
|
@@ -21,110 +18,109 @@ export const SignInForm = (props) => {
|
|
|
21
18
|
} = methods;
|
|
22
19
|
|
|
23
20
|
return (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
<Container maxWidth="xs" variant="auth">
|
|
22
|
+
{props.error && (
|
|
23
|
+
<Alert severity="error">
|
|
24
|
+
{props.errorTitle && <AlertTitle>{props.errorTitle}</AlertTitle>}
|
|
25
|
+
{props.errorText}
|
|
26
|
+
</Alert>
|
|
27
|
+
)}
|
|
28
|
+
<FormProvider {...methods}>
|
|
29
|
+
<form onSubmit={handleSubmit(props.handleSignIn)}>
|
|
30
|
+
<HawaTextField
|
|
31
|
+
fullWidth
|
|
32
|
+
type="text"
|
|
33
|
+
name="email"
|
|
34
|
+
label={props.texts.emailLabel}
|
|
35
|
+
placeholder={props.texts.emailPlaceholder}
|
|
36
|
+
startAdornment={
|
|
37
|
+
<InputAdornment position="start">
|
|
38
|
+
<EmailIcon />
|
|
39
|
+
</InputAdornment>
|
|
40
|
+
}
|
|
41
|
+
rules={{
|
|
42
|
+
required: props.texts.emailRequired,
|
|
43
|
+
pattern: {
|
|
44
|
+
value:
|
|
45
|
+
/^(([^<>()[\]\\.,;:\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,}))$/,
|
|
46
|
+
message: props.texts.emailInvalidText
|
|
40
47
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
value:
|
|
45
|
-
/^(([^<>()[\]\\.,;:\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,}))$/,
|
|
46
|
-
message: "Invalid email address"
|
|
47
|
-
}
|
|
48
|
-
}}
|
|
49
|
-
helperText={errors.email?.message}
|
|
50
|
-
/>
|
|
48
|
+
}}
|
|
49
|
+
helperText={errors.email?.message}
|
|
50
|
+
/>
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
style={{
|
|
89
|
-
marginTop: 5,
|
|
90
|
-
// width: "max-content",
|
|
91
|
-
textAlign: "center",
|
|
92
|
-
padding: 5
|
|
93
|
-
}}
|
|
52
|
+
<HawaTextField
|
|
53
|
+
fullWidth
|
|
54
|
+
name="password"
|
|
55
|
+
placeholder={props.texts.passwordPlaceholder}
|
|
56
|
+
type="password"
|
|
57
|
+
label={props.texts.passwordLabel}
|
|
58
|
+
startAdornment={
|
|
59
|
+
<InputAdornment position="start">
|
|
60
|
+
<PasswordIcon />
|
|
61
|
+
</InputAdornment>
|
|
62
|
+
}
|
|
63
|
+
rules={{
|
|
64
|
+
required: props.texts.passwordRequired
|
|
65
|
+
}}
|
|
66
|
+
helperText={errors.password?.message}
|
|
67
|
+
/>
|
|
68
|
+
<Typography
|
|
69
|
+
style={{
|
|
70
|
+
cursor: "pointer",
|
|
71
|
+
marginTop: 5,
|
|
72
|
+
width: "max-content",
|
|
73
|
+
fontSize: 15,
|
|
74
|
+
padding: 5
|
|
75
|
+
}}
|
|
76
|
+
onClick={props.handleForgotPassword}
|
|
77
|
+
>
|
|
78
|
+
{props.texts.forgotPasswordText}
|
|
79
|
+
</Typography>
|
|
80
|
+
<Button type="submit" fullWidth variant="last">
|
|
81
|
+
{props.texts.signInText}
|
|
82
|
+
</Button>
|
|
83
|
+
</form>
|
|
84
|
+
</FormProvider>
|
|
85
|
+
<Typography
|
|
86
|
+
variant="subtitle2"
|
|
87
|
+
style={{ marginTop: 5, textAlign: "center", padding: 5 }}
|
|
94
88
|
>
|
|
95
|
-
|
|
89
|
+
{props.texts.newUserText}{" "}
|
|
96
90
|
<span
|
|
97
|
-
onClick={
|
|
91
|
+
onClick={props.handleRouteToSignUp}
|
|
98
92
|
style={{
|
|
99
93
|
cursor: "pointer",
|
|
100
94
|
color: "blue",
|
|
101
95
|
textAlign: "center"
|
|
102
96
|
}}
|
|
103
97
|
>
|
|
104
|
-
|
|
98
|
+
{props.texts.signUpText}
|
|
105
99
|
</span>
|
|
106
|
-
</
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
100
|
+
</Typography>
|
|
101
|
+
<div style={{ display: "flex", flexDirection: "column" }}>
|
|
102
|
+
{props.viaGoogle && (
|
|
103
|
+
<HawaLogoButton
|
|
104
|
+
logo="google"
|
|
105
|
+
buttonText={props.texts.googleButtonLabel}
|
|
106
|
+
onClick={props.handleGoogleSignIn}
|
|
107
|
+
/>
|
|
108
|
+
)}
|
|
109
|
+
{props.viaGithub && (
|
|
110
|
+
<HawaLogoButton
|
|
111
|
+
logo="github"
|
|
112
|
+
buttonText={props.texts.githubButtonLabel}
|
|
113
|
+
onClick={props.handleGithubSignIn}
|
|
114
|
+
/>
|
|
115
|
+
)}
|
|
116
|
+
{props.viaTwitter && (
|
|
117
|
+
<HawaLogoButton
|
|
118
|
+
logo="twitter"
|
|
119
|
+
buttonText={props.texts.twitterButtonLabel}
|
|
120
|
+
onClick={props.handleTwitterSignIn}
|
|
121
|
+
/>
|
|
122
|
+
)}
|
|
123
|
+
</div>
|
|
124
|
+
</Container>
|
|
129
125
|
);
|
|
130
126
|
};
|
|
@@ -1,142 +1,144 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
HawaTextField,
|
|
5
|
-
ActionButton,
|
|
6
|
-
HawaAlert,
|
|
7
|
-
HawaTypography,
|
|
8
|
-
HawaLogoButton
|
|
9
|
-
} from "../../ui";
|
|
2
|
+
import { HawaTextField, HawaLogoButton } from "../../elements";
|
|
10
3
|
import PropTypes from "prop-types";
|
|
11
4
|
import { FormProvider, useForm } from "react-hook-form";
|
|
12
|
-
|
|
13
5
|
import PersonIcon from "@mui/icons-material/PermIdentityOutlined";
|
|
14
6
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
15
7
|
import EmailIcon from "@mui/icons-material/MailOutline";
|
|
16
8
|
import PasswordIcon from "@mui/icons-material/HttpsOutlined";
|
|
9
|
+
import Container from "@mui/material/Container";
|
|
10
|
+
import Typography from "@mui/material/Typography";
|
|
11
|
+
import Button from "@mui/material/Button";
|
|
12
|
+
import Alert from "@mui/material/Alert";
|
|
13
|
+
import AlertTitle from "@mui/material/AlertTitle";
|
|
17
14
|
|
|
18
15
|
export const SignUpForm = (props) => {
|
|
19
16
|
const methods = useForm();
|
|
20
17
|
const {
|
|
21
18
|
formState: { errors },
|
|
22
|
-
handleSubmit
|
|
23
|
-
getValues,
|
|
24
|
-
register,
|
|
25
|
-
watch,
|
|
26
|
-
reset,
|
|
27
|
-
setValue
|
|
19
|
+
handleSubmit
|
|
28
20
|
} = methods;
|
|
29
21
|
|
|
30
22
|
return (
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
<Container maxWidth="xs" variant="auth">
|
|
24
|
+
{props.error && (
|
|
25
|
+
<Alert severity="error">
|
|
26
|
+
{props.errorTitle && <AlertTitle>{props.errorTitle}</AlertTitle>}
|
|
27
|
+
{props.errorText}
|
|
28
|
+
</Alert>
|
|
29
|
+
)}
|
|
30
|
+
{/* {props.error && (
|
|
34
31
|
<HawaAlert text="This is a sign in alert" severity="error" />
|
|
35
|
-
)}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/>
|
|
32
|
+
)} */}
|
|
33
|
+
<FormProvider {...methods}>
|
|
34
|
+
<form onSubmit={handleSubmit(props.handleSignUp)}>
|
|
35
|
+
<HawaTextField
|
|
36
|
+
fullWidth
|
|
37
|
+
type="text"
|
|
38
|
+
label={props.texts.fullNameLabel}
|
|
39
|
+
name="fullName"
|
|
40
|
+
placeholder={props.texts.fullNamePlaceholder}
|
|
41
|
+
inputLabel={props.texts.fullNameLabel}
|
|
42
|
+
startAdornment={
|
|
43
|
+
<InputAdornment position="start">
|
|
44
|
+
<PersonIcon />
|
|
45
|
+
</InputAdornment>
|
|
46
|
+
}
|
|
47
|
+
helperText={errors.fullName?.message}
|
|
48
|
+
/>
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
<HawaTextField
|
|
51
|
+
fullWidth
|
|
52
|
+
type="text"
|
|
53
|
+
label={props.texts.emailLabel}
|
|
54
|
+
placeholder={props.texts.emailPlaceholder}
|
|
55
|
+
name="email"
|
|
56
|
+
startAdornment={
|
|
57
|
+
<InputAdornment position="start">
|
|
58
|
+
<EmailIcon />
|
|
59
|
+
</InputAdornment>
|
|
60
|
+
}
|
|
61
|
+
rules={{
|
|
62
|
+
required: props.texts.emailRequiredText,
|
|
63
|
+
pattern: {
|
|
64
|
+
value:
|
|
65
|
+
/^(([^<>()[\]\\.,;:\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,}))$/,
|
|
66
|
+
message: props.texts.emailInvalidText
|
|
63
67
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
}}
|
|
69
|
+
helperText={errors.email?.message}
|
|
70
|
+
/>
|
|
71
|
+
<HawaTextField
|
|
72
|
+
fullWidth
|
|
73
|
+
name="password"
|
|
74
|
+
placeholder={props.texts.passwordPlaceholder}
|
|
75
|
+
type="password"
|
|
76
|
+
label={props.texts.passwordLabel}
|
|
77
|
+
startAdornment={
|
|
78
|
+
<InputAdornment position="start">
|
|
79
|
+
<PasswordIcon />
|
|
80
|
+
</InputAdornment>
|
|
81
|
+
}
|
|
82
|
+
rules={{
|
|
83
|
+
required: props.texts.passwordRequiredText,
|
|
84
|
+
minLength: {
|
|
85
|
+
value: 8,
|
|
86
|
+
message: props.texts.passwordTooShortText
|
|
83
87
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
}}
|
|
89
|
+
helperText={errors.password?.message}
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
<Button fullWidth variant="last" type="submit">
|
|
93
|
+
{props.texts.signUpText}
|
|
94
|
+
</Button>
|
|
95
|
+
</form>
|
|
96
|
+
</FormProvider>
|
|
93
97
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</FormProvider>
|
|
97
|
-
</Box>
|
|
98
|
-
<HawaTypography
|
|
98
|
+
<Typography
|
|
99
|
+
variant="subtitle2"
|
|
99
100
|
style={{
|
|
100
101
|
marginTop: 5,
|
|
101
|
-
// width: "max-content",
|
|
102
102
|
textAlign: "center",
|
|
103
103
|
padding: 5
|
|
104
104
|
}}
|
|
105
105
|
>
|
|
106
106
|
Existing user?{" "}
|
|
107
107
|
<span
|
|
108
|
-
onClick={
|
|
108
|
+
onClick={props.handleRouteToSignIn}
|
|
109
109
|
style={{
|
|
110
110
|
cursor: "pointer",
|
|
111
111
|
color: "blue",
|
|
112
112
|
textAlign: "center"
|
|
113
113
|
}}
|
|
114
114
|
>
|
|
115
|
-
|
|
115
|
+
{props.texts.signInText}
|
|
116
116
|
</span>
|
|
117
|
-
</
|
|
118
|
-
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
117
|
+
</Typography>
|
|
118
|
+
<div style={{ display: "flex", flexDirection: "column" }}>
|
|
119
|
+
{props.viaGoogle && (
|
|
120
|
+
<HawaLogoButton
|
|
121
|
+
logo="google"
|
|
122
|
+
buttonText={props.texts.googleButtonLabel}
|
|
123
|
+
onClick={props.handleGoogleSignUp}
|
|
124
|
+
/>
|
|
125
|
+
)}
|
|
126
|
+
{props.viaGithub && (
|
|
127
|
+
<HawaLogoButton
|
|
128
|
+
logo="github"
|
|
129
|
+
buttonText={props.texts.githubButtonLabel}
|
|
130
|
+
onClick={props.handleGithubSignUp}
|
|
131
|
+
/>
|
|
132
|
+
)}
|
|
133
|
+
{props.viaTwitter && (
|
|
134
|
+
<HawaLogoButton
|
|
135
|
+
logo="twitter"
|
|
136
|
+
buttonText={props.texts.twitterButtonLabel}
|
|
137
|
+
onClick={props.handleTwitterSignUp}
|
|
138
|
+
/>
|
|
139
|
+
)}
|
|
140
|
+
</div>
|
|
141
|
+
</Container>
|
|
140
142
|
);
|
|
141
143
|
};
|
|
142
144
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { HawaTextField
|
|
3
|
-
import { Box } from "../../layout";
|
|
2
|
+
import { HawaTextField } from "../../elements";
|
|
4
3
|
import { FormProvider, useForm } from "react-hook-form";
|
|
4
|
+
import Container from "@mui/material/Container";
|
|
5
|
+
import Button from "@mui/material/Button";
|
|
6
|
+
import Typography from "@mui/material/Typography";
|
|
5
7
|
|
|
6
8
|
export const ChargeWalletForm = (props) => {
|
|
7
9
|
const [walletAmount, setWalletAmount] = useState(0);
|
|
@@ -12,42 +14,43 @@ export const ChargeWalletForm = (props) => {
|
|
|
12
14
|
} = methods;
|
|
13
15
|
|
|
14
16
|
return (
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
<Container maxWidth="xs">
|
|
18
|
+
<Typography align="center" variant="h1">
|
|
19
|
+
{Number(walletAmount).toLocaleString("en") || "0"}
|
|
20
|
+
<Typography>{props.currency || "SAR"}</Typography>
|
|
21
|
+
</Typography>
|
|
22
|
+
<FormProvider {...methods}>
|
|
23
|
+
<form
|
|
24
|
+
onChange={(e) => {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
setWalletAmount(methods.getValues().amount);
|
|
27
|
+
}}
|
|
28
|
+
style={{ marginTop: 10 }}
|
|
29
|
+
onSubmit={handleSubmit(props.handleChargeWallet)}
|
|
30
|
+
>
|
|
31
|
+
<HawaTextField
|
|
32
|
+
fullWidth
|
|
33
|
+
name="amount"
|
|
34
|
+
placeholder="Enter amount"
|
|
35
|
+
type="number"
|
|
36
|
+
value={walletAmount}
|
|
37
|
+
rules={{
|
|
38
|
+
required: "Password is rquired"
|
|
28
39
|
}}
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
helperText={errors.amount?.message}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<Button
|
|
44
|
+
type="submit"
|
|
45
|
+
fullWidth
|
|
46
|
+
variant="last"
|
|
47
|
+
onClick={props.handleSignIn}
|
|
31
48
|
>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
required: "Password is rquired"
|
|
39
|
-
}}
|
|
40
|
-
helperText={errors.amount?.message}
|
|
41
|
-
/>
|
|
42
|
-
<ActionButton
|
|
43
|
-
last
|
|
44
|
-
fullWidth
|
|
45
|
-
text={"Charge Wallet"} //move this to props
|
|
46
|
-
onClick={props.handleSignIn}
|
|
47
|
-
/>
|
|
48
|
-
</form>
|
|
49
|
-
</FormProvider>
|
|
50
|
-
</Box>
|
|
51
|
-
</Box>
|
|
49
|
+
{/* {props.texts.signInText} */}
|
|
50
|
+
{"Charge Wallet"}
|
|
51
|
+
</Button>
|
|
52
|
+
</form>
|
|
53
|
+
</FormProvider>
|
|
54
|
+
</Container>
|
|
52
55
|
);
|
|
53
56
|
};
|