@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
@@ -1,94 +0,0 @@
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";
7
-
8
- export const GooglePayButton = (props) => {
9
- const theme = useContext(ThemeProvider);
10
- let buttonStyle = {};
11
-
12
- console.log(Object.keys(theme.actionButton));
13
- let currentTheme = Object.keys(theme.actionButton).find(
14
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
15
- );
16
- if (currentTheme) {
17
- buttonStyle = {
18
- cursor: "pointer",
19
- display: "flex",
20
- flexDirection: "row",
21
- alignItems: "center",
22
- justifyContent: "center",
23
- padding: 0,
24
- marginTop: theme.actionButton[currentTheme].margin,
25
- border: props.outlined ? "2px solid black" : "none",
26
- borderRadius: theme.actionButton[currentTheme].borderRadius,
27
- backgroundColor: "white",
28
- "&:hover": {
29
- backgroundColor: darken("#ffffff", 0.1)
30
- }
31
- };
32
- } else {
33
- buttonStyle = {
34
- cursor: "pointer",
35
- display: "flex",
36
- flexDirection: "row",
37
- alignItems: "center",
38
- justifyContent: "center",
39
- marginTop: theme.margins,
40
- border: props.outlined ? "2px solid black" : "none",
41
- borderRadius: 0,
42
- backgroundColor: "white",
43
- "&:hover": {
44
- backgroundColor: darken("#ffffff", 0.1)
45
- }
46
- };
47
- }
48
-
49
- const StyledButton = styled(Button)(({ theme }) => {
50
- return {
51
- // "label + &": {
52
- // marginTop: theme.spacing(3)
53
- // },
54
-
55
- borderRadius: 4,
56
- position: "relative",
57
- border: "1px solid #ced4da",
58
- fontSize: 16,
59
- // width: "auto",
60
- height: 50,
61
- // padding: "10px 12px",
62
- ...buttonStyle,
63
- "&:focus": {
64
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
65
- borderColor: theme.palette.primary.main
66
- }
67
- };
68
- });
69
-
70
- return (
71
- <StyledButton
72
- // style={buttonStyle}
73
- onClick={props.handleClick}
74
- >
75
- <img
76
- src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png"
77
- height={30}
78
- />{" "}
79
- <div style={{ width: 10 }} />
80
- <p
81
- style={{
82
- color: "black",
83
- fontSize: 14,
84
- textAlign: "center",
85
- letterSpacing: 0.4,
86
- fontFamily: "Roboto",
87
- fontWeight: 500
88
- }}
89
- >
90
- {props.buttonText}
91
- </p>
92
- </StyledButton>
93
- );
94
- };
@@ -1,94 +0,0 @@
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";
7
-
8
- export const MadaButton = (props) => {
9
- const theme = useContext(ThemeProvider);
10
- let buttonStyle = {};
11
-
12
- console.log(Object.keys(theme.actionButton));
13
- let currentTheme = Object.keys(theme.actionButton).find(
14
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
15
- );
16
- if (currentTheme) {
17
- buttonStyle = {
18
- cursor: "pointer",
19
- display: "flex",
20
- flexDirection: "row",
21
- alignItems: "center",
22
- justifyContent: "center",
23
- padding: 0,
24
- marginTop: theme.actionButton[currentTheme].margin,
25
- border: props.outlined ? "2px solid black" : "none",
26
- borderRadius: theme.actionButton[currentTheme].borderRadius,
27
- backgroundColor: "white",
28
- "&:hover": {
29
- backgroundColor: darken("#ffffff", 0.1)
30
- }
31
- };
32
- } else {
33
- buttonStyle = {
34
- cursor: "pointer",
35
- display: "flex",
36
- flexDirection: "row",
37
- alignItems: "center",
38
- justifyContent: "center",
39
- marginTop: theme.margins,
40
- border: props.outlined ? "2px solid black" : "none",
41
- borderRadius: 0,
42
- backgroundColor: "white",
43
- "&:hover": {
44
- backgroundColor: darken("#ffffff", 0.1)
45
- }
46
- };
47
- }
48
-
49
- const StyledButton = styled(Button)(({ theme }) => {
50
- return {
51
- // "label + &": {
52
- // marginTop: theme.spacing(3)
53
- // },
54
-
55
- borderRadius: 4,
56
- position: "relative",
57
- border: "1px solid #ced4da",
58
- fontSize: 16,
59
- // width: "auto",
60
- height: 50,
61
- // padding: "10px 12px",
62
- ...buttonStyle,
63
- "&:focus": {
64
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
65
- borderColor: theme.palette.primary.main
66
- }
67
- };
68
- });
69
-
70
- return (
71
- <StyledButton
72
- // style={buttonStyle}
73
- onClick={props.handleClick}
74
- >
75
- <img
76
- src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png"
77
- height={30}
78
- />{" "}
79
- <div style={{ width: 10 }} />
80
- <p
81
- style={{
82
- color: "black",
83
- fontSize: 14,
84
- textAlign: "center",
85
- letterSpacing: 0.4,
86
- fontFamily: "Roboto",
87
- fontWeight: 500
88
- }}
89
- >
90
- {props.buttonText}
91
- </p>
92
- </StyledButton>
93
- );
94
- };
@@ -1,94 +0,0 @@
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";
7
-
8
- export const PayPalButton = (props) => {
9
- const theme = useContext(ThemeProvider);
10
- let buttonStyle = {};
11
-
12
- console.log(Object.keys(theme.actionButton));
13
- let currentTheme = Object.keys(theme.actionButton).find(
14
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
15
- );
16
- if (currentTheme) {
17
- buttonStyle = {
18
- cursor: "pointer",
19
- display: "flex",
20
- flexDirection: "row",
21
- alignItems: "center",
22
- justifyContent: "center",
23
- padding: 0,
24
- marginTop: theme.actionButton[currentTheme].margin,
25
- border: props.outlined ? "2px solid black" : "none",
26
- borderRadius: theme.actionButton[currentTheme].borderRadius,
27
- backgroundColor: "white",
28
- "&:hover": {
29
- backgroundColor: darken("#ffffff", 0.1)
30
- }
31
- };
32
- } else {
33
- buttonStyle = {
34
- cursor: "pointer",
35
- display: "flex",
36
- flexDirection: "row",
37
- alignItems: "center",
38
- justifyContent: "center",
39
- marginTop: theme.margins,
40
- border: props.outlined ? "2px solid black" : "none",
41
- borderRadius: 0,
42
- backgroundColor: "white",
43
- "&:hover": {
44
- backgroundColor: darken("#ffffff", 0.1)
45
- }
46
- };
47
- }
48
-
49
- const StyledButton = styled(Button)(({ theme }) => {
50
- return {
51
- // "label + &": {
52
- // marginTop: theme.spacing(3)
53
- // },
54
-
55
- borderRadius: 4,
56
- position: "relative",
57
- border: "1px solid #ced4da",
58
- fontSize: 16,
59
- // width: "auto",
60
- height: 50,
61
- // padding: "10px 12px",
62
- ...buttonStyle,
63
- "&:focus": {
64
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
65
- borderColor: theme.palette.primary.main
66
- }
67
- };
68
- });
69
-
70
- return (
71
- <StyledButton
72
- // style={buttonStyle}
73
- onClick={props.handleClick}
74
- >
75
- <img
76
- src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png"
77
- height={30}
78
- />{" "}
79
- <div style={{ width: 10 }} />
80
- <p
81
- style={{
82
- color: "black",
83
- fontSize: 14,
84
- textAlign: "center",
85
- letterSpacing: 0.4,
86
- fontFamily: "Roboto",
87
- fontWeight: 500
88
- }}
89
- >
90
- {props.buttonText}
91
- </p>
92
- </StyledButton>
93
- );
94
- };
@@ -1,51 +0,0 @@
1
- import React, { useState, useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
3
-
4
- export const StyledRadioSelector = (props) => {
5
- const [value, setValue] = useState(props.defaultValue);
6
- const theme = useContext(ThemeProvider);
7
-
8
- 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
- >
19
- {props.options.map((singleOption) => {
20
- return (
21
- <div
22
- key={singleOption.label}
23
- className="radio_option"
24
- onClick={() => {
25
- setValue(singleOption.label);
26
- if (props.handleChange) {
27
- props.handleChange();
28
- }
29
- }}
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
- }
44
- >
45
- {singleOption.text}
46
- </div>
47
- );
48
- })}
49
- </div>
50
- );
51
- };
@@ -1,94 +0,0 @@
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";
7
-
8
- export const STCPayButton = (props) => {
9
- const theme = useContext(ThemeProvider);
10
- let buttonStyle = {};
11
-
12
- console.log(Object.keys(theme.actionButton));
13
- let currentTheme = Object.keys(theme.actionButton).find(
14
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
15
- );
16
- if (currentTheme) {
17
- buttonStyle = {
18
- cursor: "pointer",
19
- display: "flex",
20
- flexDirection: "row",
21
- alignItems: "center",
22
- justifyContent: "center",
23
- padding: 0,
24
- marginTop: theme.actionButton[currentTheme].margin,
25
- border: props.outlined ? "2px solid black" : "none",
26
- borderRadius: theme.actionButton[currentTheme].borderRadius,
27
- backgroundColor: "white",
28
- "&:hover": {
29
- backgroundColor: darken("#ffffff", 0.1)
30
- }
31
- };
32
- } else {
33
- buttonStyle = {
34
- cursor: "pointer",
35
- display: "flex",
36
- flexDirection: "row",
37
- alignItems: "center",
38
- justifyContent: "center",
39
- marginTop: theme.margins,
40
- border: props.outlined ? "2px solid black" : "none",
41
- borderRadius: 0,
42
- backgroundColor: "white",
43
- "&:hover": {
44
- backgroundColor: darken("#ffffff", 0.1)
45
- }
46
- };
47
- }
48
-
49
- const StyledButton = styled(Button)(({ theme }) => {
50
- return {
51
- // "label + &": {
52
- // marginTop: theme.spacing(3)
53
- // },
54
-
55
- borderRadius: 4,
56
- position: "relative",
57
- border: "1px solid #ced4da",
58
- fontSize: 16,
59
- // width: "auto",
60
- height: 50,
61
- // padding: "10px 12px",
62
- ...buttonStyle,
63
- "&:focus": {
64
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
65
- borderColor: theme.palette.primary.main
66
- }
67
- };
68
- });
69
-
70
- return (
71
- <StyledButton
72
- // style={buttonStyle}
73
- onClick={props.handleClick}
74
- >
75
- <img
76
- src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png"
77
- height={30}
78
- />{" "}
79
- <div style={{ width: 10 }} />
80
- <p
81
- style={{
82
- color: "black",
83
- fontSize: 14,
84
- textAlign: "center",
85
- letterSpacing: 0.4,
86
- fontFamily: "Roboto",
87
- fontWeight: 500
88
- }}
89
- >
90
- {props.buttonText}
91
- </p>
92
- </StyledButton>
93
- );
94
- };
@@ -1,30 +0,0 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
3
-
4
- export const StyledAlert = (props) => {
5
- const theme = useContext(ThemeProvider);
6
-
7
- let alertStyle = {
8
- backgroundColor: "green",
9
- padding: 10,
10
- marginTop: 10,
11
- marginBottom: 10,
12
- borderRadius: theme.borderRadius
13
- };
14
- switch (props.type) {
15
- case "warning":
16
- alertStyle.backgroundColor = "yellow";
17
- return <div style={alertStyle}>{props.text}</div>;
18
- break;
19
- case "danger":
20
- alertStyle.backgroundColor = "red";
21
- return <div style={alertStyle}>{props.text}</div>;
22
- break;
23
- case "notification":
24
- alertStyle.backgroundColor = "blue";
25
- return <div style={alertStyle}>{props.text}</div>;
26
- break;
27
- default:
28
- return <div style={alertStyle}>{props.text}</div>;
29
- }
30
- };
@@ -1,84 +0,0 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
3
- import TwitterIcon from "@mui/icons-material/Twitter";
4
- import Button from "@mui/material/Button";
5
- import { styled, alpha, darken } from "@mui/material/styles";
6
-
7
- export const TwitterButton = (props) => {
8
- const theme = useContext(ThemeProvider);
9
- let buttonStyle = {};
10
-
11
- console.log(Object.keys(theme.actionButton));
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
- marginTop: theme.layout[currentTheme].margin,
23
- border: props.outlined ? "2px solid black" : "none",
24
- borderRadius: theme.layout[currentTheme].borderRadius,
25
- backgroundColor: "white",
26
- "&:hover": {
27
- backgroundColor: darken("#ffffff", 0.1)
28
- }
29
- };
30
- } else {
31
- buttonStyle = {
32
- cursor: "pointer",
33
- display: "flex",
34
- flexDirection: "row",
35
- alignItems: "center",
36
- justifyContent: "center",
37
- marginTop: theme.margins,
38
- border: props.outlined ? "2px solid black" : "none",
39
- borderRadius: 0,
40
- backgroundColor: "white",
41
- "&:hover": {
42
- backgroundColor: darken("#ffffff", 0.1)
43
- }
44
- };
45
- }
46
- const StyledButton = styled(Button)(({ theme }) => {
47
- return {
48
- // "label + &": {
49
- // marginTop: theme.spacing(3)
50
- // },
51
-
52
- borderRadius: 4,
53
- position: "relative",
54
- border: "1px solid #ced4da",
55
- fontSize: 16,
56
- // width: "auto",
57
- height: 50,
58
- // padding: "10px 12px",
59
- ...buttonStyle,
60
- "&:focus": {
61
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
62
- borderColor: theme.palette.primary.main
63
- }
64
- };
65
- });
66
- return (
67
- <StyledButton onClick={props.handleClick}>
68
- <TwitterIcon />
69
- <div style={{ width: 10 }} />
70
- <p
71
- style={{
72
- color: "black",
73
- fontSize: 14,
74
- textAlign: "center",
75
- letterSpacing: 0.4,
76
- fontFamily: "Roboto",
77
- fontWeight: 500
78
- }}
79
- >
80
- {props.buttonText}
81
- </p>
82
- </StyledButton>
83
- );
84
- };
@@ -1,94 +0,0 @@
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";
7
-
8
- export const VisaMasterButton = (props) => {
9
- const theme = useContext(ThemeProvider);
10
- let buttonStyle = {};
11
-
12
- console.log(Object.keys(theme.actionButton));
13
- let currentTheme = Object.keys(theme.actionButton).find(
14
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
15
- );
16
- if (currentTheme) {
17
- buttonStyle = {
18
- cursor: "pointer",
19
- display: "flex",
20
- flexDirection: "row",
21
- alignItems: "center",
22
- justifyContent: "center",
23
- padding: 0,
24
- marginTop: theme.actionButton[currentTheme].margin,
25
- border: props.outlined ? "2px solid black" : "none",
26
- borderRadius: theme.actionButton[currentTheme].borderRadius,
27
- backgroundColor: "white",
28
- "&:hover": {
29
- backgroundColor: darken("#ffffff", 0.1)
30
- }
31
- };
32
- } else {
33
- buttonStyle = {
34
- cursor: "pointer",
35
- display: "flex",
36
- flexDirection: "row",
37
- alignItems: "center",
38
- justifyContent: "center",
39
- marginTop: theme.margins,
40
- border: props.outlined ? "2px solid black" : "none",
41
- borderRadius: 0,
42
- backgroundColor: "white",
43
- "&:hover": {
44
- backgroundColor: darken("#ffffff", 0.1)
45
- }
46
- };
47
- }
48
-
49
- const StyledButton = styled(Button)(({ theme }) => {
50
- return {
51
- // "label + &": {
52
- // marginTop: theme.spacing(3)
53
- // },
54
-
55
- borderRadius: 4,
56
- position: "relative",
57
- border: "1px solid #ced4da",
58
- fontSize: 16,
59
- // width: "auto",
60
- height: 50,
61
- // padding: "10px 12px",
62
- ...buttonStyle,
63
- "&:focus": {
64
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
65
- borderColor: theme.palette.primary.main
66
- }
67
- };
68
- });
69
-
70
- return (
71
- <StyledButton
72
- // style={buttonStyle}
73
- onClick={props.handleClick}
74
- >
75
- <img
76
- src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png"
77
- height={30}
78
- />{" "}
79
- <div style={{ width: 10 }} />
80
- <p
81
- style={{
82
- color: "black",
83
- fontSize: 14,
84
- textAlign: "center",
85
- letterSpacing: 0.4,
86
- fontFamily: "Roboto",
87
- fontWeight: 500
88
- }}
89
- >
90
- {props.buttonText}
91
- </p>
92
- </StyledButton>
93
- );
94
- };