@sikka/hawa 0.0.29 → 0.0.32

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 (37) 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/UserProfileForm.js +5 -0
  5. package/src/blocks/AuthForms/NewPasswordForm.js +22 -1
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +16 -3
  7. package/src/blocks/AuthForms/SignInForm.js +19 -1
  8. package/src/blocks/AuthForms/SignUpForm.js +31 -9
  9. package/src/blocks/Payment/ChargeWalletForm.js +21 -8
  10. package/src/blocks/Payment/CheckoutForm.js +17 -1
  11. package/src/blocks/Payment/Confirmation.js +27 -1
  12. package/src/blocks/Payment/CreditCardForm.js +0 -23
  13. package/src/blocks/Payment/{PaymentMethod.js → Form/PaymentMethod.js} +0 -10
  14. package/src/blocks/Pricing/PricingPlans.js +18 -1
  15. package/src/elements/HawaAccordian.js +28 -0
  16. package/src/elements/HawaAlert.js +10 -1
  17. package/src/elements/HawaColorPicker.js +1 -0
  18. package/src/elements/HawaLogoButton.js +18 -1
  19. package/src/elements/HawaPopMenu.js +7 -1
  20. package/src/elements/HawaPricingCard.js +18 -1
  21. package/src/elements/HawaRadio.js +6 -1
  22. package/src/elements/HawaRange.js +31 -0
  23. package/src/elements/HawaSearchBar.js +17 -0
  24. package/src/elements/HawaSettingsRow.js +12 -4
  25. package/src/elements/{OfflineBanner.js → HawaSnackbar.js} +3 -8
  26. package/src/elements/HawaTable.js +65 -20
  27. package/src/elements/HawaTextField.js +6 -2
  28. package/src/elements/index.js +4 -1
  29. package/src/layout/HawaAppLayout.js +33 -61
  30. package/storybook-static/iframe.html +1 -1
  31. package/storybook-static/main.c86d0451.iframe.bundle.js +1 -0
  32. package/storybook-static/vendors~main.924b4d3c.iframe.bundle.js +76 -0
  33. package/storybook-static/{vendors~main.b026595c.iframe.bundle.js.LICENSE.txt → vendors~main.924b4d3c.iframe.bundle.js.LICENSE.txt} +0 -0
  34. package/storybook-static/vendors~main.924b4d3c.iframe.bundle.js.map +1 -0
  35. package/storybook-static/main.c6115a9b.iframe.bundle.js +0 -1
  36. package/storybook-static/vendors~main.b026595c.iframe.bundle.js +0 -76
  37. package/storybook-static/vendors~main.b026595c.iframe.bundle.js.map +0 -1
@@ -53,14 +53,27 @@ export const ResetPasswordForm = (props) => {
53
53
  </form>
54
54
  ) : (
55
55
  <HawaTypography style={{ textAlign: "center", margin: 5 }}>
56
- {props.emailSentText}
56
+ {props.texts.emailSentText}
57
57
  </HawaTypography>
58
58
  )}
59
59
  </Container>
60
60
  );
61
61
  };
62
62
  ResetPasswordForm.propTypes = {
63
- texts: PropTypes.object,
64
- emailSentText: PropTypes.string,
63
+ /**
64
+ * An object of all the texts in the blocks
65
+ */
66
+ texts: PropTypes.shape({
67
+ emailLabel: PropTypes.string,
68
+ emailPlaceholder: PropTypes.string,
69
+ emailRequiredText: PropTypes.string,
70
+ emailInvalidText: PropTypes.string,
71
+ emailSentText: PropTypes.string,
72
+ resetPassword: PropTypes.string
73
+ }),
74
+ /**
75
+ * a boolean to replace the form with a success message
76
+ */
77
+ sent: PropTypes.bool,
65
78
  handleResetPassword: PropTypes.func
66
79
  };
@@ -143,7 +143,25 @@ export const SignInForm = (props) => {
143
143
  );
144
144
  };
