@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.
Files changed (50) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +1 -1
  4. package/src/blocks/Account/UserProfile.js +57 -7
  5. package/src/blocks/AuthForms/NewPasswordForm.js +20 -19
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +12 -15
  7. package/src/blocks/AuthForms/SignInForm.js +20 -25
  8. package/src/blocks/AuthForms/SignUpForm.js +44 -37
  9. package/src/blocks/Payment/ChargeWalletForm.js +38 -17
  10. package/src/blocks/Payment/CreditCardForm.js +50 -21
  11. package/src/blocks/Payment/PayWithWallet.js +4 -25
  12. package/src/blocks/Payment/SelectPayment.js +3 -21
  13. package/src/layout/Box.js +9 -9
  14. package/src/stories/BlocksStories/AuthForm.stories.js +4 -6
  15. package/src/stories/BlocksStories/PaymentForm.stories.js +10 -6
  16. package/src/stories/BlocksStories/UserForm.stories.js +41 -0
  17. package/src/stories/LayoutStories/Box.stories.js +4 -4
  18. package/src/stories/UIStories/ActionButton.stories.js +2 -2
  19. package/src/stories/UIStories/Alert.stories.js +4 -17
  20. package/src/stories/UIStories/RadioSelector.stories.js +20 -35
  21. package/src/stories/UIStories/SettingsRow.stories.js +64 -0
  22. package/src/themes/HawaProvider.js +57 -18
  23. package/src/ui/ActionButton.js +11 -8
  24. package/src/ui/ApplePayButton.js +4 -71
  25. package/src/ui/GithubButton.js +4 -70
  26. package/src/ui/GoogleButton.js +4 -63
  27. package/src/ui/GooglePayButton.js +5 -72
  28. package/src/ui/HawaAlert.js +5 -5
  29. package/src/ui/HawaButton.js +6 -6
  30. package/src/ui/HawaInputLabel.js +4 -4
  31. package/src/ui/HawaLogoButton.js +6 -11
  32. package/src/ui/HawaRadio.js +50 -28
  33. package/src/ui/HawaSettingsRow.js +71 -0
  34. package/src/ui/HawaTextField.js +31 -34
  35. package/src/ui/HawaTypography.js +4 -4
  36. package/src/ui/MadaButton.js +5 -72
  37. package/src/ui/PayPalButton.js +4 -71
  38. package/src/ui/STCPayButton.js +5 -72
  39. package/src/ui/TwitterButton.js +3 -59
  40. package/src/ui/VisaMasterButton.js +4 -71
  41. package/src/ui/index.js +1 -1
  42. package/storybook-static/iframe.html +1 -1
  43. package/storybook-static/main.b7ffaed0.iframe.bundle.js +1 -0
  44. package/storybook-static/vendors~main.8ebae370.iframe.bundle.js +76 -0
  45. package/storybook-static/{vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt → vendors~main.8ebae370.iframe.bundle.js.LICENSE.txt} +0 -0
  46. package/storybook-static/vendors~main.8ebae370.iframe.bundle.js.map +1 -0
  47. package/src/stories/BlocksStories/UserAccount.stories.js +0 -46
  48. package/storybook-static/main.e55ce615.iframe.bundle.js +0 -1
  49. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +0 -76
  50. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +0 -1
@@ -6,15 +6,15 @@ import Alert from "@mui/material/Alert";
6
6
  import AlertTitle from "@mui/material/AlertTitle";
7
7
 
