@sikka/hawa 0.0.5 → 0.0.8

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 (83) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +4 -5
  4. package/src/blocks/Account/UserProfile.js +57 -7
  5. package/src/blocks/AuthForms/NewPasswordForm.js +100 -17
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +61 -5
  7. package/src/blocks/AuthForms/SignInForm.js +101 -26
  8. package/src/blocks/AuthForms/SignUpForm.js +113 -32
  9. package/src/blocks/Payment/ChargeWalletForm.js +53 -0
  10. package/src/blocks/Payment/CreditCardForm.js +50 -21
  11. package/src/blocks/Payment/PayWithWallet.js +14 -0
  12. package/src/blocks/Payment/SelectPayment.js +20 -42
  13. package/src/blocks/Payment/index.js +2 -0
  14. package/src/layout/Box.js +9 -10
  15. package/src/stories/BlocksStories/AuthForm.stories.js +18 -12
  16. package/src/stories/BlocksStories/PaymentForm.stories.js +15 -40
  17. package/src/stories/BlocksStories/UserForm.stories.js +41 -0
  18. package/src/stories/{Introduction.stories.js → Introduction.stories.mdx} +45 -27
  19. package/src/stories/LayoutStories/Box.stories.js +4 -4
  20. package/src/stories/{ActionButton.stories.js → UIStories/ActionButton.stories.js} +16 -23
  21. package/src/stories/UIStories/AdaptiveButton.stories.js +81 -0
  22. package/src/stories/UIStories/Alert.stories.js +42 -0
  23. package/src/stories/{CheckBox.stories.js → UIStories/CheckBox.stories.js} +3 -4
  24. package/src/stories/UIStories/InputLabel.stories.js +13 -0
  25. package/src/stories/UIStories/LogoButtons.stories.js +90 -0
  26. package/src/stories/UIStories/RadioSelector.stories.js +53 -0
  27. package/src/stories/UIStories/SettingsRow.stories.js +64 -0
  28. package/src/stories/{TextField.stories.js → UIStories/TextField.stories.js} +4 -5
  29. package/src/themes/HawaProvider.js +107 -11
  30. package/src/ui/ActionButton.js +12 -11
  31. package/src/ui/AdaptiveButton.js +43 -159
  32. package/src/ui/HawaAlert.js +37 -0
  33. package/src/ui/HawaButton.js +48 -0
  34. package/src/ui/{Checkbox.js → HawaCheckbox.js} +1 -1
  35. package/src/ui/HawaInputLabel.js +4 -5
  36. package/src/ui/HawaLogoButton.js +138 -0
  37. package/src/ui/HawaRadio.js +73 -0
  38. package/src/ui/HawaSettingsRow.js +71 -0
  39. package/src/ui/HawaTextField.js +69 -80
  40. package/src/ui/HawaTypography.js +28 -0
  41. package/src/ui/index.js +9 -19
  42. package/storybook-static/{1.95be85dd.iframe.bundle.js → 0.0d994c92.iframe.bundle.js} +3 -3
  43. package/storybook-static/{1.95be85dd.iframe.bundle.js.LICENSE.txt → 0.0d994c92.iframe.bundle.js.LICENSE.txt} +0 -0
  44. package/storybook-static/0.0d994c92.iframe.bundle.js.map +1 -0
  45. package/storybook-static/1.aabc3f3a.iframe.bundle.js +1 -0
  46. package/storybook-static/{3.d72f7fac.iframe.bundle.js → 2.430bf1e3.iframe.bundle.js} +1 -1
  47. package/storybook-static/{7.ffb0d84b.iframe.bundle.js → 6.704d1e8d.iframe.bundle.js} +1 -1
  48. package/storybook-static/{8.68cd1217.iframe.bundle.js → 7.9ce807e3.iframe.bundle.js} +3 -3
  49. package/storybook-static/{8.68cd1217.iframe.bundle.js.LICENSE.txt → 7.9ce807e3.iframe.bundle.js.LICENSE.txt} +0 -0
  50. package/storybook-static/7.9ce807e3.iframe.bundle.js.map +1 -0
  51. package/storybook-static/{9.488e3969.iframe.bundle.js → 8.c4cb6081.iframe.bundle.js} +1 -1
  52. package/storybook-static/iframe.html +1 -1
  53. package/storybook-static/main.5731dbe3.iframe.bundle.js +1 -0
  54. package/storybook-static/runtime~main.cfefe972.iframe.bundle.js +1 -0
  55. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +76 -0
  56. package/storybook-static/{vendors~main.d75dc38b.iframe.bundle.js.LICENSE.txt → vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt} +0 -0
  57. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +1 -0
  58. package/src/stories/AdaptiveButton.stories.js +0 -80
  59. package/src/stories/Alert.stories.js +0 -41
  60. package/src/stories/BlocksStories/UserAccount.stories.js +0 -46
  61. package/src/stories/GlobalVariables.stories.js +0 -44
  62. package/src/stories/InputLabel.stories.js +0 -92
  63. package/src/stories/RadioSelector.stories.js +0 -69
  64. package/src/ui/ApplePayButton.js +0 -94
  65. package/src/ui/GithubButton.js +0 -91
  66. package/src/ui/GoogleButton.js +0 -83
  67. package/src/ui/GooglePayButton.js +0 -94
  68. package/src/ui/MadaButton.js +0 -94
  69. package/src/ui/PayPalButton.js +0 -94
  70. package/src/ui/RadioSelector.js +0 -51
  71. package/src/ui/STCPayButton.js +0 -94
  72. package/src/ui/StyledAlert.js +0 -30
  73. package/src/ui/TwitterButton.js +0 -84
  74. package/src/ui/VisaMasterButton.js +0 -94
  75. package/src/ui/WalletButton.js +0 -91
  76. package/storybook-static/0.54f7e52e.iframe.bundle.js +0 -1
  77. package/storybook-static/1.95be85dd.iframe.bundle.js.map +0 -1
  78. package/storybook-static/2.eb601582.iframe.bundle.js +0 -1
  79. package/storybook-static/8.68cd1217.iframe.bundle.js.map +0 -1
  80. package/storybook-static/main.044648aa.iframe.bundle.js +0 -1
  81. package/storybook-static/runtime~main.3e280e98.iframe.bundle.js +0 -1
  82. package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js +0 -76
  83. package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js.map +0 -1
