@sikka/hawa 0.0.48 → 0.0.50
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/UserProfileForm.js +4 -4
- package/src/blocks/Account/UserSettingsForm.js +3 -8
- package/src/blocks/Payment/ChargeWalletForm.js +3 -4
- package/src/blocks/Payment/CheckoutForm.js +8 -4
- package/src/blocks/Payment/Confirmation.js +7 -8
- package/src/blocks/Payment/CreditCardForm.js +3 -5
- package/src/blocks/Payment/Form/CForm.js +4 -5
- package/src/blocks/Payment/Form/PaymentMethod.js +2 -3
- package/src/blocks/Payment/Gateway/Wallet.js +2 -3
- package/src/blocks/Payment/PayWithWallet.js +3 -4
- package/src/elements/HawaLogoButton.js +21 -23
- package/src/elements/HawaPanelTabs.js +3 -3
- package/src/elements/HawaPricingCard.js +2 -3
- package/src/elements/HawaTooltip.js +54 -0
- package/src/elements/ResponsiveButton.js +12 -9
- package/src/elements/index.js +1 -0
- package/src/layout/HawaAppLayout2.js +34 -40
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.c82b0a52.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/vendors~main.c0e24dea.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.ceb9a32a.iframe.bundle.js.LICENSE.txt → vendors~main.c0e24dea.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.c0e24dea.iframe.bundle.js.map +1 -0
- package/src/elements/StyledTooltip.js +0 -46
- package/storybook-static/main.7d233d65.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.ceb9a32a.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.ceb9a32a.iframe.bundle.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HawaTextField } from "../../elements";
|
|
2
|
+
import { HawaButton, HawaTextField } from "../../elements";
|
|
3
3
|
import { Controller, FormProvider, useForm } from "react-hook-form";
|
|
4
4
|
import Container from "@mui/material/Container";
|
|
5
|
-
import Button from "@mui/material/Button";
|
|
6
5
|
|
|
7
6
|
export const UserProfileForm = (props) => {
|
|
8
7
|
const methods = useForm();
|
|
@@ -141,9 +140,10 @@ export const UserProfileForm = (props) => {
|
|
|
141
140
|
/>
|
|
142
141
|
);
|
|
143
142
|
})}
|
|
144
|
-
|
|
143
|
+
|
|
144
|
+
<HawaButton fullWidth type="submit">
|
|
145
145
|
{props.texts.updateProfile}
|
|
146
|
-
</
|
|
146
|
+
</HawaButton>
|
|
147
147
|
</form>
|
|
148
148
|
</FormProvider>
|
|
149
149
|
</Container>
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import Button from "@mui/material/Button";
|
|
2
1
|
import Container from "@mui/material/Container";
|
|
2
|
+
import { HawaButton } from "../../elements";
|
|
3
3
|
|
|
4
4
|
export const UserSettingsForm = (props) => {
|
|
5
5
|
return (
|
|
6
6
|
<Container maxWidth="sm">
|
|
7
7
|
{props.children}
|
|
8
|
-
<
|
|
9
|
-
type="submit"
|
|
10
|
-
fullWidth
|
|
11
|
-
variant="last"
|
|
12
|
-
onClick={props.handleSaveSettings}
|
|
13
|
-
>
|
|
8
|
+
<HawaButton type="submit" fullWidth onClick={props.handleSaveSettings}>
|
|
14
9
|
{props.saveSettingsText}
|
|
15
|
-
</
|
|
10
|
+
</HawaButton>
|
|
16
11
|
</Container>
|
|
17
12
|
);
|
|
18
13
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { HawaTextField } from "../../elements";
|
|
2
|
+
import { HawaButton, HawaTextField } from "../../elements";
|
|
3
3
|
import { Controller, FormProvider, useForm } from "react-hook-form";
|
|
4
4
|
import Container from "@mui/material/Container";
|
|
5
|
-
import Button from "@mui/material/Button";
|
|
6
5
|
import Typography from "@mui/material/Typography";
|
|
7
6
|
import PropTypes from "prop-types";
|
|
8
7
|
|
|
@@ -56,9 +55,9 @@ export const ChargeWalletForm = (props) => {
|
|
|
56
55
|
}}
|
|
57
56
|
/>
|
|
58
57
|
|
|
59
|
-
<
|
|
58
|
+
<HawaButton type="submit" fullWidth>
|
|
60
59
|
{props.texts.chargeWallet}
|
|
61
|
-
</
|
|
60
|
+
</HawaButton>
|
|
62
61
|
</form>
|
|
63
62
|
</FormProvider>
|
|
64
63
|
</Container>
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
HawaTextField,
|
|
4
|
+
HawaTable,
|
|
5
|
+
HawaSelect,
|
|
6
|
+
HawaButton
|
|
7
|
+
} from "../../elements";
|
|
3
8
|
import { Controller, FormProvider, useForm } from "react-hook-form";
|
|
4
|
-
import Button from "@mui/material/Button";
|
|
5
9
|
import Container from "@mui/material/Container";
|
|
6
10
|
import Typography from "@mui/material/Typography";
|
|
7
11
|
import Divider from "@mui/material/Divider";
|
|
@@ -236,9 +240,9 @@ export const CheckoutForm = (props) => {
|
|
|
236
240
|
)}
|
|
237
241
|
/>
|
|
238
242
|
</Container>
|
|
239
|
-
<
|
|
243
|
+
<HawaButton type="submit" fullWidth>
|
|
240
244
|
{props.texts.payNow}
|
|
241
|
-
</
|
|
245
|
+
</HawaButton>
|
|
242
246
|
</form>
|
|
243
247
|
</FormProvider>
|
|
244
248
|
</Container>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HawaTable } from "../../elements";
|
|
3
|
-
import Button from "@mui/material/Button";
|
|
2
|
+
import { HawaButton, HawaTable } from "../../elements";
|
|
4
3
|
import Container from "@mui/material/Container";
|
|
5
4
|
import Typography from "@mui/material/Typography";
|
|
6
5
|
import Divider from "@mui/material/Divider";
|
|
@@ -69,15 +68,15 @@ export const ConfirmationPage = (props) => {
|
|
|
69
68
|
<Divider variant="middle" />
|
|
70
69
|
</>
|
|
71
70
|
)}
|
|
72
|
-
<
|
|
71
|
+
<HawaButton fullWidth onClick={props.handlePrint}>
|
|
73
72
|
{props.texts.print}
|
|
74
|
-
</
|
|
75
|
-
<
|
|
73
|
+
</HawaButton>
|
|
74
|
+
<HawaButton fullWidth onClick={props.handleHistory}>
|
|
76
75
|
{props.texts.history}
|
|
77
|
-
</
|
|
78
|
-
<
|
|
76
|
+
</HawaButton>
|
|
77
|
+
<HawaButton fullWidth onClick={props.handleHome}>
|
|
79
78
|
{props.texts.homePage}
|
|
80
|
-
</
|
|
79
|
+
</HawaButton>
|
|
81
80
|
<Typography align="center" variant="body2" style={{ marginTop: 10 }}>
|
|
82
81
|
{props.texts.fasterPaymentNote}
|
|
83
82
|
</Typography>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HawaTextField } from "../../elements";
|
|
2
|
+
import { HawaButton, HawaTextField } from "../../elements";
|
|
3
3
|
import { Controller, FormProvider, useForm } from "react-hook-form";
|
|
4
|
-
import Button from "@mui/material/Button";
|
|
5
4
|
import Container from "@mui/material/Container";
|
|
6
5
|
|
|
7
6
|
export const CreditCardForm = (props) => {
|
|
@@ -79,14 +78,13 @@ export const CreditCardForm = (props) => {
|
|
|
79
78
|
)}
|
|
80
79
|
/>
|
|
81
80
|
|
|
82
|
-
<
|
|
81
|
+
<HawaButton
|
|
83
82
|
type="submit"
|
|
84
83
|
fullWidth
|
|
85
|
-
variant="last"
|
|
86
84
|
onClick={props.handlePayWithCreditCard}
|
|
87
85
|
>
|
|
88
86
|
{"Pay with Credit Card"}
|
|
89
|
-
</
|
|
87
|
+
</HawaButton>
|
|
90
88
|
</form>
|
|
91
89
|
</Container>
|
|
92
90
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from "react";
|
|
2
2
|
import sha256 from "crypto-js/sha256";
|
|
3
|
-
import Button from "@mui/material/Button";
|
|
4
3
|
import CircularProgress from "@mui/material/CircularProgress";
|
|
5
4
|
import useTranslation from "next-translate/useTranslation";
|
|
6
5
|
import axios from "axios";
|
|
6
|
+
import { HawaButton } from "../../../elements";
|
|
7
7
|
|
|
8
8
|
const currentYear = new Date().getFullYear();
|
|
9
9
|
const monthsArr = Array.from({ length: 12 }, (x, i) => {
|
|
@@ -305,9 +305,8 @@ export default function CForm({
|
|
|
305
305
|
/>
|
|
306
306
|
)}
|
|
307
307
|
</form>
|
|
308
|
-
<
|
|
309
|
-
|
|
310
|
-
color="primary"
|
|
308
|
+
<HawaButton
|
|
309
|
+
// color="primary"
|
|
311
310
|
fullWidth
|
|
312
311
|
onClick={handlePayfortForm}
|
|
313
312
|
>
|
|
@@ -320,7 +319,7 @@ export default function CForm({
|
|
|
320
319
|
) : (
|
|
321
320
|
<span className="pay-new-btn-txt">{t("pay-now")}</span>
|
|
322
321
|
)}
|
|
323
|
-
</
|
|
322
|
+
</HawaButton>
|
|
324
323
|
</div>
|
|
325
324
|
</div>
|
|
326
325
|
</div>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import useTranslation from "next-translate/useTranslation";
|
|
2
|
-
import Button from "@mui/material/Button";
|
|
3
2
|
import Chip from "@mui/material/Chip";
|
|
4
3
|
import PropTypes from "prop-types";
|
|
5
4
|
|
|
@@ -68,7 +67,7 @@ export const PaymentMethod = (props) => {
|
|
|
68
67
|
|
|
69
68
|
const PaymentMethodButton = (props) => {
|
|
70
69
|
return (
|
|
71
|
-
<
|
|
70
|
+
<button
|
|
72
71
|
disabled={props?.chip ? true : false}
|
|
73
72
|
fullWidth
|
|
74
73
|
variant="contained"
|
|
@@ -116,7 +115,7 @@ const PaymentMethodButton = (props) => {
|
|
|
116
115
|
/>
|
|
117
116
|
) : null}
|
|
118
117
|
</div>
|
|
119
|
-
</
|
|
118
|
+
</button>
|
|
120
119
|
);
|
|
121
120
|
};
|
|
122
121
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import useTranslation from "next-translate/useTranslation";
|
|
2
|
-
import Button from "@mui/material/Button";
|
|
3
2
|
import Grid from "@mui/material/Grid";
|
|
4
3
|
import Paper from "@mui/material/Paper";
|
|
5
4
|
import CircularProgress from "@mui/material/CircularProgress";
|
|
@@ -120,7 +119,7 @@ const Wallet = (props) => {
|
|
|
120
119
|
</Grid>
|
|
121
120
|
{!props.leftAmount && (
|
|
122
121
|
<Grid item xs={12}>
|
|
123
|
-
<
|
|
122
|
+
<button
|
|
124
123
|
variant="contained"
|
|
125
124
|
color="primary"
|
|
126
125
|
fullWidth
|
|
@@ -136,7 +135,7 @@ const Wallet = (props) => {
|
|
|
136
135
|
) : (
|
|
137
136
|
t("pay-now")
|
|
138
137
|
)}
|
|
139
|
-
</
|
|
138
|
+
</button>
|
|
140
139
|
</Grid>
|
|
141
140
|
)}
|
|
142
141
|
</Grid>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Typography from "@mui/material/Typography";
|
|
3
3
|
import Container from "@mui/material/Container";
|
|
4
|
-
import
|
|
4
|
+
import { HawaButton } from "../../elements";
|
|
5
5
|
|
|
6
6
|
export const PayWithWallet = (props) => {
|
|
7
7
|
return (
|
|
@@ -11,14 +11,13 @@ export const PayWithWallet = (props) => {
|
|
|
11
11
|
{props.walletBalance || "0"}
|
|
12
12
|
<Typography>{props.currency || "SAR"}</Typography>
|
|
13
13
|
</Typography>
|
|
14
|
-
<
|
|
14
|
+
<HawaButton
|
|
15
15
|
type="submit"
|
|
16
16
|
fullWidth
|
|
17
|
-
variant="last"
|
|
18
17
|
onClick={props.handlePayWithWallet}
|
|
19
18
|
>
|
|
20
19
|
{"Pay Now"}
|
|
21
|
-
</
|
|
20
|
+
</HawaButton>
|
|
22
21
|
</Container>
|
|
23
22
|
);
|
|
24
23
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Button from "@mui/material/Button";
|
|
3
2
|
import GitHubIcon from "@mui/icons-material/GitHub";
|
|
4
3
|
import TwitterIcon from "@mui/icons-material/Twitter";
|
|
5
4
|
import WalletIcon from "@mui/icons-material/AccountBalanceWallet";
|
|
6
|
-
import Typography from "@mui/material/Typography";
|
|
7
5
|
import PropTypes from "prop-types";
|
|
8
6
|
|
|
9
7
|
export const HawaLogoButton = (props) => {
|
|
@@ -29,7 +27,8 @@ export const HawaLogoButton = (props) => {
|
|
|
29
27
|
logoElement = (
|
|
30
28
|
<img
|
|
31
29
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png"
|
|
32
|
-
height={20}
|
|
30
|
+
// height={20}
|
|
31
|
+
className="h-6"
|
|
33
32
|
/>
|
|
34
33
|
);
|
|
35
34
|
break;
|
|
@@ -37,7 +36,8 @@ export const HawaLogoButton = (props) => {
|
|
|
37
36
|
logoElement = (
|
|
38
37
|
<img
|
|
39
38
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png"
|
|
40
|
-
height={20}
|
|
39
|
+
// height={20}
|
|
40
|
+
className="h-6"
|
|
41
41
|
/>
|
|
42
42
|
);
|
|
43
43
|
break;
|
|
@@ -45,7 +45,8 @@ export const HawaLogoButton = (props) => {
|
|
|
45
45
|
logoElement = (
|
|
46
46
|
<img
|
|
47
47
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png"
|
|
48
|
-
height={30}
|
|
48
|
+
// height={30}
|
|
49
|
+
className="h-6"
|
|
49
50
|
/>
|
|
50
51
|
);
|
|
51
52
|
break;
|
|
@@ -53,7 +54,8 @@ export const HawaLogoButton = (props) => {
|
|
|
53
54
|
logoElement = (
|
|
54
55
|
<img
|
|
55
56
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png"
|
|
56
|
-
height={25}
|
|
57
|
+
// height={25}
|
|
58
|
+
className="h-6"
|
|
57
59
|
/>
|
|
58
60
|
);
|
|
59
61
|
break;
|
|
@@ -61,7 +63,8 @@ export const HawaLogoButton = (props) => {
|
|
|
61
63
|
logoElement = (
|
|
62
64
|
<img
|
|
63
65
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png"
|
|
64
|
-
height={20}
|
|
66
|
+
// height={20}
|
|
67
|
+
className="h-6"
|
|
65
68
|
/>
|
|
66
69
|
);
|
|
67
70
|
break;
|
|
@@ -69,7 +72,8 @@ export const HawaLogoButton = (props) => {
|
|
|
69
72
|
logoElement = (
|
|
70
73
|
<img
|
|
71
74
|
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png"
|
|
72
|
-
height={40}
|
|
75
|
+
// height={40}
|
|
76
|
+
className="h-11"
|
|
73
77
|
/>
|
|
74
78
|
);
|
|
75
79
|
break;
|
|
@@ -81,26 +85,20 @@ export const HawaLogoButton = (props) => {
|
|
|
81
85
|
break;
|
|
82
86
|
}
|
|
83
87
|
return (
|
|
84
|
-
<
|
|
88
|
+
<button
|
|
85
89
|
style={{ direction: isArabic ? "rtl" : "ltr" }}
|
|
86
90
|
{...props}
|
|
87
|
-
variant="withLogo"
|
|
91
|
+
// variant="withLogo"
|
|
92
|
+
className="bg-white rounded-xl my-2 h-11 flex flex-row justify-center align-middle"
|
|
88
93
|
>
|
|
89
|
-
|
|
94
|
+
<div className="h-full w-1/2 flex flex-row justify-end items-center">
|
|
95
|
+
{logoElement}
|
|
96
|
+
</div>
|
|
90
97
|
<div style={{ width: 10 }} />
|
|
91
|
-
<
|
|
92
|
-
style={{
|
|
93
|
-
color: "black",
|
|
94
|
-
fontSize: 14,
|
|
95
|
-
textAlign: "center",
|
|
96
|
-
letterSpacing: 0.4,
|
|
97
|
-
fontFamily: "Roboto",
|
|
98
|
-
fontWeight: 500
|
|
99
|
-
}}
|
|
100
|
-
>
|
|
98
|
+
<div className="h-full w-1/2 flex flex-col justify-center items-start">
|
|
101
99
|
{props.buttonText}
|
|
102
|
-
</
|
|
103
|
-
</
|
|
100
|
+
</div>
|
|
101
|
+
</button>
|
|
104
102
|
);
|
|
105
103
|
};
|
|
106
104
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import Container from "@mui/material/Container";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ export const HawaPanelTabs = (props) => {
|
|
|
9
9
|
<Container variant={props.location || "panelTabs"}>
|
|
10
10
|
{props.options.map((singleOption, i) => {
|
|
11
11
|
return (
|
|
12
|
-
<
|
|
12
|
+
<button
|
|
13
13
|
key={i}
|
|
14
14
|
onClick={() => {
|
|
15
15
|
props.handleChange(singleOption.value);
|
|
@@ -23,7 +23,7 @@ export const HawaPanelTabs = (props) => {
|
|
|
23
23
|
}
|
|
24
24
|
>
|
|
25
25
|
{singleOption.label}
|
|
26
|
-
</
|
|
26
|
+
</button>
|
|
27
27
|
);
|
|
28
28
|
})}
|
|
29
29
|
</Container>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Container from "@mui/material/Container";
|
|
3
|
-
import Button from "@mui/material/Button";
|
|
4
3
|
import Typography from "@mui/material/Typography";
|
|
5
4
|
import CheckIcon from "@mui/icons-material/CheckCircleOutlined";
|
|
6
5
|
import PropTypes from "prop-types";
|
|
@@ -139,13 +138,13 @@ export const HawaPricingCard = (props) => {
|
|
|
139
138
|
);
|
|
140
139
|
})}
|
|
141
140
|
</div>
|
|
142
|
-
<
|
|
141
|
+
<button
|
|
143
142
|
onClick={props.selectPlan}
|
|
144
143
|
variant={props.selectedPlan ? "outlined" : "contained"}
|
|
145
144
|
style={{ margin: 20 }}
|
|
146
145
|
>
|
|
147
146
|
{props.buttonText}
|
|
148
|
-
</
|
|
147
|
+
</button>
|
|
149
148
|
</Container>
|
|
150
149
|
);
|
|
151
150
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "flowbite";
|
|
3
|
+
export const HawaTooltip = (props) => {
|
|
4
|
+
const screenSize = {
|
|
5
|
+
width: 1500,
|
|
6
|
+
height: 200
|
|
7
|
+
};
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
id={props.tooltipID}
|
|
11
|
+
role="tooltip"
|
|
12
|
+
class="inline-block absolute invisible z-10 py-2 px-3 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 transition-opacity duration-300 tooltip dark:bg-gray-700"
|
|
13
|
+
>
|
|
14
|
+
Tooltip content
|
|
15
|
+
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
// <Tooltip
|
|
19
|
+
// placement={screenSize.width > 400 ? "bottom-center" : "top-center"}
|
|
20
|
+
// enterTouchDelay={100}
|
|
21
|
+
// title={
|
|
22
|
+
// props.hint ? (
|
|
23
|
+
// props.hint
|
|
24
|
+
// ) : (
|
|
25
|
+
// <div>
|
|
26
|
+
// <div
|
|
27
|
+
// style={{
|
|
28
|
+
// fontSize: 20,
|
|
29
|
+
// fontWeight: 800,
|
|
30
|
+
// padding: 10,
|
|
31
|
+
// paddingBottom: 5,
|
|
32
|
+
// textAlign: "center"
|
|
33
|
+
// }}
|
|
34
|
+
// >
|
|
35
|
+
// {props.hintTitle}
|
|
36
|
+
// </div>
|
|
37
|
+
// <div
|
|
38
|
+
// style={{
|
|
39
|
+
// fontSize: 13,
|
|
40
|
+
// fontWeight: 100,
|
|
41
|
+
// padding: 10,
|
|
42
|
+
// textAlign: "center"
|
|
43
|
+
// }}
|
|
44
|
+
// >
|
|
45
|
+
// {props.hintContent}
|
|
46
|
+
// </div>
|
|
47
|
+
// </div>
|
|
48
|
+
// )
|
|
49
|
+
// }
|
|
50
|
+
// >
|
|
51
|
+
// {props.children}
|
|
52
|
+
// </Tooltip>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Button from "@mui/material/Button";
|
|
3
|
-
import Tooltip from "@mui/material/Tooltip";
|
|
4
2
|
import PropTypes from "prop-types";
|
|
5
3
|
|
|
6
4
|
export const ResponsiveButton = (props) => {
|
|
7
5
|
if (props.showText) {
|
|
8
6
|
return (
|
|
9
|
-
<
|
|
7
|
+
<button variant="adaptive-dark" onClick={props.onClick}>
|
|
10
8
|
{props.icon}
|
|
11
9
|
<div style={{ width: 10 }} />
|
|
12
10
|
{props.buttonText}
|
|
13
|
-
</
|
|
11
|
+
</button>
|
|
14
12
|
);
|
|
15
13
|
} else {
|
|
16
14
|
//icon only
|
|
17
15
|
return (
|
|
18
|
-
|
|
19
|
-
<
|
|
16
|
+
<>
|
|
17
|
+
<button
|
|
18
|
+
data-tooltip-target="btn1"
|
|
19
|
+
variant="adaptive-dark"
|
|
20
|
+
onClick={props.onClick}
|
|
21
|
+
>
|
|
20
22
|
{props.icon}
|
|
21
|
-
</
|
|
22
|
-
|
|
23
|
+
</button>
|
|
24
|
+
<HawaTooltip tooltipID="btn1" content={props.buttonText} />
|
|
25
|
+
</>
|
|
23
26
|
);
|
|
24
27
|
}
|
|
25
28
|
};
|
|
@@ -27,5 +30,5 @@ export const ResponsiveButton = (props) => {
|
|
|
27
30
|
ResponsiveButton.propTypes = {
|
|
28
31
|
buttonText: PropTypes.string,
|
|
29
32
|
onClick: PropTypes.func,
|
|
30
|
-
showText: PropTypes.bool
|
|
33
|
+
showText: PropTypes.bool
|
|
31
34
|
};
|
package/src/elements/index.js
CHANGED
|
@@ -14,7 +14,6 @@ import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
|
14
14
|
import ListItemButton from "@mui/material/ListItemButton";
|
|
15
15
|
import ListItemText from "@mui/material/ListItemText";
|
|
16
16
|
import Avatar from "@mui/material/Avatar";
|
|
17
|
-
import Tooltip from "@mui/material/Tooltip";
|
|
18
17
|
import { HawaPopMenu } from "../elements/HawaPopMenu";
|
|
19
18
|
|
|
20
19
|
const drawerWidth = 200;
|
|
@@ -154,18 +153,15 @@ export function HawaAppLayout(props) {
|
|
|
154
153
|
</Typography>
|
|
155
154
|
|
|
156
155
|
<Box style={{ position: "absolute", right: 10 }}>
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
/>
|
|
167
|
-
</IconButton>
|
|
168
|
-
</Tooltip>
|
|
156
|
+
<IconButton
|
|
157
|
+
onClick={handleOpenUserMenu}
|
|
158
|
+
// sx={{ p: 0 }}
|
|
159
|
+
size="small"
|
|
160
|
+
>
|
|
161
|
+
<Avatar style={{ width: 30, height: 30 }} fontSize="inherit" />
|
|
162
|
+
</IconButton>
|
|
163
|
+
{/* <Tooltip title="Open settings">
|
|
164
|
+
</Tooltip> */}
|
|
169
165
|
<HawaPopMenu
|
|
170
166
|
menuItems={props.accountMenu}
|
|
171
167
|
anchor={anchorElUser}
|
|
@@ -207,34 +203,32 @@ export function HawaAppLayout(props) {
|
|
|
207
203
|
>
|
|
208
204
|
{props.pages.map((p, jk) => {
|
|
209
205
|
return (
|
|
210
|
-
<Tooltip
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
206
|
+
// <Tooltip
|
|
207
|
+
// title={p.text}
|
|
208
|
+
// key={jk}
|
|
209
|
+
// placement={"right"}
|
|
210
|
+
// arrow={true}
|
|
211
|
+
// PopperProps={{ style: { opacity: open ? 0 : 1 } }}
|
|
212
|
+
// >
|
|
213
|
+
|
|
214
|
+
// </Tooltip>
|
|
215
|
+
<ListItemButton
|
|
216
|
+
variant={
|
|
217
|
+
props.pageName?.toLowerCase() === p.slug?.toLowerCase() &&
|
|
218
|
+
"clicked"
|
|
219
|
+
}
|
|
220
|
+
onClick={p.action}
|
|
221
|
+
key={p.text}
|
|
222
|
+
sx={{
|
|
223
|
+
minHeight: 48,
|
|
224
|
+
justifyContent: open ? "initial" : "center",
|
|
225
|
+
px: 2.5
|
|
226
|
+
}}
|
|
216
227
|
>
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
onClick={p.action}
|
|
223
|
-
key={p.text}
|
|
224
|
-
sx={{
|
|
225
|
-
minHeight: 48,
|
|
226
|
-
justifyContent: open ? "initial" : "center",
|
|
227
|
-
px: 2.5
|
|
228
|
-
}}
|
|
229
|
-
>
|
|
230
|
-
<p.icon />
|
|
231
|
-
<div style={{ width: 20 }} />
|
|
232
|
-
<ListItemText
|
|
233
|
-
primary={p.text}
|
|
234
|
-
sx={{ opacity: open ? 1 : 0 }}
|
|
235
|
-
/>
|
|
236
|
-
</ListItemButton>
|
|
237
|
-
</Tooltip>
|
|
228
|
+
<p.icon />
|
|
229
|
+
<div style={{ width: 20 }} />
|
|
230
|
+
<ListItemText primary={p.text} sx={{ opacity: open ? 1 : 0 }} />
|
|
231
|
+
</ListItemButton>
|
|
238
232
|
);
|
|
239
233
|
})}
|
|
240
234
|
</List>
|
|
@@ -361,4 +361,4 @@
|
|
|
361
361
|
|
|
362
362
|
|
|
363
363
|
|
|
364
|
-
window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.0e8a2888.iframe.bundle.js"></script><script src="vendors~main.
|
|
364
|
+
window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.0e8a2888.iframe.bundle.js"></script><script src="vendors~main.c0e24dea.iframe.bundle.js"></script><script src="main.c82b0a52.iframe.bundle.js"></script></body></html>
|