@sikka/hawa 0.0.6 → 0.0.7
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 +1 -1
- package/src/blocks/Account/UserProfile.js +57 -7
- package/src/blocks/AuthForms/NewPasswordForm.js +20 -19
- package/src/blocks/AuthForms/ResetPasswordForm.js +12 -15
- package/src/blocks/AuthForms/SignInForm.js +20 -25
- package/src/blocks/AuthForms/SignUpForm.js +44 -37
- package/src/blocks/Payment/ChargeWalletForm.js +38 -17
- package/src/blocks/Payment/CreditCardForm.js +50 -21
- package/src/blocks/Payment/PayWithWallet.js +4 -25
- package/src/blocks/Payment/SelectPayment.js +3 -21
- package/src/layout/Box.js +9 -9
- package/src/stories/BlocksStories/AuthForm.stories.js +4 -6
- package/src/stories/BlocksStories/PaymentForm.stories.js +10 -6
- package/src/stories/BlocksStories/UserForm.stories.js +41 -0
- package/src/stories/LayoutStories/Box.stories.js +4 -4
- package/src/stories/UIStories/ActionButton.stories.js +2 -2
- package/src/stories/UIStories/Alert.stories.js +4 -17
- package/src/stories/UIStories/RadioSelector.stories.js +20 -35
- package/src/stories/UIStories/SettingsRow.stories.js +64 -0
- package/src/themes/HawaProvider.js +57 -18
- package/src/ui/ActionButton.js +11 -8
- package/src/ui/ApplePayButton.js +4 -71
- package/src/ui/GithubButton.js +4 -70
- package/src/ui/GoogleButton.js +4 -63
- package/src/ui/GooglePayButton.js +5 -72
- package/src/ui/HawaAlert.js +5 -5
- package/src/ui/HawaButton.js +6 -6
- package/src/ui/HawaInputLabel.js +4 -4
- package/src/ui/HawaLogoButton.js +6 -11
- package/src/ui/HawaRadio.js +50 -28
- package/src/ui/HawaSettingsRow.js +71 -0
- package/src/ui/HawaTextField.js +31 -34
- package/src/ui/HawaTypography.js +4 -4
- package/src/ui/MadaButton.js +5 -72
- package/src/ui/PayPalButton.js +4 -71
- package/src/ui/STCPayButton.js +5 -72
- package/src/ui/TwitterButton.js +3 -59
- package/src/ui/VisaMasterButton.js +4 -71
- package/src/ui/index.js +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.b7ffaed0.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.8ebae370.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt → vendors~main.8ebae370.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.8ebae370.iframe.bundle.js.map +1 -0
- package/src/stories/BlocksStories/UserAccount.stories.js +0 -46
- package/storybook-static/main.e55ce615.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +0 -1
|
@@ -2,50 +2,39 @@ import React from "react";
|
|
|
2
2
|
import { HawaProvider } from "../../themes/HawaProvider";
|
|
3
3
|
import { HawaRadio } from "../../ui";
|
|
4
4
|
|
|
5
|
-
const Template = (args) => {
|
|
6
|
-
const theme = {
|
|
7
|
-
borderRadius: 5,
|
|
8
|
-
primaryColor: "green",
|
|
9
|
-
secondaryColor: "red",
|
|
10
|
-
// margins: "10px",
|
|
11
|
-
paddings: 10
|
|
12
|
-
};
|
|
13
|
-
return (
|
|
14
|
-
<HawaProvider theme={theme}>
|
|
15
|
-
<HawaRadio {...args} />
|
|
16
|
-
</HawaProvider>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
5
|
export default {
|
|
20
6
|
title: "UI/RadioSelector",
|
|
21
7
|
component: HawaRadio,
|
|
22
8
|
argTypes: {
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
theme: {
|
|
10
|
+
options: ["primary", "secondary", "default"],
|
|
11
|
+
control: { type: "select" }
|
|
25
12
|
}
|
|
26
13
|
},
|
|
27
14
|
args: {
|
|
28
|
-
|
|
29
|
-
{ text: "Option 1", label: "option1" },
|
|
30
|
-
{ text: "Option 2", label: "option2" },
|
|
31
|
-
{ text: "Option 3", label: "option3" }
|
|
32
|
-
]
|
|
15
|
+
theme: "primary"
|
|
33
16
|
}
|
|
34
17
|
};
|
|
35
18
|
|
|
19
|
+
const Template = (args) => {
|
|
20
|
+
return (
|
|
21
|
+
<HawaProvider themeName={args.theme}>
|
|
22
|
+
<HawaRadio
|
|
23
|
+
defaultValue="option1"
|
|
24
|
+
options={[
|
|
25
|
+
{ text: "Option 1", label: "option1" },
|
|
26
|
+
{ text: "Option 2", label: "option2" },
|
|
27
|
+
{ text: "Option 3", label: "option3" }
|
|
28
|
+
]}
|
|
29
|
+
/>
|
|
30
|
+
</HawaProvider>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
36
33
|
export const Light = Template.bind({});
|
|
37
34
|
|
|
38
35
|
Light.args = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{ text: "Option 2", label: "option2" },
|
|
42
|
-
{ text: "Option 3", label: "option3" }
|
|
43
|
-
],
|
|
44
|
-
selectedColor: "blue",
|
|
45
|
-
borderRadius: 12,
|
|
46
|
-
defaultValue: "option2",
|
|
47
|
-
bgSelectedColor: "red",
|
|
48
|
-
textSelectedColor: "white",
|
|
36
|
+
theme: "primary",
|
|
37
|
+
|
|
49
38
|
handleChange: () => {
|
|
50
39
|
console.log("handleChange goes here");
|
|
51
40
|
}
|
|
@@ -57,11 +46,7 @@ Dark.args = {
|
|
|
57
46
|
{ text: "Option 2", label: "option2" },
|
|
58
47
|
{ text: "Option 3", label: "option3" }
|
|
59
48
|
],
|
|
60
|
-
selectedColor: "blue",
|
|
61
|
-
borderRadius: 12,
|
|
62
49
|
defaultValue: "option2",
|
|
63
|
-
bgSelectedColor: "blue",
|
|
64
|
-
textSelectedColor: "white",
|
|
65
50
|
handleChange: () => {
|
|
66
51
|
console.log("handleChange goes here");
|
|
67
52
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
SelectPayment,
|
|
4
|
+
CreditCardForm,
|
|
5
|
+
ChargeWalletForm,
|
|
6
|
+
PayWithWallet
|
|
7
|
+
} from "../../blocks/Payment";
|
|
8
|
+
import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
|
|
9
|
+
import { HawaSettingsRow } from "../../ui";
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: "UI/SettingsRow",
|
|
13
|
+
component: [SelectPayment, CreditCardForm],
|
|
14
|
+
argTypes: {
|
|
15
|
+
theme: {
|
|
16
|
+
options: ["primary", "secondary", "default"],
|
|
17
|
+
control: { type: "select" }
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
options: ["checkbox", "text", "default"],
|
|
21
|
+
control: { type: "select" }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
theme: "primary",
|
|
26
|
+
type: "checkbox"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const HawaSettingsRowTemplate = (args) => {
|
|
31
|
+
return (
|
|
32
|
+
<HawaProvider themeName={args.theme}>
|
|
33
|
+
<HawaSettingsRow settingsType={args.type} />
|
|
34
|
+
</HawaProvider>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Checkbox = HawaSettingsRowTemplate.bind({});
|
|
39
|
+
Checkbox.args = {
|
|
40
|
+
theme: "primary",
|
|
41
|
+
type: "checkbox"
|
|
42
|
+
};
|
|
43
|
+
export const Text = (args) => {
|
|
44
|
+
return (
|
|
45
|
+
<HawaProvider themeName={args.theme}>
|
|
46
|
+
<HawaSettingsRow settingsType={args.type} />
|
|
47
|
+
</HawaProvider>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
Text.args = {
|
|
51
|
+
theme: "primary",
|
|
52
|
+
type: "text"
|
|
53
|
+
};
|
|
54
|
+
export const Radio = (args) => {
|
|
55
|
+
return (
|
|
56
|
+
<HawaProvider themeName={args.theme}>
|
|
57
|
+
<HawaSettingsRow settingsType={args.type} />
|
|
58
|
+
</HawaProvider>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
Radio.args = {
|
|
62
|
+
theme: "primary",
|
|
63
|
+
type: "radio"
|
|
64
|
+
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
|
|
3
3
|
//make the text color of the action buttons different from the text color of the layout
|
|
4
|
+
let allPrimaryBG = "#f90900";
|
|
5
|
+
let allPrimaryAction = "#B20D30";
|
|
4
6
|
export const defaultTheme = {
|
|
7
|
+
allPrimaryBG: "#f90900",
|
|
8
|
+
allPrimaryAction: "#138A36",
|
|
9
|
+
allBorderRadius: 10,
|
|
5
10
|
borderRadius: 10,
|
|
6
11
|
primaryColor: "blue",
|
|
7
12
|
secondaryColor: "grey",
|
|
@@ -16,7 +21,6 @@ export const defaultTheme = {
|
|
|
16
21
|
testcolor: "green",
|
|
17
22
|
margins: 10,
|
|
18
23
|
paddings: 10,
|
|
19
|
-
allBorderRadius: 10,
|
|
20
24
|
typography: {
|
|
21
25
|
primary: { color: "black" },
|
|
22
26
|
secondary: { color: "white" }
|
|
@@ -24,18 +28,20 @@ export const defaultTheme = {
|
|
|
24
28
|
logoButton: {
|
|
25
29
|
primary: {
|
|
26
30
|
borderRadius: 10,
|
|
27
|
-
backgroundColor:
|
|
28
|
-
|
|
31
|
+
backgroundColor: allPrimaryAction,
|
|
32
|
+
// margin: 10,
|
|
33
|
+
marginTop: 10,
|
|
29
34
|
padding: 10,
|
|
30
35
|
border: "1px solid #ced4da",
|
|
31
36
|
height: 50,
|
|
32
37
|
"&:focus": {
|
|
33
|
-
borderColor:
|
|
38
|
+
borderColor: allPrimaryAction
|
|
34
39
|
}
|
|
35
40
|
},
|
|
36
41
|
secondary: {
|
|
37
42
|
borderRadius: 10,
|
|
38
43
|
backgroundColor: "#f90900",
|
|
44
|
+
marginTop: 10,
|
|
39
45
|
padding: 10,
|
|
40
46
|
border: "1px solid #ced4da",
|
|
41
47
|
height: 50,
|
|
@@ -47,7 +53,8 @@ export const defaultTheme = {
|
|
|
47
53
|
actionButton: {
|
|
48
54
|
primary: {
|
|
49
55
|
borderRadius: 10,
|
|
50
|
-
backgroundColor: "#f90900",
|
|
56
|
+
// backgroundColor: "#f90900",
|
|
57
|
+
backgroundColor: allPrimaryAction,
|
|
51
58
|
color: "white",
|
|
52
59
|
margin: 10,
|
|
53
60
|
padding: 10,
|
|
@@ -86,29 +93,26 @@ export const defaultTheme = {
|
|
|
86
93
|
inputFields: {
|
|
87
94
|
primary: {
|
|
88
95
|
backgroundColor: "white",
|
|
89
|
-
display: "flex",
|
|
90
|
-
flexDirection: "column",
|
|
91
|
-
alignItems: "flex-start",
|
|
92
|
-
justifyContent: "flex-start",
|
|
93
96
|
borderRadius: 10,
|
|
94
97
|
"&:focus": {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
borderColor: "red",
|
|
99
|
+
borderWidth: 1,
|
|
100
|
+
border: "1px solid black"
|
|
101
|
+
},
|
|
102
|
+
"&:hover": {
|
|
103
|
+
borderColor: "red",
|
|
104
|
+
borderWidth: 1,
|
|
105
|
+
border: "1px solid black"
|
|
98
106
|
}
|
|
99
107
|
},
|
|
100
108
|
secondary: {
|
|
101
109
|
backgroundColor: "white",
|
|
102
|
-
|
|
103
|
-
flexDirection: "column",
|
|
104
|
-
alignItems: "flex-start",
|
|
105
|
-
justifyContent: "flex-start",
|
|
110
|
+
|
|
106
111
|
borderRadius: 10
|
|
107
112
|
}
|
|
108
113
|
},
|
|
109
114
|
alerts: {
|
|
110
115
|
primary: {
|
|
111
|
-
// marginTop: 10,
|
|
112
116
|
marginBottom: 10,
|
|
113
117
|
padding: 10,
|
|
114
118
|
borderRadius: 10
|
|
@@ -118,12 +122,45 @@ export const defaultTheme = {
|
|
|
118
122
|
padding: 10,
|
|
119
123
|
borderRadius: 10
|
|
120
124
|
}
|
|
125
|
+
},
|
|
126
|
+
settingsRow: {
|
|
127
|
+
primary: {
|
|
128
|
+
display: "flex",
|
|
129
|
+
flexDirection: "row",
|
|
130
|
+
justifyContent: "space-between",
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
backgroundColor: "#F5F5F5",
|
|
133
|
+
margin: 0,
|
|
134
|
+
padding: 10,
|
|
135
|
+
borderRadius: 10
|
|
136
|
+
},
|
|
137
|
+
secondary: {
|
|
138
|
+
display: "flex",
|
|
139
|
+
flexDirection: "row",
|
|
140
|
+
justifyContent: "space-between",
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
backgroundColor: "blue",
|
|
143
|
+
margin: 0,
|
|
144
|
+
padding: 5,
|
|
145
|
+
borderRadius: 10
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
radioSelector: {
|
|
149
|
+
primary: {
|
|
150
|
+
padding: 10,
|
|
151
|
+
borderRadius: 10
|
|
152
|
+
},
|
|
153
|
+
secondary: {
|
|
154
|
+
padding: 10,
|
|
155
|
+
borderRadius: 10
|
|
156
|
+
}
|
|
121
157
|
}
|
|
122
158
|
};
|
|
123
159
|
|
|
124
160
|
export const ThemeProvider = createContext(defaultTheme);
|
|
125
161
|
|
|
126
162
|
export const HawaProvider = ({ theme, ...props }) => {
|
|
163
|
+
console.log("theme is ", theme);
|
|
127
164
|
if (props.size === "large") {
|
|
128
165
|
theme = {
|
|
129
166
|
...theme,
|
|
@@ -132,7 +169,9 @@ export const HawaProvider = ({ theme, ...props }) => {
|
|
|
132
169
|
};
|
|
133
170
|
}
|
|
134
171
|
return (
|
|
135
|
-
<ThemeProvider.Provider
|
|
172
|
+
<ThemeProvider.Provider
|
|
173
|
+
value={{ hawaTheme: defaultTheme, themeName: props.themeName }}
|
|
174
|
+
>
|
|
136
175
|
{props.children}
|
|
137
176
|
</ThemeProvider.Provider>
|
|
138
177
|
);
|
package/src/ui/ActionButton.js
CHANGED
|
@@ -4,20 +4,22 @@ import { ThemeProvider } from "../themes/HawaProvider";
|
|
|
4
4
|
import { styled, darken } from "@mui/material/styles";
|
|
5
5
|
|
|
6
6
|
export const ActionButton = (props) => {
|
|
7
|
-
const
|
|
8
|
-
const currentTheme = Object.keys(
|
|
9
|
-
(
|
|
7
|
+
const { hawaTheme, themeName } = useContext(ThemeProvider);
|
|
8
|
+
const currentTheme = Object.keys(hawaTheme.actionButton).find(
|
|
9
|
+
(tName) => tName.toLowerCase() === themeName?.toLowerCase()
|
|
10
10
|
);
|
|
11
11
|
let actionButtonStyle = {};
|
|
12
12
|
|
|
13
13
|
if (currentTheme) {
|
|
14
14
|
actionButtonStyle = {
|
|
15
|
-
...
|
|
16
|
-
margin: props.last ? 0 :
|
|
17
|
-
marginTop: props.last
|
|
15
|
+
...hawaTheme.actionButton[currentTheme],
|
|
16
|
+
margin: props.last ? 0 : hawaTheme.actionButton[currentTheme].margin,
|
|
17
|
+
marginTop: props.last
|
|
18
|
+
? hawaTheme.actionButton[currentTheme].margin * 2
|
|
19
|
+
: 0,
|
|
18
20
|
"&:hover": {
|
|
19
21
|
backgroundColor: darken(
|
|
20
|
-
|
|
22
|
+
hawaTheme.actionButton[currentTheme]?.backgroundColor,
|
|
21
23
|
0.1
|
|
22
24
|
)
|
|
23
25
|
}
|
|
@@ -27,7 +29,8 @@ export const ActionButton = (props) => {
|
|
|
27
29
|
backgroundColor: "black",
|
|
28
30
|
color: "white",
|
|
29
31
|
padding: 10,
|
|
30
|
-
marginTop: props.last ? 10 * 2 : 0
|
|
32
|
+
marginTop: props.last ? 10 * 2 : 0,
|
|
33
|
+
borderRadius: 0
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
36
|
|
package/src/ui/ApplePayButton.js
CHANGED
|
@@ -1,76 +1,9 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import Button from "@mui/material/Button";
|
|
4
|
-
import { styled, darken } from "@mui/material/styles";
|
|
5
|
-
|
|
6
|
-
import GitHubIcon from "@mui/icons-material/GitHub";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HawaLogoButton } from "./HawaLogoButton";
|
|
7
3
|
|
|
8
4
|
export const ApplePayButton = (props) => {
|
|
9
|
-
const theme = useContext(ThemeProvider);
|
|
10
|
-
let buttonStyle = {};
|
|
11
|
-
|
|
12
|
-
let currentTheme = Object.keys(theme.actionButton).find(
|
|
13
|
-
(themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
|
|
14
|
-
);
|
|
15
|
-
if (currentTheme) {
|
|
16
|
-
buttonStyle = {
|
|
17
|
-
cursor: "pointer",
|
|
18
|
-
display: "flex",
|
|
19
|
-
flexDirection: "row",
|
|
20
|
-
alignItems: "center",
|
|
21
|
-
justifyContent: "center",
|
|
22
|
-
padding: 0,
|
|
23
|
-
marginTop: theme.actionButton[currentTheme].margin,
|
|
24
|
-
border: props.outlined ? "2px solid black" : "none",
|
|
25
|
-
borderRadius: theme.actionButton[currentTheme].borderRadius,
|
|
26
|
-
backgroundColor: "white",
|
|
27
|
-
"&:hover": {
|
|
28
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
} else {
|
|
32
|
-
buttonStyle = {
|
|
33
|
-
cursor: "pointer",
|
|
34
|
-
display: "flex",
|
|
35
|
-
flexDirection: "row",
|
|
36
|
-
alignItems: "center",
|
|
37
|
-
justifyContent: "center",
|
|
38
|
-
marginTop: theme.margins,
|
|
39
|
-
border: props.outlined ? "2px solid black" : "none",
|
|
40
|
-
borderRadius: 0,
|
|
41
|
-
backgroundColor: "white",
|
|
42
|
-
"&:hover": {
|
|
43
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const StyledButton = styled(Button)(({ theme }) => {
|
|
49
|
-
return {
|
|
50
|
-
// "label + &": {
|
|
51
|
-
// marginTop: theme.spacing(3)
|
|
52
|
-
// },
|
|
53
|
-
|
|
54
|
-
borderRadius: 4,
|
|
55
|
-
position: "relative",
|
|
56
|
-
border: "1px solid #ced4da",
|
|
57
|
-
fontSize: 16,
|
|
58
|
-
// width: "auto",
|
|
59
|
-
height: 50,
|
|
60
|
-
// padding: "10px 12px",
|
|
61
|
-
...buttonStyle,
|
|
62
|
-
"&:focus": {
|
|
63
|
-
// boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
|
|
64
|
-
borderColor: theme.palette.primary.main
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
|
|
69
5
|
return (
|
|
70
|
-
<
|
|
71
|
-
// style={buttonStyle}
|
|
72
|
-
onClick={props.handleClick}
|
|
73
|
-
>
|
|
6
|
+
<HawaLogoButton {...props}>
|
|
74
7
|
<img
|
|
75
8
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png"
|
|
76
9
|
height={40}
|
|
@@ -88,6 +21,6 @@ export const ApplePayButton = (props) => {
|
|
|
88
21
|
>
|
|
89
22
|
{props.buttonText}
|
|
90
23
|
</p>
|
|
91
|
-
</
|
|
24
|
+
</HawaLogoButton>
|
|
92
25
|
);
|
|
93
26
|
};
|
package/src/ui/GithubButton.js
CHANGED
|
@@ -1,76 +1,10 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { ThemeProvider } from "../themes/HawaProvider";
|
|
3
|
-
import Button from "@mui/material/Button";
|
|
4
|
-
import { styled, darken } from "@mui/material/styles";
|
|
5
|
-
|
|
1
|
+
import React from "react";
|
|
6
2
|
import GitHubIcon from "@mui/icons-material/GitHub";
|
|
3
|
+
import { HawaLogoButton } from "./HawaLogoButton";
|
|
7
4
|
|
|
8
5
|
export const GithubButton = (props) => {
|
|
9
|
-
const theme = useContext(ThemeProvider);
|
|
10
|
-
let buttonStyle = {};
|
|
11
|
-
|
|
12
|
-
let currentTheme = Object.keys(theme.actionButton).find(
|
|
13
|
-
(themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
|
|
14
|
-
);
|
|
15
|
-
if (currentTheme) {
|
|
16
|
-
buttonStyle = {
|
|
17
|
-
cursor: "pointer",
|
|
18
|
-
display: "flex",
|
|
19
|
-
flexDirection: "row",
|
|
20
|
-
alignItems: "center",
|
|
21
|
-
justifyContent: "center",
|
|
22
|
-
padding: 0,
|
|
23
|
-
marginTop: theme.actionButton[currentTheme].margin,
|
|
24
|
-
border: props.outlined ? "2px solid black" : "none",
|
|
25
|
-
borderRadius: theme.actionButton[currentTheme].borderRadius,
|
|
26
|
-
backgroundColor: "white",
|
|
27
|
-
"&:hover": {
|
|
28
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
} else {
|
|
32
|
-
buttonStyle = {
|
|
33
|
-
cursor: "pointer",
|
|
34
|
-
display: "flex",
|
|
35
|
-
flexDirection: "row",
|
|
36
|
-
alignItems: "center",
|
|
37
|
-
justifyContent: "center",
|
|
38
|
-
marginTop: theme.margins,
|
|
39
|
-
border: props.outlined ? "2px solid black" : "none",
|
|
40
|
-
borderRadius: 0,
|
|
41
|
-
backgroundColor: "white",
|
|
42
|
-
"&:hover": {
|
|
43
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const StyledButton = styled(Button)(({ theme }) => {
|
|
49
|
-
return {
|
|
50
|
-
// "label + &": {
|
|
51
|
-
// marginTop: theme.spacing(3)
|
|
52
|
-
// },
|
|
53
|
-
|
|
54
|
-
borderRadius: 4,
|
|
55
|
-
position: "relative",
|
|
56
|
-
border: "1px solid #ced4da",
|
|
57
|
-
fontSize: 16,
|
|
58
|
-
// width: "auto",
|
|
59
|
-
height: 50,
|
|
60
|
-
// padding: "10px 12px",
|
|
61
|
-
...buttonStyle,
|
|
62
|
-
"&:focus": {
|
|
63
|
-
// boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
|
|
64
|
-
borderColor: theme.palette.primary.main
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
|
|
69
6
|
return (
|
|
70
|
-
<
|
|
71
|
-
// style={buttonStyle}
|
|
72
|
-
onClick={props.handleClick}
|
|
73
|
-
>
|
|
7
|
+
<HawaLogoButton {...props}>
|
|
74
8
|
<GitHubIcon />
|
|
75
9
|
<div style={{ width: 10 }} />
|
|
76
10
|
<p
|
|
@@ -85,6 +19,6 @@ export const GithubButton = (props) => {
|
|
|
85
19
|
>
|
|
86
20
|
{props.buttonText}
|
|
87
21
|
</p>
|
|
88
|
-
</
|
|
22
|
+
</HawaLogoButton>
|
|
89
23
|
);
|
|
90
24
|
};
|
package/src/ui/GoogleButton.js
CHANGED
|
@@ -1,68 +1,9 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import { styled, darken } from "@mui/material/styles";
|
|
4
|
-
import Button from "@mui/material/Button";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HawaLogoButton } from "./HawaLogoButton";
|
|
5
3
|
|
|
6
4
|
export const GoogleButton = (props) => {
|
|
7
|
-
const theme = useContext(ThemeProvider);
|
|
8
|
-
let buttonStyle = {};
|
|
9
|
-
|
|
10
|
-
let currentTheme = Object.keys(theme.actionButton).find(
|
|
11
|
-
(themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
|
|
12
|
-
);
|
|
13
|
-
if (currentTheme) {
|
|
14
|
-
buttonStyle = {
|
|
15
|
-
cursor: "pointer",
|
|
16
|
-
display: "flex",
|
|
17
|
-
flexDirection: "row",
|
|
18
|
-
alignItems: "center",
|
|
19
|
-
justifyContent: "center",
|
|
20
|
-
marginTop: theme.layout[currentTheme].margin,
|
|
21
|
-
border: props.outlined ? "2px solid black" : "none",
|
|
22
|
-
borderRadius: theme.layout[currentTheme].borderRadius,
|
|
23
|
-
backgroundColor: "white",
|
|
24
|
-
"&:hover": {
|
|
25
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
} else {
|
|
29
|
-
buttonStyle = {
|
|
30
|
-
cursor: "pointer",
|
|
31
|
-
display: "flex",
|
|
32
|
-
flexDirection: "row",
|
|
33
|
-
alignItems: "center",
|
|
34
|
-
justifyContent: "center",
|
|
35
|
-
marginTop: theme.margins,
|
|
36
|
-
border: props.outlined ? "2px solid black" : "none",
|
|
37
|
-
borderRadius: 0,
|
|
38
|
-
backgroundColor: "white",
|
|
39
|
-
"&:hover": {
|
|
40
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const StyledButton = styled(Button)(({ theme }) => {
|
|
45
|
-
return {
|
|
46
|
-
// "label + &": {
|
|
47
|
-
// marginTop: theme.spacing(3)
|
|
48
|
-
// },
|
|
49
|
-
|
|
50
|
-
borderRadius: 4,
|
|
51
|
-
position: "relative",
|
|
52
|
-
border: "1px solid #ced4da",
|
|
53
|
-
fontSize: 16,
|
|
54
|
-
// width: "auto",
|
|
55
|
-
height: 50,
|
|
56
|
-
// padding: "10px 12px",
|
|
57
|
-
...buttonStyle,
|
|
58
|
-
"&:focus": {
|
|
59
|
-
// boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
|
|
60
|
-
borderColor: theme.palette.primary.main
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
});
|
|
64
5
|
return (
|
|
65
|
-
<
|
|
6
|
+
<HawaLogoButton {...props}>
|
|
66
7
|
<img src="https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg" />
|
|
67
8
|
<div style={{ width: 10 }} />
|
|
68
9
|
<p
|
|
@@ -77,6 +18,6 @@ export const GoogleButton = (props) => {
|
|
|
77
18
|
>
|
|
78
19
|
{props.buttonText}
|
|
79
20
|
</p>
|
|
80
|
-
</
|
|
21
|
+
</HawaLogoButton>
|
|
81
22
|
);
|
|
82
23
|
};
|
|
@@ -1,80 +1,13 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import Button from "@mui/material/Button";
|
|
4
|
-
import { styled, darken } from "@mui/material/styles";
|
|
5
|
-
|
|
6
|
-
import GitHubIcon from "@mui/icons-material/GitHub";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HawaLogoButton } from "./HawaLogoButton";
|
|
7
3
|
|
|
8
4
|
export const GooglePayButton = (props) => {
|
|
9
|
-
const theme = useContext(ThemeProvider);
|
|
10
|
-
let buttonStyle = {};
|
|
11
|
-
|
|
12
|
-
let currentTheme = Object.keys(theme.actionButton).find(
|
|
13
|
-
(themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
|
|
14
|
-
);
|
|
15
|
-
if (currentTheme) {
|
|
16
|
-
buttonStyle = {
|
|
17
|
-
cursor: "pointer",
|
|
18
|
-
display: "flex",
|
|
19
|
-
flexDirection: "row",
|
|
20
|
-
alignItems: "center",
|
|
21
|
-
justifyContent: "center",
|
|
22
|
-
padding: 0,
|
|
23
|
-
marginTop: theme.actionButton[currentTheme].margin,
|
|
24
|
-
border: props.outlined ? "2px solid black" : "none",
|
|
25
|
-
borderRadius: theme.actionButton[currentTheme].borderRadius,
|
|
26
|
-
backgroundColor: "white",
|
|
27
|
-
"&:hover": {
|
|
28
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
} else {
|
|
32
|
-
buttonStyle = {
|
|
33
|
-
cursor: "pointer",
|
|
34
|
-
display: "flex",
|
|
35
|
-
flexDirection: "row",
|
|
36
|
-
alignItems: "center",
|
|
37
|
-
justifyContent: "center",
|
|
38
|
-
marginTop: theme.margins,
|
|
39
|
-
border: props.outlined ? "2px solid black" : "none",
|
|
40
|
-
borderRadius: 0,
|
|
41
|
-
backgroundColor: "white",
|
|
42
|
-
"&:hover": {
|
|
43
|
-
backgroundColor: darken("#ffffff", 0.1)
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const StyledButton = styled(Button)(({ theme }) => {
|
|
49
|
-
return {
|
|
50
|
-
// "label + &": {
|
|
51
|
-
// marginTop: theme.spacing(3)
|
|
52
|
-
// },
|
|
53
|
-
|
|
54
|
-
borderRadius: 4,
|
|
55
|
-
position: "relative",
|
|
56
|
-
border: "1px solid #ced4da",
|
|
57
|
-
fontSize: 16,
|
|
58
|
-
// width: "auto",
|
|
59
|
-
height: 50,
|
|
60
|
-
// padding: "10px 12px",
|
|
61
|
-
...buttonStyle,
|
|
62
|
-
"&:focus": {
|
|
63
|
-
// boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
|
|
64
|
-
borderColor: theme.palette.primary.main
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
|
|
69
5
|
return (
|
|
70
|
-
<
|
|
71
|
-
// style={buttonStyle}
|
|
72
|
-
onClick={props.handleClick}
|
|
73
|
-
>
|
|
6
|
+
<HawaLogoButton {...props}>
|
|
74
7
|
<img
|
|
75
8
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png"
|
|
76
9
|
height={20}
|
|
77
|
-
/>
|
|
10
|
+
/>
|
|
78
11
|
<div style={{ width: 10 }} />
|
|
79
12
|
<p
|
|
80
13
|
style={{
|
|
@@ -88,6 +21,6 @@ export const GooglePayButton = (props) => {
|
|
|
88
21
|
>
|
|
89
22
|
{props.buttonText}
|
|
90
23
|
</p>
|
|
91
|
-
</
|
|
24
|
+
</HawaLogoButton>
|
|
92
25
|
);
|
|
93
26
|
};
|