@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendors~main.aa1d952a.iframe.bundle.js","sources":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A","sourceRoot":""}
@@ -1,80 +0,0 @@
1
- import React from "react";
2
- import CastIcon from "@mui/icons-material/Cast";
3
- import { HawaProvider } from "../themes/HawaProvider";
4
- import { AdaptiveButton } from "../ui";
5
-
6
- const Template = (args) => {
7
- const theme = {
8
- borderRadius: 10,
9
- primaryColor: "#004fff",
10
- secondaryColor: "red",
11
- // margins: "10px",
12
- paddings: 10
13
- };
14
- return (
15
- <HawaProvider theme={theme}>
16
- <AdaptiveButton {...args} />
17
- </HawaProvider>
18
- );
19
- };
20
- export default {
21
- title: "UI/AdaptiveButton",
22
- component: AdaptiveButton,
23
- argsTypes: {
24
- buttonLabel: { control: "text" },
25
- borderRadius: { control: "number" },
26
- buttonColor: { control: "color" },
27
- padding: { control: "number" },
28
- hintTitle: { control: "text" },
29
- hintContent: { control: "text" }
30
- },
31
- args: {
32
- // type: "text",
33
- // buttonLabel: "Test"
34
- // borderRadius: 15,
35
- hintTitle: "test",
36
- hintContent: "more test",
37
- buttonColor: "#f9f9f9"
38
- }
39
- };
40
-
41
- export const Light = Template.bind({});
42
- Light.args = {
43
- showText: true,
44
- buttonLabel: "test",
45
- borderRadius: 5,
46
- icon: <CastIcon />,
47
- textColor: "#000000",
48
- buttonColor: "#f9f9f9"
49
- // placeholder: "Example ...",
50
- // defaultValue: "This is default value",
51
- // inputLabel: "Text Field",
52
- // padding: 10
53
- };
54
-
55
- export const Dark = Template.bind({});
56
- Dark.args = {
57
- showText: true,
58
- buttonLabel: "test",
59
- borderRadius: 5,
60
- buttonColor: "#878787",
61
- textColor: "#ffffff",
62
- icon: <CastIcon />
63
- // placeholder: "Exemple ...",
64
- // defaultValue: "This is default value",
65
- // inputLabel: "Text Field",
66
- // padding: 10
67
- };
68
- export const Danger = Template.bind({});
69
- Danger.args = {
70
- showText: true,
71
- buttonLabel: "test",
72
- borderRadius: 5,
73
- buttonColor: "#c0c0c0",
74
- danger: true,
75
- icon: <CastIcon />
76
- // placeholder: "Exemple ...",
77
- // defaultValue: "This is default value",
78
- // inputLabel: "Text Field",
79
- // padding: 10
80
- };
@@ -1,41 +0,0 @@
1
- import React from "react";
2
-
3
- import { HawaProvider } from "../themes/HawaProvider";
4
- import { StyledAlert } from "../ui";
5
-
6
- const Template = (args) => {
7
- const theme = {
8
- borderRadius: 10,
9
- primaryColor: "green",
10
- secondaryColor: "red",
11
- // margins: "10px",
12
- paperColors: "#c6c6c6",
13
- paddings: 10,
14
- margins: 10
15
- };
16
- return (
17
- <HawaProvider theme={theme}>
18
- <StyledAlert text="This is a warning" type="warning" />
19
- <StyledAlert text="This is a regular notification" type="notification" />
20
- <StyledAlert text="This is a danger alert" type="danger" />
21
- </HawaProvider>
22
- );
23
- };
24
- //types:
25
- //error (red)
26
- //warning (red)
27
- //notice (blue)
28
-
29
- export default {
30
- title: "UI/Alert",
31
- component: StyledAlert
32
- };
33
-
34
- export const Default = Template.bind({});
35
- Default.args = {
36
- showText: true,
37
- buttonLabel: "test",
38
- borderRadius: 5,
39
- textColor: "#000000",
40
- buttonColor: "#f9f9f9"
41
- };
@@ -1,46 +0,0 @@
1
- import React from "react";
2
- import {
3
- UserProfile
4
- } from "../../blocks/Account";
5
- import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
6
-
7
- export default {
8
- title: "Blocks/UserProfile",
9
- component: UserProfile,
10
- argsTypes: {
11
- viaGoogle: { control: "boolean" },
12
- viaGithub: { control: "boolean" },
13
- viaTwitter: { control: "boolean" },
14
- viaFacebook: { control: "boolean" }
15
- },
16
- args: {}
17
- };
18
-
19
- const theme = {
20
- ...defaultTheme,
21
- paddings: 20
22
- };
23
-
24
- const UserProfileTemplate = (args) => {
25
- return (
26
- <HawaProvider theme={{ ...defaultTheme, ...theme }}>
27
- <UserProfile {...args} />
28
- </HawaProvider>
29
- );
30
- };
31
-
32
- export const Success = UserProfileTemplate.bind({});
33
- Success.args = {
34
- viaGoogle: true,
35
- viaGithub: true,
36
- viaTwitter: true,
37
- viaFacebook: true
38
- };
39
- export const Failed = UserProfileTemplate.bind({});
40
- Failed.args = {
41
- viaGoogle: true,
42
- viaGithub: true,
43
- viaTwitter: true,
44
- viaFacebook: true
45
- };
46
-
@@ -1,44 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- export const GlobalVariables = (args) => {
5
- // const methods = useForm();
6
- return <div>TESTING COMPONENT</div>;
7
- };
8
- export const AnotherComponent = (args) => {
9
- // const methods = useForm();
10
- return <div>TESTING COMPONENT</div>;
11
- };
12
- AnotherComponent.propTypes = {
13
- textLabel: PropTypes.string
14
- };
15
- export default {
16
- title: "TestTitle",
17
- component: [GlobalVariables, AnotherComponent],
18
- argTypes: {
19
- resize: {
20
- description: "overwritten description",
21
- table: {
22
- type: {
23
- summary: "something short"
24
- },
25
- defaultValue: { summary: "Hello" }
26
- },
27
- options: ["vertical", "horizontal", "both"],
28
- control: { type: "select" }
29
- },
30
- label: {
31
- description: "overwritten description",
32
- table: {
33
- type: {
34
- summary: "something short",
35
- detail: "something really really long"
36
- },
37
- defaultValue: { summary: "Hello" }
38
- },
39
- control: {
40
- type: null
41
- }
42
- }
43
- }
44
- };
@@ -1,92 +0,0 @@
1
- import { storiesOf } from "@storybook/react";
2
-
3
- import "../styles.css";
4
-
5
- const stories = storiesOf("InputLabel", module);
6
-
7
- export default {
8
- title: "Components/InputLabel",
9
- component: [
10
- StyledCheckBox,
11
- StyledTextFieldT,
12
- StyledTextAreaT,
13
- StyledRadioSeletorT
14
- ],
15
- argTypes: {
16
- resize: {
17
- options: ["vertical", "horizontal", "both"],
18
- control: { type: "radio" }
19
- }
20
- }
21
- };
22
-
23
- /****************************/
24
- // STYLED CHECKBOX TEMPLATE
25
- // const StyledCheckBoxTemplate = (args) => {
26
- // const methods = useForm();
27
- // return (
28
- // <FormProvider {...methods}>
29
- // <StyledCheckbox {...args} />
30
- // </FormProvider>
31
- // );
32
- // };
33
- // export const StyledCheckBox = StyledCheckBoxTemplate.bind({});
34
- // StyledCheckBox.args = {
35
- // name: "Components/InputLabel",
36
- // label: "CheckBox",
37
- // color: "blue",
38
- // rules: { required: true },
39
- // defaultValue: true
40
- // };
41
- /****************************/
42
-
43
- /****************************/
44
- // STYLED TextField TEMPLATE
45
- // const StyledTextFieldTemplate = (args) => {
46
- // const methods = useForm();
47
- // return (
48
- // <FormProvider {...methods}>
49
- // <StyledTextField {...args} />
50
- // </FormProvider>
51
- // );
52
- // };
53
-
54
- // export const StyledTextFieldT = StyledTextFieldTemplate.bind({});
55
- // StyledTextFieldT.args = {
56
- // name: "Components/InputLabel",
57
- // inputLabel: "Label",
58
- // bdRadius: 12,
59
- // bgColor: "lightgray",
60
- // helperText: "This is HelperText",
61
- // type: "text",
62
- // placeholder: "exemple ..."
63
- // };
64
-
65
- /****************************/
66
- // Radio Selector Template
67
- // const styledRadioSelectorTempalte = (args) => {
68
- // const methods = useForm();
69
-
70
- // return (
71
- // <FormProvider {...methods}>
72
- // <StyledRadioSelector {...args} />
73
- // </FormProvider>
74
- // );
75
- // };
76
-
77
- // export const StyledRadioSeletorT = styledRadioSelectorTempalte.bind({});
78
- // StyledRadioSeletorT.args = {
79
- // name: "Components/InputLabel",
80
- // shouldUnregister: true,
81
- // options: [
82
- // { text: "Option 1", label: "option1" },
83
- // { text: "Option 2", label: "option2" },
84
- // { text: "Option 3", label: "option3" }
85
- // ],
86
- // selectedColor: "blue",
87
- // bdRadius: 12,
88
- // defaultValue: "option2",
89
- // bgSelectedColor: "red",
90
- // textSelectedColor: "black"
91
- // };
92
- /****************************/
@@ -1,69 +0,0 @@
1
- import React from "react";
2
- import { StyledRadioSelector } from "../ui";
3
- import { HawaProvider } from "../themes/HawaProvider";
4
- import "../styles.css";
5
-
6
- const Template = (args) => {
7
- const theme = {
8
- borderRadius: 5,
9
- primaryColor: "green",
10
- secondaryColor: "red",
11
- // margins: "10px",
12
- paddings: 10
13
- };
14
- return (
15
- <HawaProvider theme={theme}>
16
- <StyledRadioSelector {...args} />
17
- </HawaProvider>
18
- );
19
- };
20
- export default {
21
- title: "Components/RadioSelector",
22
- component: Light,
23
- argTypes: {
24
- options: {
25
- control: "array"
26
- }
27
- },
28
- args: {
29
- options: [
30
- { text: "Option 1", label: "option1" },
31
- { text: "Option 2", label: "option2" },
32
- { text: "Option 3", label: "option3" }
33
- ]
34
- }
35
- };
36
-
37
- export const Light = Template.bind({});
38
-
39
- Light.args = {
40
- options: [
41
- { text: "Option 1", label: "option1" },
42
- { text: "Option 2", label: "option2" },
43
- { text: "Option 3", label: "option3" }
44
- ],
45
- selectedColor: "blue",
46
- borderRadius: 12,
47
- defaultValue: "option2",
48
- bgSelectedColor: "red",
49
- textSelectedColor: "white",
50
- handleChange: () => {
51
- console.log("handleChange goes here");
52
- }
53
- };
54
- export const Dark = Template.bind({});
55
- Dark.args = {
56
- options: [
57
- { text: "Option 1", label: "option1" },
58
- { text: "Option 2", label: "option2" },
59
- { text: "Option 3", label: "option3" }
60
- ],
61
- selectedColor: "blue",
62
- borderRadius: 12,
63
- defaultValue: "option2",
64
- bgSelectedColor: "blue",
65
- textSelectedColor: "white",
66
- handleChange: () => {
67
- console.log("handleChange goes here");
68
- }
69
- };
@@ -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 ApplePayButton = (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/apple-pay.png"
77
- height={40}
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,91 +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 GithubButton = (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
- <GitHubIcon />
76
- <div style={{ width: 10 }} />
77
- <p
78
- style={{
79
- color: "black",
80
- fontSize: 14,
81
- textAlign: "center",
82
- letterSpacing: 0.4,
83
- fontFamily: "Roboto",
84
- fontWeight: 500
85
- }}
86
- >
87
- {props.buttonText}
88
- </p>
89
- </StyledButton>
90
- );
91
- };
@@ -1,83 +0,0 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
3
- import { styled, darken } from "@mui/material/styles";
4
- import Button from "@mui/material/Button";
5
-
6
- export const GoogleButton = (props) => {
7
- const theme = useContext(ThemeProvider);
8
- let buttonStyle = {};
9
-
10
- console.log(Object.keys(theme.actionButton));
11
- let currentTheme = Object.keys(theme.actionButton).find(
12
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
13
- );
14
- if (currentTheme) {
15
- buttonStyle = {
16
- cursor: "pointer",
17
- display: "flex",
18
- flexDirection: "row",
19
- alignItems: "center",
20
- justifyContent: "center",
21
- marginTop: theme.layout[currentTheme].margin,
22
- border: props.outlined ? "2px solid black" : "none",
23
- borderRadius: theme.layout[currentTheme].borderRadius,
24
- backgroundColor: "white",
25
- "&:hover": {
26
- backgroundColor: darken("#ffffff", 0.1)
27
- }
28
- };
29
- } else {
30
- buttonStyle = {
31
- cursor: "pointer",
32
- display: "flex",
33
- flexDirection: "row",
34
- alignItems: "center",
35
- justifyContent: "center",
36
- marginTop: theme.margins,
37
- border: props.outlined ? "2px solid black" : "none",
38
- borderRadius: 0,
39
- backgroundColor: "white",
40
- "&:hover": {
41
- backgroundColor: darken("#ffffff", 0.1)
42
- }
43
- };
44
- }
45
- const StyledButton = styled(Button)(({ theme }) => {
46
- return {
47
- // "label + &": {
48
- // marginTop: theme.spacing(3)
49
- // },
50
-
51
- borderRadius: 4,
52
- position: "relative",
53
- border: "1px solid #ced4da",
54
- fontSize: 16,
55
- // width: "auto",
56
- height: 50,
57
- // padding: "10px 12px",
58
- ...buttonStyle,
59
- "&:focus": {
60
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
61
- borderColor: theme.palette.primary.main
62
- }
63
- };
64
- });
65
- return (
66
- <StyledButton onClick={props.handleClick}>
67
- <img src="https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg" />
68
- <div style={{ width: 10 }} />
69
- <p
70
- style={{
71
- color: "black",
72
- fontSize: 14,
73
- textAlign: "center",
74
- letterSpacing: 0.4,
75
- fontFamily: "Roboto",
76
- fontWeight: 500
77
- }}
78
- >
79
- {props.buttonText}
80
- </p>
81
- </StyledButton>
82
- );
83
- };