145
145
  SignInForm.propTypes = {
146
- texts: PropTypes.object,
146
+ /**
147
+ * An object of all the texts in the blocks
148
+ */
149
+ texts: PropTypes.shape({
150
+ emailLabel: PropTypes.string,
151
+ emailPlaceholder: PropTypes.string,
152
+ emailRequiredText: PropTypes.string,
153
+ emailInvalidText: PropTypes.string,
154
+ passwordLabel: PropTypes.string,
155
+ passwordPlaceholder: PropTypes.string,
156
+ passwordRequiredText: PropTypes.string,
157
+ forgotPasswordText: PropTypes.string,
158
+ newUserText: PropTypes.string,
159
+ signUpText: PropTypes.string,
160
+ signInText: PropTypes.string,
161
+ googleButtonLabel: PropTypes.string,
162
+ githubButtonLabel: PropTypes.string,
163
+ twitterButtonLabel: PropTypes.string
164
+ }),
147
165
  viaGoogle: PropTypes.bool,
148
166
  viaGithub: PropTypes.bool,
149
167
  viaTwitter: PropTypes.bool,
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { HawaTextField, HawaLogoButton } from "../../elements";
2
+ import { HawaTextField, HawaLogoButton, HawaAlert } from "../../elements";
3
3
  import PropTypes from "prop-types";
4
4
  import { Controller, FormProvider, useForm } from "react-hook-form";
5
5
  import PersonIcon from "@mui/icons-material/PermIdentityOutlined";
@@ -10,8 +10,6 @@ import Container from "@mui/material/Container";
10
10
  import Divider from "@mui/material/Divider";
11
11
  import Typography from "@mui/material/Typography";
12
12
  import Button from "@mui/material/Button";
13
- import Alert from "@mui/material/Alert";
14
- import AlertTitle from "@mui/material/AlertTitle";
15
13
 
16
14
  export const SignUpForm = (props) => {
17
15
  const methods = useForm();
@@ -27,11 +25,12 @@ export const SignUpForm = (props) => {
27
25
  variant="auth"
28
26
  style={{ direction: props.lang === "ar" ? "rtl" : "ltr" }}
29
27
  >
30
- {props.error && (
31
- <Alert severity="error" variant="inContainer">
32
- {props.errorTitle && <AlertTitle>{props.errorTitle}</AlertTitle>}
33
- {props.errorText}
34
- </Alert>
28
+ {props.showError && (
29
+ <HawaAlert
30
+ title={props.errorTitle}
31
+ text={props.errorText}
32
+ severity="error"
33
+ />
35
34
  )}
36
35
 
37
36
  <FormProvider {...methods}>
@@ -164,7 +163,30 @@ export const SignUpForm = (props) => {
164
163
  };
165
164
 
166
165
  SignUpForm.propTypes = {
167
- texts: PropTypes.object,
166
+ /**
167
+ * An object of all the texts in the blocks
168
+ */
169
+ texts: PropTypes.shape({
170
+ fullNameLabel: PropTypes.string,
171
+ fullNamePlaceholder: PropTypes.string,
172
+ fullNameRequiredText: PropTypes.string,
173
+ emailLabel: PropTypes.string,
174
+ emailPlaceholder: PropTypes.string,
175
+ emailRequiredText: PropTypes.string,
176
+ emailInvalidText: PropTypes.string,
177
+ passwordLabel: PropTypes.string,
178
+ passwordPlaceholder: PropTypes.string,
179
+ passwordRequiredText: PropTypes.string,
180
+ passwordTooShortText: PropTypes.string,
181
+ forgotPasswordText: PropTypes.string,
182
+ newUserText: PropTypes.string,
183
+ signUpText: PropTypes.string,
184
+ signInText: PropTypes.string,
185
+ existingUserText: PropTypes.string,
186
+ googleButtonLabel: PropTypes.string,
187
+ githubButtonLabel: PropTypes.string,
188
+ twitterButtonLabel: PropTypes.string
189
+ }),
168
190
  viaGoogle: PropTypes.bool,
169
191
  viaGithub: PropTypes.bool,
170
192
  viaTwitter: PropTypes.bool,
@@ -48,16 +48,15 @@ export const ChargeWalletForm = (props) => {
48
48
  field.onChange(parseFloat(e.target.value));
49
49
  setWalletAmount(e.target.value);
50
50
  }}
51
+ helperText={errors.amount?.message}
51
52
  />
52
53
  )}
54
+ rules={{
55
+ required: props.texts.amountRequired
56
+ }}
53
57
  />
54
58
 
55
- <Button
56
- type="submit"
57
- fullWidth
58
- variant="last"
59
- onClick={props.handleSignIn}
60
- >
59
+ <Button type="submit" fullWidth variant="last">
61
60
  {props.texts.chargeWallet}
62
61
  </Button>
63
62
  </form>
@@ -67,6 +66,20 @@ export const ChargeWalletForm = (props) => {
67
66
  };
68
67
 
69
68
  ChargeWalletForm.propTypes = {
70
- texts: PropTypes.object,
71
- handleChargeWallet: PropTypes.func
69
+ /**
70
+ * The texts object for all the texts in the block
71
+ */
72
+ texts: PropTypes.shape({
73
+ amountLabel: PropTypes.string,
74
+ chargeWallet: PropTypes.string,
75
+ amountRequired: PropTypes.string
76
+ }),
77
+ /**
78
+ * Function called when charge wallet button is clicked
79
+ */
80
+ handleChargeWallet: PropTypes.func,
81
+ /**
82
+ * The currency text under the amount
83
+ */
84
+ currency: PropTypes.string
72
85
  };
@@ -246,7 +246,23 @@ export const CheckoutForm = (props) => {
246
246
  };
247
247
 
248
248
  CheckoutForm.propTypes = {
249
- texts: PropTypes.object,
249
+ texts: PropTypes.shape({
250
+ orderDetails: PropTypes.string,
251
+ billingAddress: PropTypes.string,
252
+ payNow: PropTypes.string,
253
+ emailLabel: PropTypes.string,
254
+ emailRequiredText: PropTypes.string,
255
+ emailInvalidText: PropTypes.string,
256
+ firstNameLabel: PropTypes.string,
257
+ required: PropTypes.string,
258
+ lastNameLabel: PropTypes.string,
259
+ streetAddressLabel: PropTypes.string,
260
+ buildingNumberLabel: PropTypes.string,
261
+ cityLabel: PropTypes.string,
262
+ stateLabel: PropTypes.string,
263
+ countryLabel: PropTypes.string,
264
+ zipCodeLabel: PropTypes.string
265
+ }),
250
266
  lang: PropTypes.string,
251
267
  countriesList: PropTypes.array,
252
268
  products: PropTypes.array,
@@ -100,7 +100,33 @@ export const ConfirmationPage = (props) => {
100
100
  };
101
101
 
102
102
  ConfirmationPage.propTypes = {
103
- texts: PropTypes.object,
103
+ /**
104
+ * The texts object for all the texts in the block
105
+ */
106
+ texts: PropTypes.shape({
107
+ print: PropTypes.string,
108
+ history: PropTypes.string,
109
+ homePage: PropTypes.string,
110
+ successMessage: PropTypes.string,
111
+ orderDetails: PropTypes.string,
112
+ fasterPaymentNote: PropTypes.string,
113
+ billingAddress: PropTypes.string,
114
+ payNow: PropTypes.string,
115
+ yourOrderNumber: PropTypes.string,
116
+ emailLabel: PropTypes.string,
117
+ emailRequiredText: PropTypes.string,
118
+ emailInvalidText: PropTypes.string,
119
+ firstNameLabel: PropTypes.string,
120
+ required: PropTypes.string,
121
+ lastNameLabel: PropTypes.string,
122
+ streetAddressLabel: PropTypes.string,
123
+ buildingNumberLabel: PropTypes.string,
124
+ cityLabel: PropTypes.string,
125
+ stateLabel: PropTypes.string,
126
+ countryLabel: PropTypes.string,
127
+ zipCodeLabel: PropTypes.string,
128
+ refundPolicy: PropTypes.string
129
+ }),
104
130
  products: PropTypes.array,
105
131
  countriesList: PropTypes.array,
106
132
  lang: PropTypes.string,
@@ -21,19 +21,12 @@ export const CreditCardForm = (props) => {
21
21
  placeholder="Enter password"
22
22
  type="tel"
23
23
  label="Card Number"
24
- // variant="unscrollable"
25
- // startAdornment={
26
- // <InputAdornment position="start">
27
- // <PasswordIcon />
28
- // </InputAdornment>
29
- // }
30
24
  rules={{
31
25
  required: "Password is rquired"
32
26
  }}
33
27
  helperText={errors.password?.message}
34
28
  />
35
29
 
36
-
37
30
  <Controller
38
31
  control={control}
39
32
  name="cardName"
@@ -44,11 +37,6 @@ export const CreditCardForm = (props) => {
44
37
  placeholder="Enter password"
45
38
  type="password"
46
39
  label="Name On Card"
47
- // startAdornment={
48
- // <InputAdornment position="start">
49
- // <PasswordIcon />
50
- // </InputAdornment>
51
- // }
52
40
  rules={{
53
41
  required: "Password is rquired"
54
42
  }}
@@ -66,11 +54,6 @@ export const CreditCardForm = (props) => {
66
54
  placeholder="Enter password"
67
55
  type="password"
68
56
  label="Expiry Date"
69
- // startAdornment={
70
- // <InputAdornment position="start">
71
- // <PasswordIcon />
72
- // </InputAdornment>
73
- // }
74
57
  rules={{
75
58
  required: "Password is rquired"
76
59
  }}
@@ -88,11 +71,6 @@ export const CreditCardForm = (props) => {
88
71
  placeholder="Enter password"
89
72
  type="password"
90
73
  label="CCV"
91
- // startAdornment={
92
- // <InputAdornment position="start">
93
- // <PasswordIcon />
94
- // </InputAdornment>
95
- // }
96
74
  rules={{
97
75
  required: "Password is rquired"
98
76
  }}
@@ -107,7 +85,6 @@ export const CreditCardForm = (props) => {
107
85
  variant="last"
108
86
  onClick={props.handlePayWithCreditCard}
109
87
  >
110
- {/* {props.texts.signInText} */}
111
88
  {"Pay with Credit Card"}
112
89
  </Button>
113
90
  </form>
@@ -85,7 +85,6 @@ const PaymentMethodButton = (props) => {
85
85
  {props.imageURL ? (
86
86
  <div
87
87
  style={{
88
- // backgroundColor: "red",
89
88
  width: "50%",
90
89
  textAlign: "right",
91
90
  paddingRight: 20
@@ -93,14 +92,7 @@ const PaymentMethodButton = (props) => {
93
92
  >
94
93
  <img
95
94
  src={props.imageURL}
96
- // src={`https://qawaim-images.s3-ap-southeast-1.amazonaws.com/payments/visa.png`}
97
- // alt=""
98
- // srcset=""
99
- // height={"100%"}
100
- // width={"30%"}
101
95
  style={{
102
- // height: "100%",
103
- // aspectRatio: "6/4",
104
96
  maxWidth: 70,
105
97
  maxHeight: 70,
106
98
  height: "auto"
@@ -110,7 +102,6 @@ const PaymentMethodButton = (props) => {
110
102
  ) : null}
111
103
  <div
112
104
  style={{
113
- // backgroundColor: "blue",
114
105
  width: "50%",
115
106
  textAlign: props.imageURL ? "left" : "center"
116
107
  }}
@@ -130,7 +121,6 @@ const PaymentMethodButton = (props) => {
130
121
  };
131
122
 
132
123
  PaymentMethod.propTypes = {
133
- texts: PropTypes.object,
134
124
  wallet: PropTypes.bool,
135
125
  handlePaymentMethod: PropTypes.func
136
126
  };
@@ -58,6 +58,23 @@ export const PricingPlans = (props) => {
58
58
  };
59
59
 
60
60
  PricingPlans.propTypes = {
61
- plans: PropTypes.array,
61
+ /**
62
+ * An array of the pricing plans
63
+ */
64
+ plans: PropTypes.arrayOf(
65
+ PropTypes.shape({
66
+ title: PropTypes.string,
67
+ title_ar: PropTypes.string,
68
+ subtitle: PropTypes.string,
69
+ subtitle_ar: PropTypes.string,
70
+ price: PropTypes.number,
71
+ currency: PropTypes.string,
72
+ cycleText: PropTypes.string,
73
+ buttonText: PropTypes.string,
74
+ features: PropTypes.array,
75
+ features_ar: PropTypes.array,
76
+ selectedPlan: PropTypes.bool
77
+ })
78
+ ),
62
79
  lang: PropTypes.string
63
80
  };
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import ExpandMore from "@mui/icons-material/ExpandMore";
3
+ import Typography from "@mui/material/Typography";
4
+ import Accordion from "@mui/material/Accordion";
5
+ import AccordionSummary from "@mui/material/AccordionSummary";
6
+ import AccordionDetails from "@mui/material/AccordionDetails";
7
+ import PropTypes from "prop-types";
8
+
9
+ export const HawaAccordian = (props) => {
10
+ return (
11
+ <Accordion elevation={0}>
12
+ <AccordionSummary
13
+ expandIcon={<ExpandMore />}
14
+ aria-controls="panel1a-content"
15
+ id="panel1a-header"
16
+ >
17
+ <Typography>{props.title}</Typography>
18
+ </AccordionSummary>
19
+ <AccordionDetails>
20
+ <Typography>{props.content} </Typography>
21
+ </AccordionDetails>
22
+ </Accordion>
23
+ );
24
+ };
25
+ HawaAccordian.propTypes = {
26
+ title: PropTypes.string,
27
+ content: PropTypes.string
28
+ };
@@ -12,8 +12,17 @@ export const HawaAlert = (props) => {
12
12
  );
13
13
  };
14
14
  HawaAlert.propTypes = {
15
- severity: PropTypes.string,
15
+ /**
16
+ * The severity of the alert. This defines the color and icon used.
17
+ */
18
+ severity: PropTypes.oneOf(["error", "info", "success", "warning"]),
19
+ /**
20
+ * The title of the alert in bold. Can be left empty.
21
+ */
16
22
  title: PropTypes.string,
23
+ /**
24
+ * The text of the alert.
25
+ */
17
26
  text: PropTypes.string,
18
27
  hideIcon: PropTypes.bool
19
28
  };
@@ -20,6 +20,7 @@ const ColorInput = styled.input`
20
20
  }
21
21
  `;
22
22
  const ColorText = styled.input`
23
+ max-width: 70px;
23
24
  -webkit-appearance: none;
24
25
  -moz-appearance: none;
25
26
  appearance: none;
@@ -106,6 +106,23 @@ export const HawaLogoButton = (props) => {
106
106
 
107
107
  HawaLogoButton.propTypes = {
108
108
  lang: PropTypes.string,
109
- logo: PropTypes.string,
109
+ /**
110
+ * The logo/icon of the button
111
+ */
112
+ logo: PropTypes.oneOf([
113
+ "google",
114
+ "github",
115
+ "twitter",
116
+ "wallet",
117
+ "googlepay",
118
+ "applepay",
119
+ "stcpay",
120
+ "visa/master",
121
+ "paypal",
122
+ "mada"
123
+ ]),
124
+ /**
125
+ * The text next to the logo in the button
126
+ */
110
127
  buttonText: PropTypes.string
111
128
  };
@@ -41,5 +41,11 @@ export const HawaPopMenu = (props) => {
41
41
 
42
42
  HawaPopMenu.propTypes = {
43
43
  handleClose: PropTypes.func,
44
- menuItems: PropTypes.array
44
+ menuItems: PropTypes.arrayOf(
45
+ PropTypes.shape({
46
+ icon: PropTypes.element,
47
+ label: PropTypes.string,
48
+ action: PropTypes.func
49
+ })
50
+ )
45
51
  };
@@ -4,6 +4,7 @@ import Button from "@mui/material/Button";
4
4
  import Typography from "@mui/material/Typography";
5
5
  import CheckIcon from "@mui/icons-material/CheckCircleOutlined";
6
6
  import PropTypes from "prop-types";
7
+ import Chip from "@mui/material/Chip";
7
8
 
8
9
  export const HawaPricingCard = (props) => {
9
10
  let isArabic = props.lang === "ar";
@@ -24,6 +25,7 @@ export const HawaPricingCard = (props) => {
24
25
  sar: isArabic ? "ريال" : "SAR"
25
26
  };
26
27
  let featuresMapping = isArabic ? props.features_ar : props.features;
28
+ let chipSpacing = isArabic ? { left: 10 } : { right: 10 };
27
29
  return (
28
30
  <Container
29
31
  maxWidth="xs"
@@ -31,6 +33,19 @@ export const HawaPricingCard = (props) => {
31
33
  style={{ direction: isArabic ? "rtl" : "ltr" }}
32
34
  >
33
35
  <Container variant="plan-header">
36
+ {props.discount && (
37
+ <Chip
38
+ label={props.discount}
39
+ variant="standard"
40
+ style={{
41
+ maxWidth: "fit-content",
42
+ position: "absolute",
43
+ bottom: 10,
44
+ ...chipSpacing
45
+ }}
46
+ color="success"
47
+ />
48
+ )}
34
49
  <Typography variant="h3" fontWeight={500}>
35
50
  {isArabic ? props.title_ar : props.title}
36
51
  </Typography>
@@ -144,5 +159,7 @@ HawaPricingCard.propTypes = {
144
159
  subtitle: PropTypes.string,
145
160
  subtitle_ar: PropTypes.string,
146
161
  features: PropTypes.array,
147
- features_ar: PropTypes.array
162
+ features_ar: PropTypes.array,
163
+ currency: PropTypes.oneOf(["sar", "usd"]),
164
+ cycleText: PropTypes.oneOf(["monthly", "3-months", "6-months", "annually"])
148
165
  };
@@ -31,7 +31,12 @@ export const HawaRadio = (props) => {
31
31
  };
32
32
  HawaRadio.propTypes = {
33
33
  lang: PropTypes.string,
34
- options: PropTypes.array,
34
+ options: PropTypes.arrayOf(
35
+ PropTypes.shape({
36
+ label: PropTypes.string,
37
+ value: PropTypes.string
38
+ })
39
+ ),
35
40
  defaultValue: PropTypes.string,
36
41
  handleChange: PropTypes.func,
37
42
  location: PropTypes.string
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import Slider from "@mui/material/Slider";
3
+ import Stack from "@mui/material/Stack";
4
+ import PropTypes from "prop-types";
5
+
6
+ export const HawaRange = (props) => {
7
+ return (
8
+ <Stack spacing={2} direction="row" alignItems="center" style={props.style}>
9
+ {props.startElement}
10
+ <Slider
11
+ size="small"
12
+ aria-label="Volume"
13
+ value={props.value}
14
+ onChange={props.handleChange}
15
+ />
16
+ {props.endElement}
17
+ </Stack>
18
+ );
19
+ };
20
+ HawaRange.propTypes = {
21
+ /**
22
+ * The element at the side where the range value is 0
23
+ * Can be an icon
24
+ */
25
+ startElement: PropTypes.element,
26
+ /**
27
+ * The element at the side where the range value is 100
28
+ */
29
+ endElement: PropTypes.element,
30
+ handleChange: PropTypes.func
31
+ };
@@ -0,0 +1,17 @@
1
+ import { Search } from "@mui/icons-material";
2
+ import { InputAdornment } from "@mui/material";
3
+ import React from "react";
4
+ import { HawaTextField } from "./HawaTextField";
5
+
6
+ export const HawaSearchBar = (props) => {
7
+ return (
8
+ <HawaTextField
9
+ endAdornment={
10
+ <InputAdornment position="start">
11
+ <Search />
12
+ </InputAdornment>
13
+ }
14
+ {...props}
15
+ />
16
+ );
17
+ };
@@ -7,6 +7,7 @@ import { HawaTextField } from "./HawaTextField";
7
7
  import { HawaRadio } from "./HawaRadio";
8
8
  import { HawaSwitch } from "./HawaSwitch";
9
9
  import { HawaColorPicker } from "./HawaColorPicker";
10
+ import { HawaRange } from "./HawaRange";
10
11
 
11
12
  export const HawaSettingsRow = (props) => {
12
13
  return (
@@ -14,16 +15,23 @@ export const HawaSettingsRow = (props) => {
14
15
  <HawaTypography>{props.settingsLabel}</HawaTypography>
15
16
  {props.settingsType === "checkbox" && <Checkbox {...props} />}
16
17
  {props.settingsType === "text" && <HawaTextField {...props} />}
18
+ {props.settingsType === "boolean" && <HawaSwitch {...props} />}
19
+ {props.settingsType === "range" && <HawaRange {...props} />}
20
+ {props.settingsType === "color" && <HawaColorPicker {...props} />}
17
21
  {props.settingsType === "radio" && (
18
22
  <HawaRadio location="inSettings" {...props} />
19
23
  )}
20
- {props.settingsType === "boolean" && <HawaSwitch {...props} />}
21
- {props.settingsType === "color" && <HawaColorPicker {...props} />}
22
24
  </Container>
23
25
  );
24
26
  };
25
27
 
26
28
  HawaSettingsRow.propTypes = {
27
- type: PropTypes.oneOf(["checkbox", "text", "radio", "boolean", "color"]),
28
- helperText: PropTypes.string
29
+ settingsLabel: PropTypes.string,
30
+ settingsType: PropTypes.oneOf([
31
+ "checkbox",
32
+ "text",
33
+ "radio",
34
+ "boolean",
35
+ "color"
36
+ ])
29
37
  };
@@ -3,15 +3,10 @@ import Snackbar from "@mui/material/Snackbar";
3
3
  import AlertTitle from "@mui/material/AlertTitle";
4
4
  import Alert from "@mui/material/Alert";
5
5
 
6
- export const OfflineBanner = (props) => {
6
+ export const HawaSnackbar = (props) => {
7
7
  return (
8
- <Snackbar
9
- variant="danger"
10
- // style={{ outline: "1px solid red" }}
11
- open={props.open}
12
- onClose={props.handleClose}
13
- >
14
- <Alert icon={false} severity={"error"} variant="offline">
8
+ <Snackbar open={props.open} onClose={props.handleClose}>
9
+ <Alert icon={false} severity={props.severity}>
15
10
  {props.title && <AlertTitle>{props.title}</AlertTitle>}
16
11
  {props.text}
17
12
  </Alert>