@@ -2,50 +2,125 @@ import React from "react";
2
2
  import {
3
3
  HawaTextField,
4
4
  ActionButton,
5
- GoogleButton,
6
- TwitterButton,
7
- GithubButton
5
+ HawaAlert,
6
+ HawaTypography,
7
+ HawaLogoButton
8
8
  } from "../../ui";
9
9
  import { Box } from "../../layout";
10
+ import { FormProvider, useForm } from "react-hook-form";
11
+
12
+ import InputAdornment from "@mui/material/InputAdornment";
13
+ import EmailIcon from "@mui/icons-material/MailOutline";
14
+ import PasswordIcon from "@mui/icons-material/HttpsOutlined";
10
15
 
11
16
  export const SignInForm = (props) => {
17
+ const methods = useForm();
18
+ const {
19
+ formState: { errors },
20
+ handleSubmit
21
+ } = methods;
22
+
12
23
  return (
13
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
14
- <Box themeType={props.theme} noMargin>
15
- <HawaTextField themeType={props.theme} type="text" inputLabel="Email" />
24
+ <Box maxWidth={400} noColor noMargin noPadding>
25
+ <Box noMargin>
26
+ {props.error && (
27
+ <HawaAlert text="This is a sign in alert" severity="error" />
28
+ )}
29
+ <FormProvider {...methods}>
30
+ <form onSubmit={handleSubmit(props.handleSignIn)}>
31
+ <HawaTextField
32
+ type="text"
33
+ name="email"
34
+ inputLabel="Email"
35
+ placeholder="Enter your email"
36
+ startAdornment={
37
+ <InputAdornment position="start">
38
+ <EmailIcon />
39
+ </InputAdornment>
40
+ }
41
+ rules={{
42
+ required: "Email is required",
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: "Invalid email address"
47
+ }
48
+ }}
49
+ helperText={errors.email?.message}
50
+ />
16
51
 
17
- <HawaTextField
18
- themeType={props.theme}
19
- type="text"
20
- inputLabel="Password"
21
- />
22
- <ActionButton
23
- last
24
- text={"Sign In"}
25
- themeType={props.theme}
26
- onClick={props.handleSignIn}
27
- />
52
+ <HawaTextField
53
+ name="password"
54
+ placeholder="Enter password"
55
+ type="password"
56
+ inputLabel="Password"
57
+ startAdornment={
58
+ <InputAdornment position="start">
59
+ <PasswordIcon />
60
+ </InputAdornment>
61
+ }
62
+ rules={{
63
+ required: "Password is rquired"
64
+ }}
65
+ helperText={errors.password?.message}
66
+ />
67
+ <HawaTypography
68
+ style={{
69
+ cursor: "pointer",
70
+ marginTop: 5,
71
+ width: "max-content",
72
+ padding: 5
73
+ }}
74
+ onClick={() => console.log("res")}
75
+ >
76
+ Forgot password?
77
+ </HawaTypography>
78
+ <ActionButton
79
+ type="submit"
80
+ fullWidth
81
+ last={"true"}
82
+ text={"Sign In"}
83
+ />
84
+ </form>
85
+ </FormProvider>
28
86
  </Box>
87
+ <HawaTypography
88
+ style={{
89
+ marginTop: 5,
90
+ // width: "max-content",
91
+ textAlign: "center",
92
+ padding: 5
93
+ }}
94
+ >
95
+ New user?{" "}
96
+ <span
97
+ onClick={() => console.log("res")}
98
+ style={{
99
+ cursor: "pointer",
100
+ color: "blue",
101
+ textAlign: "center"
102
+ }}
103
+ >
104
+ Sign up
105
+ </span>
106
+ </HawaTypography>
29
107
  {props.viaGoogle && (
30
- <GoogleButton
31
- themeType={props.theme}
32
- outlined
108
+ <HawaLogoButton
109
+ logo="google"
33
110
  buttonText={props.googleButtonLabel}
34
111
  handleClick={props.handleGoogleSignIn}
35
112
  />
36
113
  )}
37
114
  {props.viaGithub && (
38
- <GithubButton
39
- outlined
40
- themeType={props.theme}
115
+ <HawaLogoButton
116
+ logo="github"
41
117
  buttonText={props.githubButtonLabel}
42
118
  handleClick={props.handleGithubSignIn}
43
119
  />
44
120
  )}
45
121
  {props.viaTwitter && (
46
- <TwitterButton
47
- outlined
48
- themeType={props.theme}
122
+ <HawaLogoButton
123
+ logo="twitter"
49
124
  buttonText={props.twitterButtonLabel}
50
125
  handleClick={props.handleTwitterSignIn}
51
126
  />
@@ -3,54 +3,135 @@ import { Box } from "../../layout";
3
3
  import {
4
4
  HawaTextField,
5
5
  ActionButton,
6
- GoogleButton,
7
- GithubButton,
8
- TwitterButton
6
+ HawaAlert,
7
+ HawaTypography,
8
+ HawaLogoButton
9
9
  } from "../../ui";
10
10
  import PropTypes from "prop-types";
11
+ import { FormProvider, useForm } from "react-hook-form";
12
+
13
+ import PersonIcon from "@mui/icons-material/PermIdentityOutlined";
14
+ import InputAdornment from "@mui/material/InputAdornment";
15
+ import EmailIcon from "@mui/icons-material/MailOutline";
16
+ import PasswordIcon from "@mui/icons-material/HttpsOutlined";
11
17
 
12
18
  export const SignUpForm = (props) => {
19
+ const methods = useForm();
20
+ const {
21
+ formState: { errors },
22
+ handleSubmit,
23
+ getValues,
24
+ register,
25
+ watch,
26
+ reset,
27
+ setValue
28
+ } = methods;
29
+
13
30
  return (
14
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
15
- <Box themeType={props.theme} noMargin>
16
- <HawaTextField themeType={props.theme} type="text" inputLabel="Email" />
17
- <HawaTextField
18
- themeType={props.theme}
19
- type="text"
20
- inputLabel="Password"
21
- />
22
- <HawaTextField
23
- themeType={props.theme}
24
- type="text"
25
- inputLabel="Confirm Password"
26
- />
27
- <ActionButton
28
- text="Sign Up"
29
- last
30
- themeType={props.theme}
31
- onClick={props.handleSignUp}
32
- />
31
+ <Box maxWidth={400} noColor noMargin noPadding>
32
+ <Box noMargin>
33
+ {props.error && (
34
+ <HawaAlert text="This is a sign in alert" severity="error" />
35
+ )}
36
+ <FormProvider {...methods}>
37
+ <form onSubmit={handleSubmit(props.handleSignUp)}>
38
+ <HawaTextField
39
+ name="fullName"
40
+ placeholder="Fulan AlFulani"
41
+ type="text"
42
+ inputLabel="Full Name"
43
+ startAdornment={
44
+ <InputAdornment position="start">
45
+ <PersonIcon />
46
+ </InputAdornment>
47
+ }
48
+ rules={{
49
+ required: "Full name rquired"
50
+ }}
51
+ helperText={errors.fullName?.message}
52
+ />
53
+
54
+ <HawaTextField
55
+ type="text"
56
+ inputLabel="Email"
57
+ placeholder="Enter your email"
58
+ name="email"
59
+ startAdornment={
60
+ <InputAdornment position="start">
61
+ <EmailIcon />
62
+ </InputAdornment>
63
+ }
64
+ rules={{
65
+ required: "Email required",
66
+ pattern: {
67
+ value:
68
+ /^(([^<>()[\]\\.,;:\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,}))$/,
69
+ message: "Invalid email address"
70
+ }
71
+ }}
72
+ helperText={errors.email?.message}
73
+ />
74
+ <HawaTextField
75
+ name="password"
76
+ placeholder="Minimum 8 characters"
77
+ type="password"
78
+ inputLabel="Password"
79
+ startAdornment={
80
+ <InputAdornment position="start">
81
+ <PasswordIcon />
82
+ </InputAdornment>
83
+ }
84
+ rules={{
85
+ required: "Password rquired",
86
+ minLength: {
87
+ value: 8,
88
+ message: "Password too short"
89
+ }
90
+ }}
91
+ helperText={errors.password?.message}
92
+ />
93
+
94
+ <ActionButton fullWidth type="submit" text="Sign Up" last />
95
+ </form>
96
+ </FormProvider>
33
97
  </Box>
98
+ <HawaTypography
99
+ style={{
100
+ marginTop: 5,
101
+ // width: "max-content",
102
+ textAlign: "center",
103
+ padding: 5
104
+ }}
105
+ >
106
+ Existing user?{" "}
107
+ <span
108
+ onClick={() => console.log("res")}
109
+ style={{
110
+ cursor: "pointer",
111
+ color: "blue",
112
+ textAlign: "center"
113
+ }}
114
+ >
115
+ Sign in
116
+ </span>
117
+ </HawaTypography>
34
118
  {props.viaGoogle && (
35
- <GoogleButton
36
- outlined
37
- themeType={props.theme}
119
+ <HawaLogoButton
120
+ logo="google"
38
121
  buttonText={props.googleButtonLabel}
39
122
  handleClick={props.handleGoogleSignIn}
40
123
  />
41
124
  )}
42
125
  {props.viaGithub && (
43
- <GithubButton
44
- outlined
45
- themeType={props.theme}
126
+ <HawaLogoButton
127
+ logo="github"
46
128
  buttonText={props.githubButtonLabel}
47
- handleClick={props.handleGithubSignUp}
129
+ handleClick={props.handleGithubSignIn}
48
130
  />
49
131
  )}
50
132
  {props.viaTwitter && (
51
- <TwitterButton
52
- outlined
53
- themeType={props.theme}
133
+ <HawaLogoButton
134
+ logo="twitter"
54
135
  buttonText={props.twitterButtonLabel}
55
136
  handleClick={props.handleTwitterSignIn}
56
137
  />
@@ -0,0 +1,53 @@
1
+ import React, { useState } from "react";
2
+ import { HawaTextField, ActionButton, HawaTypography } from "../../ui";
3
+ import { Box } from "../../layout";
4
+ import { FormProvider, useForm } from "react-hook-form";
5
+
6
+ export const ChargeWalletForm = (props) => {
7
+ const [walletAmount, setWalletAmount] = useState(0);
8
+ const methods = useForm();
9
+ const {
10
+ formState: { errors },
11
+ handleSubmit
12
+ } = methods;
13
+
14
+ return (
15
+ <Box maxWidth={400} noColor noMargin noPadding>
16
+ <Box noMargin>
17
+ <HawaTypography variant="h2" align="center">
18
+ {Number(walletAmount).toLocaleString("en")}{" "}
19
+ <span style={{ fontSize: 20, letterSpacing: 1 }}>
20
+ {props.currency}
21
+ </span>
22
+ </HawaTypography>
23
+ <FormProvider {...methods}>
24
+ <form
25
+ onChange={(e) => {
26
+ e.preventDefault();
27
+ setWalletAmount(methods.getValues().amount);
28
+ }}
29
+ style={{ marginTop: 10 }}
30
+ onSubmit={handleSubmit(props.handleChargeWallet)}
31
+ >
32
+ <HawaTextField
33
+ name="amount"
34
+ placeholder="Enter amount"
35
+ type="number"
36
+ value={walletAmount}
37
+ rules={{
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>
52
+ );
53
+ };
@@ -1,30 +1,59 @@
1
1
  import React from "react";
2
- import {
3
- HawaTextField,
4
- ActionButton,
5
- GoogleButton,
6
- TwitterButton,
7
- GithubButton
8
- } from "../../ui";
2
+ import { HawaTextField, ActionButton } from "../../ui";
9
3
  import { Box } from "../../layout";
4
+ import { FormProvider, useForm } from "react-hook-form";
10
5
 
11
6
  export const CreditCardForm = (props) => {
7
+ const methods = useForm();
8
+ const {
9
+ formState: { errors },
10
+ handleSubmit
11
+ } = methods;
12
+
12
13
  return (
13
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
14
- <Box themeType={props.theme} noMargin>
15
- <HawaTextField themeType={props.theme} type="text" inputLabel="Email" />
14
+ <Box maxWidth={400} noColor noMargin noPadding>
15
+ <Box noMargin>
16
+ <FormProvider {...methods}>
17
+ <form onSubmit={handleSubmit(props.handle)}>
18
+ <HawaTextField
19
+ name="password"
20
+ placeholder="Enter password"
21
+ type="password"
22
+ inputLabel="Password"
23
+ // startAdornment={
24
+ // <InputAdornment position="start">
25
+ // <PasswordIcon />
26
+ // </InputAdornment>
27
+ // }
28
+ rules={{
29
+ required: "Password is rquired"
30
+ }}
31
+ helperText={errors.password?.message}
32
+ />
16
33
 
17
- <HawaTextField
18
- themeType={props.theme}
19
- type="text"
20
- inputLabel="Password"
21
- />
22
- <ActionButton
23
- last
24
- text={"Sign In"}
25
- themeType={props.theme}
26
- onClick={props.handleSignIn}
27
- />
34
+ <HawaTextField
35
+ name="password"
36
+ placeholder="Enter password"
37
+ type="password"
38
+ inputLabel="Password"
39
+ // startAdornment={
40
+ // <InputAdornment position="start">
41
+ // <PasswordIcon />
42
+ // </InputAdornment>
43
+ // }
44
+ rules={{
45
+ required: "Password is rquired"
46
+ }}
47
+ helperText={errors.password?.message}
48
+ />
49
+ <ActionButton
50
+ last
51
+ fullWidth
52
+ text={"Sign In"}
53
+ onClick={props.handleSignIn}
54
+ />
55
+ </form>
56
+ </FormProvider>
28
57
  </Box>
29
58
  </Box>
30
59
  );
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { ActionButton } from "../../ui";
3
+ import { Box } from "../../layout";
4
+
5
+ export const PayWithWallet = (props) => {
6
+ return (
7
+ <Box maxWidth={400} noColor noMargin noPadding>
8
+ <Box noMargin>
9
+ <div>Wallet Balance</div>
10
+ <ActionButton text="Pay now" />
11
+ </Box>
12
+ </Box>
13
+ );
14
+ };
@@ -1,80 +1,58 @@
1
1
  import React from "react";
2
- import {
3
- HawaTextField,
4
- ActionButton,
5
- GoogleButton,
6
- TwitterButton,
7
- GithubButton,
8
- VisaMasterButton,
9
- MadaButton,
10
- STCPayButton,
11
- PayPalButton,
12
- GooglePayButton,
13
- ApplePayButton,
14
- WalletButton
15
- } from "../../ui";
16
- import { Box } from "../../layout";
17
2
  import PropTypes from "prop-types";
3
+ import { Box } from "../../layout";
4
+ import { HawaTextField, HawaTypography, HawaLogoButton } from "../../ui";
18
5
 
19
6
  export const SelectPayment = (props) => {
20
7
  return (
21
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
22
- <Box themeType={props.theme} noMargin>
23
- <div>Choose Payment</div>
8
+ <Box maxWidth={400} noColor noMargin noPadding>
9
+ <Box noMargin>
10
+ <HawaTypography align="center">Choose Payment Method</HawaTypography>
24
11
  {props.viaWallet && (
25
- <WalletButton
26
- themeType={props.theme}
27
- outlined
12
+ <HawaLogoButton
13
+ logo="wallet"
28
14
  buttonText={props.walletLabel}
29
- handleClick={props.handleWallet}
15
+ onClick={props.handleWallet}
30
16
  />
31
17
  )}
32
18
  {props.viaCreditCard && (
33
- <VisaMasterButton
34
- themeType={props.theme}
35
- outlined
19
+ <HawaLogoButton
20
+ logo="visa/master"
36
21
  buttonText={props.visaMasterLabel}
37
22
  handleClick={props.handleCreditCard}
38
23
  />
39
24
  )}
40
25
  {props.viaMada && (
41
- <MadaButton
42
- themeType={props.theme}
43
- outlined
26
+ <HawaLogoButton
27
+ logo="mada"
44
28
  buttonText={props.madaLabel}
45
29
  handleClick={props.handleMada}
46
30
  />
47
31
  )}
48
-
49
32
  {props.viaSTCPay && (
50
- <STCPayButton
51
- themeType={props.theme}
52
- outlined
33
+ <HawaLogoButton
34
+ logo="stcpay"
53
35
  buttonText={props.stcPayLabel}
54
36
  handleClick={props.handleSTCPay}
55
37
  />
56
38
  )}
57
39
  {props.viaPayPal && (
58
- <PayPalButton
59
- themeType={props.theme}
60
- outlined
40
+ <HawaLogoButton
41
+ logo="paypal"
61
42
  buttonText={props.paypalLabel}
62
43
  handleClick={props.handlePayPal}
63
44
  />
64
45
  )}
65
46
  {props.viaGooglePay && (
66
- <GooglePayButton
67
- themeType={props.theme}
68
- outlined
47
+ <HawaLogoButton
48
+ logo="googlepay"
69
49
  buttonText={props.googlePayLabel}
70
50
  handleClick={props.handleGooglePay}
71
51
  />
72
52
  )}
73
-
74
53
  {props.viaApplePay && (
75
- <ApplePayButton
76
- themeType={props.theme}
77
- outlined
54
+ <HawaLogoButton
55
+ logo="applepay"
78
56
  buttonText={props.applePayLabel}
79
57
  handleClick={props.handleApplePay}
80
58
  />
@@ -14,3 +14,5 @@
14
14
 
15
15
  export * from "./SelectPayment";
16
16
  export * from "./CreditCardForm";
17
+ export * from "./ChargeWalletForm";
18
+ export * from "./PayWithWallet";
package/src/layout/Box.js CHANGED
@@ -2,29 +2,28 @@ import React, { useContext } from "react";
2
2
  import { ThemeProvider } from "../themes/HawaProvider";
3
3
 
4
4
  export const Box = (props) => {
5
- const theme = useContext(ThemeProvider);
5
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
6
6
  let boxStyle = {};
7
7
 
8
- console.log(Object.keys(theme.actionButton));
9
- let currentTheme = Object.keys(theme.actionButton).find(
10
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
8
+ let currentTheme = Object.keys(hawaTheme.layout).find(
9
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
11
10
  );
12
11
  if (currentTheme) {
13
12
  boxStyle = {
14
13
  display: "flex",
15
- flexDirection: "column",
16
- ...theme.layout[currentTheme],
14
+ flexDirection: props.horizontal ? "row" : "column",
15
+ ...hawaTheme.layout[currentTheme],
17
16
  backgroundColor: props.noColor
18
17
  ? "none"
19
- : theme.layout[currentTheme].backgroundColor,
20
- padding: props.noPadding ? 0 : theme.layout[currentTheme].padding,
21
- margin: props.noMargin ? 0 : theme.layout[currentTheme].margin,
18
+ : hawaTheme.layout[currentTheme].backgroundColor,
19
+ padding: props.noPadding ? 0 : hawaTheme.layout[currentTheme].padding,
20
+ margin: props.noMargin ? 0 : hawaTheme.layout[currentTheme].margin,
22
21
  maxWidth: props.maxWidth
23
22
  };
24
23
  } else {
25
24
  boxStyle = {
26
25
  display: "flex",
27
- flexDirection: "column",
26
+ flexDirection: props.horizontal ? "row" : "column",
28
27
  color: "white",
29
28
  marginTop: props.last ? 10 * 2 : 0,
30
29
  backgroundColor: props.noColor ? "none" : "lightGrey",