8
8
  export const HawaAlert = (props) => {
9
- const theme = useContext(ThemeProvider);
10
- const currentTheme = Object.keys(theme.alerts).find(
11
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
9
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
10
+ const currentTheme = Object.keys(hawaTheme.alerts).find(
11
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
12
12
  );
13
13
  let alertStyle = {};
14
14
 
15
15
  if (currentTheme) {
16
16
  alertStyle = {
17
- ...theme.alerts[currentTheme]
17
+ ...hawaTheme.alerts[currentTheme]
18
18
  };
19
19
  } else {
20
20
  alertStyle = {
@@ -29,7 +29,7 @@ export const HawaAlert = (props) => {
29
29
  });
30
30
 
31
31
  return (
32
- <StyledAlert themeType={props.themeType} {...props}>
32
+ <StyledAlert {...props}>
33
33
  {props.title && <AlertTitle>{props.title}</AlertTitle>}
34
34
  {props.text}
35
35
  </StyledAlert>
@@ -4,19 +4,19 @@ import { styled, darken } from "@mui/material/styles";
4
4
  import Button from "@mui/material/Button";
5
5
 
6
6
  export const HawaButton = (props) => {
7
- const theme = useContext(ThemeProvider);
7
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
8
8
  let buttonStyle = {};
9
- let currentTheme = Object.keys(theme.actionButton).find(
10
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
9
+ let currentTheme = Object.keys(hawaTheme.actionButton).find(
10
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
11
11
  );
12
12
  if (currentTheme) {
13
13
  buttonStyle = {
14
- ...theme.actionButton[currentTheme],
14
+ ...hawaTheme.actionButton[currentTheme],
15
15
  // marginTop: theme.actionButton[currentTheme].margin,
16
16
  border: props.outlined ? "2px solid black" : "none",
17
17
  // borderRadius: theme.actionButton[currentTheme].borderRadius,
18
18
  backgroundColor: "white",
19
- // height: 50,
19
+ // height: 50,
20
20
  "&:hover": {
21
21
  backgroundColor: darken("#ffffff", 0.1)
22
22
  }
@@ -29,7 +29,7 @@ export const HawaButton = (props) => {
29
29
  flexDirection: "row",
30
30
  alignItems: "center",
31
31
  justifyContent: "center",
32
- marginTop: theme.actionButton[currentTheme]?.margin,
32
+ marginTop: hawaTheme.actionButton[currentTheme]?.margin,
33
33
  border: props.outlined ? "2px solid black" : "none",
34
34
  borderRadius: 0,
35
35
  //backgroundColor: "white",
@@ -3,18 +3,18 @@ import { useContext } from "react";
3
3
  import { ThemeProvider } from "../themes/HawaProvider";
4
4
 
5
5
  export const HawaInputLabel = (props) => {
6
- const theme = useContext(ThemeProvider);
6
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
7
7
  let labelStyle = {};
8
8
 
9
- let currentTheme = Object.keys(theme.actionButton).find(
10
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
9
+ let currentTheme = Object.keys(hawaTheme.actionButton).find(
10
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
11
11
  );
12
12
  if (currentTheme) {
13
13
  labelStyle = {
14
14
  margin: 15,
15
15
  marginRight: 5,
16
16
  marginLeft: 5,
17
- color: theme.layout[currentTheme].color
17
+ color: hawaTheme.layout[currentTheme].color
18
18
  };
19
19
  } else {
20
20
  labelStyle = {
@@ -4,19 +4,15 @@ import { styled, darken } from "@mui/material/styles";
4
4
  import Button from "@mui/material/Button";
5
5
 
6
6
  export const HawaLogoButton = (props) => {
7
- const theme = useContext(ThemeProvider);
7
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
8
8
  let buttonStyle = {};
9
- let currentTheme = Object.keys(theme.logoButton).find(
10
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
9
+ let currentTheme = Object.keys(hawaTheme.logoButton).find(
10
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
11
11
  );
12
12
  if (currentTheme) {
13
13
  buttonStyle = {
14
- ...theme.logoButton[currentTheme],
15
- // marginTop: theme.actionButton[currentTheme].margin,
16
- border: props.outlined ? "2px solid black" : "none",
17
- // borderRadius: theme.actionButton[currentTheme].borderRadius,
14
+ ...hawaTheme.logoButton[currentTheme],
18
15
  backgroundColor: "white",
19
- // height: 50,
20
16
  "&:hover": {
21
17
  backgroundColor: darken("#ffffff", 0.1)
22
18
  }
@@ -29,10 +25,9 @@ export const HawaLogoButton = (props) => {
29
25
  flexDirection: "row",
30
26
  alignItems: "center",
31
27
  justifyContent: "center",
32
- marginTop: theme.logoButton[currentTheme]?.margin,
33
- border: props.outlined ? "2px solid black" : "none",
34
- // borderRadius: 0,
28
+ marginTop: 10,
35
29
  height: 50,
30
+ border: "1px solid #ced4da",
36
31
  backgroundColor: "white",
37
32
  "&:hover": {
38
33
  backgroundColor: darken("#ffffff", 0.1)
@@ -1,51 +1,73 @@
1
+ import { Typography } from "@mui/material";
1
2
  import React, { useState, useContext } from "react";
3
+ import { Box } from "../layout";
2
4
  import { ThemeProvider } from "../themes/HawaProvider";
3
5
 
4
6
  export const HawaRadio = (props) => {
5
7
  const [value, setValue] = useState(props.defaultValue);
6
- const theme = useContext(ThemeProvider);
8
+
9
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
10
+ const currentTheme = Object.keys(hawaTheme.radioSelector).find(
11
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
12
+ );
13
+ let radioSelectorStyle = {};
14
+
15
+ if (currentTheme) {
16
+ radioSelectorStyle = {
17
+ ...hawaTheme.radioSelector[currentTheme],
18
+ "-moz-user-select": "-moz-none",
19
+ "-khtml-user-select": "none",
20
+ "-webkit-user-select": "none",
21
+ "-ms-user-select": "none",
22
+ "user-select": "none"
23
+ };
24
+ } else {
25
+ radioSelectorStyle = {
26
+ display: "flex",
27
+ flexDirection: "row",
28
+ justifyContent: "space-between",
29
+ alignItems: "center",
30
+ backgroundColor: "#F5F5F5",
31
+ margin: 0,
32
+
33
+ backgroundColor: "lightGrey",
34
+ color: "black",
35
+ padding: 10
36
+ };
37
+ }
7
38
 
8
39
  return (
9
- <div
10
- style={{
11
- backgroundColor: "white",
12
- display: "flex",
13
- flexDirection: "row",
14
- margin: theme.margins,
15
- padding: theme.paddings,
16
- marginBottom: 10
17
- }}
18
- >
40
+ <Box horizontal maxWidth={"fit-content"}>
19
41
  {props.options.map((singleOption) => {
20
42
  return (
21
43
  <div
22
44
  key={singleOption.label}
23
- className="radio_option"
24
45
  onClick={() => {
25
46
  setValue(singleOption.label);
26
47
  if (props.handleChange) {
27
48
  props.handleChange();
28
49
  }
29
50
  }}
30
- style={
31
- value.toLowerCase() === singleOption.label.toLowerCase()
32
- ? {
33
- borderRadius: theme.borderRadius,
34
- padding: theme.paddings,
35
- backgroundColor:
36
- theme.primaryColor || props.bgSelectedColor || "blue",
37
- color: props.textSelectedColor || "lightgray"
38
- }
39
- : {
40
- borderRadius: theme.borderRadius,
41
- padding: theme.paddings
42
- }
43
- }
51
+ style={{
52
+ ...radioSelectorStyle,
53
+ backgroundColor:
54
+ value.toLowerCase() === singleOption.label.toLowerCase()
55
+ ? currentTheme
56
+ ? hawaTheme.actionButton[currentTheme]?.backgroundColor
57
+ : "black"
58
+ : hawaTheme.layout[currentTheme]?.backgroundColor,
59
+ color:
60
+ value.toLowerCase() === singleOption.label.toLowerCase()
61
+ ? hawaTheme.actionButton[currentTheme]?.color
62
+ : currentTheme
63
+ ? hawaTheme.layout[currentTheme]?.color
64
+ : "black"
65
+ }}
44
66
  >
45
- {singleOption.text}
67
+ <Typography>{singleOption.text}</Typography>
46
68
  </div>
47
69
  );
48
70
  })}
49
- </div>
71
+ </Box>
50
72
  );
51
73
  };
@@ -0,0 +1,71 @@
1
+ import React, { useContext } from "react";
2
+
3
+ import PropTypes from "prop-types";
4
+ import { ThemeProvider } from "../themes/HawaProvider";
5
+ import { Box } from "../layout";
6
+ import Checkbox from "@mui/material/Checkbox";
7
+ import TextField from "@mui/material/TextField";
8
+
9
+ export const HawaSettingsRow = (props) => {
10
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
11
+ const currentTheme = Object.keys(hawaTheme.settingsRow).find(
12
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
13
+ );
14
+ let settingsRowStyle = {};
15
+
16
+ if (currentTheme) {
17
+ settingsRowStyle = {
18
+ ...hawaTheme.settingsRow[currentTheme],
19
+ margin: props.last ? 0 : hawaTheme.settingsRow[currentTheme].margin,
20
+ marginTop: props.last ? hawaTheme.settingsRow[currentTheme].margin * 2 : 0
21
+ };
22
+ } else {
23
+ settingsRowStyle = {
24
+ display: "flex",
25
+ flexDirection: "row",
26
+ justifyContent: "space-between",
27
+ alignItems: "center",
28
+ backgroundColor: "#F5F5F5",
29
+ margin: 0,
30
+
31
+ backgroundColor: "lightGrey",
32
+ color: "black",
33
+ padding: 10
34
+ };
35
+ }
36
+
37
+ return (
38
+ <Box noColor>
39
+ {props.settingsType === "checkbox" && (
40
+ <div style={{ ...settingsRowStyle }}>
41
+ Checkbox Label <Checkbox />
42
+ </div>
43
+ )}
44
+ {props.settingsType === "text" && (
45
+ <div style={{ ...settingsRowStyle }}>
46
+ Text Label{" "}
47
+ <TextField
48
+ InputProps={{
49
+ style: {
50
+ ...hawaTheme.inputFields[currentTheme],
51
+ // borderRadius: 0,
52
+ // padding: 0,
53
+ // backgroundColor: "white",
54
+ height: 40
55
+ }
56
+ }}
57
+ style={{
58
+ padding: 0
59
+ }}
60
+ placeholder="test"
61
+ />
62
+ </div>
63
+ )}
64
+ </Box>
65
+ );
66
+ };
67
+
68
+ HawaSettingsRow.propTypes = {
69
+ type: PropTypes.oneOf(["text", "number", "password"]),
70
+ helperText: PropTypes.string
71
+ };
@@ -7,28 +7,27 @@ import { ThemeProvider } from "../themes/HawaProvider";
7
7
  import { HawaInputLabel } from "./HawaInputLabel";
8
8
  import { Controller, useFormContext } from "react-hook-form";
9
9
 
10
+ import { InputAdornment, TextField } from "@mui/material";
11
+ import { MailOutline } from "@mui/icons-material";
12
+
10
13
  export const HawaTextField = (props) => {
11
14
  const { control, register } = useFormContext();
12
15
 
13
- const theme = useContext(ThemeProvider);
14
- const currentTheme = Object.keys(theme.actionButton).find(
15
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
16
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
17
+ const currentTheme = Object.keys(hawaTheme.inputFields).find(
18
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
16
19
  );
17
20
  let textFieldStyle = {};
18
21
 
19
22
  if (currentTheme) {
20
23
  textFieldStyle = {
21
- ...theme.inputFields[currentTheme],
22
- margin: props.last ? 0 : theme.inputFields[currentTheme].margin,
23
- marginTop: props.last ? theme.inputFields[currentTheme].margin * 2 : 0
24
+ ...hawaTheme.inputFields[currentTheme],
25
+ margin: props.last ? 0 : hawaTheme.inputFields[currentTheme].margin,
26
+ marginTop: props.last ? hawaTheme.inputFields[currentTheme].margin * 2 : 0
24
27
  };
25
28
  } else {
26
29
  textFieldStyle = {
27
- backgroundColor: "white",
28
- display: "flex",
29
- flexDirection: "column",
30
- alignItems: "flex-start",
31
- justifyContent: "flex-start"
30
+ backgroundColor: "white"
32
31
  };
33
32
  }
34
33
 
@@ -38,27 +37,26 @@ export const HawaTextField = (props) => {
38
37
  // marginTop: theme.spacing(3)
39
38
  // },
40
39
  "& .MuiInputBase-input": {
41
- backgroundColor: theme.palette.mode === "light" ? "#fcfcfb" : "#2b2b2b",
40
+ // backgroundColor: theme.palette.mode === "light" ? "#fcfcfb" : "#2b2b2b",
42
41
  transition: theme.transitions.create([
43
42
  "border-color",
44
43
  "background-color",
45
44
  "box-shadow"
46
- ]),
45
+ ])
46
+
47
+ // backgroundColor: "red"
48
+ },
47
49
 
48
- "&:focus": {
49
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
50
- // borderColor: theme.palette.primary.main
51
- // borderColor: theme.actionButton[currentTheme]?.backgroundColor
52
- },
53
- borderRadius: 4,
54
- // position: "relative",
55
- border: "1px solid #ced4da",
56
- fontSize: 16,
57
- // width: "auto",
58
- padding: "10px 12px",
59
- marginBottom: props.helperText ? 5 : 0,
60
- ...textFieldStyle
61
- }
50
+ // position: "relative",
51
+ border: "1px solid #ced4da",
52
+ fontSize: 16,
53
+ // width: "auto",
54
+ padding: "10px 12px",
55
+ marginBottom: props.helperText ? 5 : 0,
56
+ paddingLeft: 10,
57
+ paddingRight: 10,
58
+ ...textFieldStyle
59
+ // backgroundColor: "green"
62
60
  };
63
61
  });
64
62
 
@@ -66,12 +64,7 @@ export const HawaTextField = (props) => {
66
64
  <Controller
67
65
  render={({ field }) => (
68
66
  <>
69
- {props.inputLabel && (
70
- <HawaInputLabel
71
- themeType={props.themeType}
72
- label={props.inputLabel}
73
- />
74
- )}
67
+ {props.inputLabel && <HawaInputLabel label={props.inputLabel} />}
75
68
 
76
69
  <StyledTextField
77
70
  fullWidth={true}
@@ -88,13 +81,17 @@ export const HawaTextField = (props) => {
88
81
  // }
89
82
  // : {}
90
83
  // }
84
+
91
85
  defaultValue={props.defaultValue && ""}
92
86
  value={props.value && ""}
93
87
  {...props}
94
88
  // {...field}
95
89
  {...register(props.name)}
96
90
  />
97
- <Typography variant="caption" style={{ margin: 5, color: "red" }}>
91
+ <Typography
92
+ variant="caption"
93
+ style={{ margin: 5, marginBottom: 0, color: "red" }}
94
+ >
98
95
  {props.helperText}
99
96
  </Typography>
100
97
  </>
@@ -5,14 +5,14 @@ import { ThemeProvider } from "../themes/HawaProvider";
5
5
  import Typography from "@mui/material/Typography";
6
6
 
7
7
  export const HawaTypography = (props) => {
8
- const theme = useContext(ThemeProvider);
9
- const currentTheme = Object.keys(theme.actionButton).find(
10
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
8
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
9
+ const currentTheme = Object.keys(hawaTheme.typography).find(
10
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
11
11
  );
12
12
  let typographyStyle = {};
13
13
 
14
14
  if (currentTheme) {
15
- typographyStyle = { ...theme.typography[currentTheme] };
15
+ typographyStyle = { ...hawaTheme.typography[currentTheme] };
16
16
  } else {
17
17
  typographyStyle = {
18
18
  color: "black"
@@ -1,79 +1,12 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
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 MadaButton = (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
- <StyledButton
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/mada.png"
76
- height={30}
9
+ height={20}
77
10
  />{" "}
78
11
  <div style={{ width: 10 }} />
79
12
  <p
@@ -88,6 +21,6 @@ export const MadaButton = (props) => {
88
21
  >
89
22
  {props.buttonText}
90
23
  </p>
91
- </StyledButton>
24
+ </HawaLogoButton>
92
25
  );
93
26
  };
@@ -1,76 +1,9 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
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 PayPalButton = (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
- <StyledButton
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/paypal.png"
76
9
  height={25}
@@ -88,6 +21,6 @@ export const PayPalButton = (props) => {
88
21
  >
89
22
  {props.buttonText}
90
23
  </p>
91
- </StyledButton>
24
+ </HawaLogoButton>
92
25
  );
93
26
  };