@sikka/hawa 0.0.212 → 0.0.213
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/dist/styles.css +45 -55
- package/es/blocks/Misc/Newsletter.d.ts +1 -0
- package/es/blocks/Misc/NotFound.d.ts +5 -0
- package/es/elements/HawaPanelTabs.d.ts +4 -1
- package/es/elements/HawaRange.d.ts +1 -1
- package/es/elements/HawaSelect.d.ts +5 -5
- package/es/elements/HawaSettingsRow.d.ts +1 -1
- package/es/elements/HawaSwitch.d.ts +1 -0
- package/es/elements/InvoiceAccordion.d.ts +4 -4
- package/es/index.es.js +1 -1
- package/es/layout/AppSidebar.d.ts +1 -1
- package/lib/blocks/Misc/Newsletter.d.ts +1 -0
- package/lib/blocks/Misc/NotFound.d.ts +5 -0
- package/lib/elements/HawaPanelTabs.d.ts +4 -1
- package/lib/elements/HawaRange.d.ts +1 -1
- package/lib/elements/HawaSelect.d.ts +5 -5
- package/lib/elements/HawaSettingsRow.d.ts +1 -1
- package/lib/elements/HawaSwitch.d.ts +1 -0
- package/lib/elements/InvoiceAccordion.d.ts +4 -4
- package/lib/index.js +1 -1
- package/lib/layout/AppSidebar.d.ts +1 -1
- package/package.json +1 -1
- package/src/blocks/AuthForms/CodeConfirmation.tsx +1 -7
- package/src/blocks/Misc/EmptyState.tsx +1 -0
- package/src/blocks/Misc/Newsletter.tsx +8 -3
- package/src/blocks/Misc/NotFound.tsx +11 -3
- package/src/blocks/Payment/ChargeWalletForm.tsx +23 -14
- package/src/blocks/Payment/CheckoutForm.tsx +1 -14
- package/src/blocks/Payment/Confirmation.tsx +0 -1
- package/src/blocks/Payment/PayWithWallet.tsx +0 -1
- package/src/blocks/Payment/index.ts +6 -20
- package/src/blocks/Pricing/PricingPlans.tsx +1 -0
- package/src/blocks/Referral/ReferralAccount.tsx +1 -1
- package/src/blocks/Referral/ReferralStats.tsx +0 -1
- package/src/elements/DragDropImages.tsx +156 -158
- package/src/elements/DraggableCard.tsx +2 -1
- package/src/elements/HawaAccordion.tsx +1 -1
- package/src/elements/HawaChip.tsx +2 -1
- package/src/elements/HawaColorPicker.tsx +3 -5
- package/src/elements/HawaItemCard.tsx +1 -2
- package/src/elements/HawaMenu.tsx +2 -3
- package/src/elements/HawaModal.tsx +1 -1
- package/src/elements/HawaPanelTabs.tsx +1 -7
- package/src/elements/HawaPricingCard.tsx +1 -7
- package/src/elements/HawaRadio.tsx +1 -1
- package/src/elements/HawaRange.tsx +1 -1
- package/src/elements/HawaSelect.tsx +38 -36
- package/src/elements/HawaSettingsRow.tsx +7 -5
- package/src/elements/HawaSnackbar.tsx +1 -1
- package/src/elements/HawaSpinner.tsx +2 -2
- package/src/elements/HawaSwitch.tsx +19 -2
- package/src/elements/HawaTable.tsx +3 -1
- package/src/elements/HawaTabs.tsx +2 -0
- package/src/elements/HawaTextField.tsx +1 -0
- package/src/elements/HawaTooltip.tsx +0 -2
- package/src/elements/InvoiceAccordion.tsx +5 -5
- package/src/layout/AppSidebar.tsx +1 -1
- package/src/layout/HawaAppLayout.tsx +5 -4
- package/src/layout/HawaContainer.tsx +0 -1
- package/src/layout/HawaSiteLayout.tsx +1 -3
- package/src/layout/SimpleGrid.tsx +2 -3
- package/src/styles.css +45 -55
- package/src/tailwind.css +4 -8
- package/tailwind.config.js +3 -1
package/package.json
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
|
-
import {
|
|
3
|
-
HawaTextField,
|
|
4
|
-
HawaAlert,
|
|
5
|
-
HawaButton,
|
|
6
|
-
HawaPinInput,
|
|
7
|
-
} from "../../elements"
|
|
8
|
-
import { Controller, useForm } from "react-hook-form"
|
|
2
|
+
import { HawaAlert, HawaButton, HawaPinInput } from "../../elements"
|
|
9
3
|
import { HawaContainer } from "../../layout"
|
|
10
4
|
|
|
11
5
|
type TConfirmation = {
|
|
@@ -7,6 +7,7 @@ type TNewsletter = {
|
|
|
7
7
|
texts: {
|
|
8
8
|
wantToStayUpdated: string
|
|
9
9
|
subscribeToNewsletter: string
|
|
10
|
+
submit: string
|
|
10
11
|
}
|
|
11
12
|
handleNewsletterSub: (e: string) => void
|
|
12
13
|
}
|
|
@@ -19,8 +20,12 @@ export const Newsletter: React.FunctionComponent<TNewsletter> = ({
|
|
|
19
20
|
return (
|
|
20
21
|
<HawaContainer variant={variant} centered={true}>
|
|
21
22
|
<div className="p-4 pt-0">
|
|
22
|
-
<h1 className="font-bold">
|
|
23
|
-
|
|
23
|
+
<h1 className="font-bold">
|
|
24
|
+
{texts.wantToStayUpdated ?? "Want to stay updated?"}
|
|
25
|
+
</h1>
|
|
26
|
+
<span>
|
|
27
|
+
{texts.subscribeToNewsletter ?? "Subscribe to our newsletter"}
|
|
28
|
+
</span>
|
|
24
29
|
</div>
|
|
25
30
|
<form
|
|
26
31
|
className="flex flex-row gap-2"
|
|
@@ -37,7 +42,7 @@ export const Newsletter: React.FunctionComponent<TNewsletter> = ({
|
|
|
37
42
|
margin="none"
|
|
38
43
|
/>
|
|
39
44
|
<HawaButton size="full" margins="none">
|
|
40
|
-
Submit
|
|
45
|
+
{texts.submit ?? "Submit"}
|
|
41
46
|
</HawaButton>
|
|
42
47
|
</form>
|
|
43
48
|
</HawaContainer>
|
|
@@ -4,21 +4,29 @@ import { HawaContainer } from "../../layout"
|
|
|
4
4
|
|
|
5
5
|
type NotFoundTypes = {
|
|
6
6
|
variant?: "outlined" | "contained" | "neobrutalism"
|
|
7
|
+
texts?: {
|
|
8
|
+
pageNotFound: string
|
|
9
|
+
ifLost: string
|
|
10
|
+
home: string
|
|
11
|
+
}
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
export const NotFound: React.FunctionComponent<NotFoundTypes> = ({
|
|
10
15
|
variant,
|
|
16
|
+
texts,
|
|
11
17
|
}) => {
|
|
12
18
|
return (
|
|
13
19
|
<HawaContainer variant={variant}>
|
|
14
20
|
<div className="flex flex-col items-center dark:text-white">
|
|
15
21
|
<div className="text-center text-6xl font-bold ">404</div>
|
|
16
|
-
<div className="m-2 text-center text-xl font-bold ">
|
|
22
|
+
<div className="m-2 text-center text-xl font-bold ">
|
|
23
|
+
{texts.pageNotFound ?? "Page Not Found"}
|
|
24
|
+
</div>
|
|
17
25
|
<div className="text-center ">
|
|
18
|
-
If you're lost please contact us help@sikka.io
|
|
26
|
+
{texts.ifLost ?? "If you're lost please contact us help@sikka.io"}
|
|
19
27
|
</div>
|
|
20
28
|
<HawaButton color="primary" width="full">
|
|
21
|
-
Home
|
|
29
|
+
{texts.home ?? "Home"}
|
|
22
30
|
</HawaButton>
|
|
23
31
|
</div>
|
|
24
32
|
</HawaContainer>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
|
-
import { HawaButton
|
|
3
|
-
import { Controller, FormProvider, useForm } from "react-hook-form"
|
|
2
|
+
import { HawaButton } from "../../elements"
|
|
4
3
|
import { HawaContainer } from "../../layout"
|
|
5
4
|
|
|
6
5
|
type ChargeWalletTypes = {
|
|
@@ -16,21 +15,28 @@ export const ChargeWalletForm: React.FunctionComponent<ChargeWalletTypes> = (
|
|
|
16
15
|
props
|
|
17
16
|
) => {
|
|
18
17
|
const [walletAmount, setWalletAmount] = useState(0)
|
|
19
|
-
const methods = useForm()
|
|
20
|
-
const {
|
|
21
|
-
formState: { errors },
|
|
22
|
-
handleSubmit,
|
|
23
|
-
control,
|
|
24
|
-
} = methods
|
|
25
18
|
|
|
26
19
|
return (
|
|
27
20
|
<HawaContainer>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
<div className="p-4 text-center">
|
|
22
|
+
<div className=" text-5xl font-extrabold">
|
|
23
|
+
{Number(walletAmount).toLocaleString("en") || "0"}
|
|
24
|
+
</div>
|
|
31
25
|
<div className="text-sm font-normal">{props.currency || "SAR"}</div>
|
|
32
26
|
</div>
|
|
33
|
-
<
|
|
27
|
+
<div className="mb-2 flex w-full flex-row gap-2 text-center">
|
|
28
|
+
<div className="w-40 whitespace-nowrap rounded bg-gray-100 p-4">
|
|
29
|
+
10 SAR
|
|
30
|
+
</div>
|
|
31
|
+
<div className="w-40 whitespace-nowrap rounded bg-gray-100 p-4">
|
|
32
|
+
100 SAR
|
|
33
|
+
</div>
|
|
34
|
+
<input
|
|
35
|
+
placeholder="Custom"
|
|
36
|
+
className="h-auto rounded bg-gray-100 p-4"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
{/* <FormProvider {...methods}>
|
|
34
40
|
<form onSubmit={handleSubmit(props.handleChargeWallet)}>
|
|
35
41
|
<Controller
|
|
36
42
|
control={control}
|
|
@@ -67,8 +73,11 @@ export const ChargeWalletForm: React.FunctionComponent<ChargeWalletTypes> = (
|
|
|
67
73
|
>
|
|
68
74
|
{props.texts.chargeWallet}
|
|
69
75
|
</HawaButton>
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
</form>
|
|
77
|
+
</FormProvider> */}
|
|
78
|
+
<HawaButton color="primary" width="full">
|
|
79
|
+
{props.texts.chargeWallet}
|
|
80
|
+
</HawaButton>
|
|
72
81
|
</HawaContainer>
|
|
73
82
|
)
|
|
74
83
|
}
|
|
@@ -109,7 +109,6 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
109
109
|
rules={{ required: props.texts?.required }}
|
|
110
110
|
render={({ field }) => (
|
|
111
111
|
<HawaTextField
|
|
112
|
-
// inForm
|
|
113
112
|
width="full"
|
|
114
113
|
type="text"
|
|
115
114
|
label={props.texts?.lastNameLabel + " *"}
|
|
@@ -125,7 +124,6 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
125
124
|
name="email"
|
|
126
125
|
render={({ field }) => (
|
|
127
126
|
<HawaTextField
|
|
128
|
-
// inForm
|
|
129
127
|
width="full"
|
|
130
128
|
type="text"
|
|
131
129
|
label={props.texts?.emailLabel + " *"}
|
|
@@ -150,7 +148,6 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
150
148
|
rules={{ required: props.texts?.required }}
|
|
151
149
|
render={({ field }) => (
|
|
152
150
|
<HawaTextField
|
|
153
|
-
// inForm
|
|
154
151
|
width="full"
|
|
155
152
|
type="text"
|
|
156
153
|
label={props.texts?.streetAddressLabel + " *"}
|
|
@@ -168,7 +165,6 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
168
165
|
rules={{ required: props.texts?.required }}
|
|
169
166
|
render={({ field }) => (
|
|
170
167
|
<HawaTextField
|
|
171
|
-
// inForm
|
|
172
168
|
width="full"
|
|
173
169
|
type="text"
|
|
174
170
|
label={props.texts?.buildingNumberLabel + " *"}
|
|
@@ -187,7 +183,6 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
187
183
|
rules={{ required: props.texts?.required }}
|
|
188
184
|
render={({ field }) => (
|
|
189
185
|
<HawaTextField
|
|
190
|
-
// inForm
|
|
191
186
|
width="full"
|
|
192
187
|
type="text"
|
|
193
188
|
label={props.texts?.stateLabel + " *"}
|
|
@@ -205,7 +200,6 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
205
200
|
rules={{ required: props.texts?.required }}
|
|
206
201
|
render={({ field }) => (
|
|
207
202
|
<HawaTextField
|
|
208
|
-
// inForm
|
|
209
203
|
width="full"
|
|
210
204
|
type="text"
|
|
211
205
|
label={props.texts?.cityLabel + " *"}
|
|
@@ -223,10 +217,8 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
223
217
|
rules={{ required: props.texts?.required }}
|
|
224
218
|
render={({ field }) => (
|
|
225
219
|
<HawaTextField
|
|
226
|
-
// inForm
|
|
227
220
|
width="full"
|
|
228
221
|
type="number"
|
|
229
|
-
// variant="unscrollable"
|
|
230
222
|
label={props.texts?.zipCodeLabel + " *"}
|
|
231
223
|
helperText={errors.zipCode?.message}
|
|
232
224
|
{...field}
|
|
@@ -248,7 +240,6 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
248
240
|
helperText={errors.country?.message}
|
|
249
241
|
options={countries}
|
|
250
242
|
getOptionLabel={(countries) => countries.country_label}
|
|
251
|
-
// {...field}
|
|
252
243
|
onChange={(e) => field.onChange(e.country_label)}
|
|
253
244
|
value={field.value ?? ""}
|
|
254
245
|
>
|
|
@@ -260,11 +251,7 @@ export const CheckoutForm: React.FunctionComponent<CheckoutFormTypes> = (
|
|
|
260
251
|
)}
|
|
261
252
|
/>
|
|
262
253
|
</div>
|
|
263
|
-
<HawaButton
|
|
264
|
-
color="primary"
|
|
265
|
-
// type="submit"
|
|
266
|
-
width="full"
|
|
267
|
-
>
|
|
254
|
+
<HawaButton color="primary" width="full">
|
|
268
255
|
{props.texts.payNow}
|
|
269
256
|
</HawaButton>
|
|
270
257
|
</form>
|
|
@@ -17,7 +17,6 @@ export const PayWithWallet: React.FunctionComponent<PayWithWalletTypes> = (
|
|
|
17
17
|
<div className="text-sm font-normal">{props.currency || "SAR"}</div>
|
|
18
18
|
</div>
|
|
19
19
|
<HawaButton
|
|
20
|
-
// type="submit"
|
|
21
20
|
width="full"
|
|
22
21
|
color="primary"
|
|
23
22
|
onClick={props.handlePayWithWallet}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// var _PaymentMethod = require("./PaymentMethod");
|
|
8
|
-
|
|
9
|
-
// exports.GooglePay = _GooglePay.default;
|
|
10
|
-
// exports.Payfort = _Payfort.default;
|
|
11
|
-
// exports.Paypal = _Paypal.default;
|
|
12
|
-
// exports.Wallet = _Wallet.default;
|
|
13
|
-
// exports.PaymentMethod = _PaymentMethod.default;
|
|
14
|
-
|
|
15
|
-
export * from "./SelectPayment";
|
|
16
|
-
export * from "./CreditCardForm";
|
|
17
|
-
export * from "./ChargeWalletForm";
|
|
18
|
-
export * from "./PayWithWallet";
|
|
19
|
-
export * from "./CheckoutForm";
|
|
20
|
-
export * from "./Confirmation";
|
|
1
|
+
export * from "./SelectPayment"
|
|
2
|
+
export * from "./CreditCardForm"
|
|
3
|
+
export * from "./ChargeWalletForm"
|
|
4
|
+
export * from "./PayWithWallet"
|
|
5
|
+
export * from "./CheckoutForm"
|
|
6
|
+
export * from "./Confirmation"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { FaClone } from "react-icons/fa"
|
|
3
|
-
import {
|
|
3
|
+
import { HawaButton } from "../../elements"
|
|
4
4
|
import { HawaContainer } from "../../layout"
|
|
5
5
|
|
|
6
6
|
type ReferralAccount = {
|
|
@@ -29,178 +29,176 @@ export const DragDropImages: React.FunctionComponent<DragDropImagesTypes> = ({
|
|
|
29
29
|
files,
|
|
30
30
|
setFiles,
|
|
31
31
|
setDeletedFiles,
|
|
32
|
+
onAcceptedFiles,
|
|
33
|
+
errorMessages,
|
|
32
34
|
maxFiles,
|
|
33
35
|
accept,
|
|
34
|
-
onAcceptedFiles,
|
|
35
36
|
showPreview,
|
|
36
37
|
onDeleteFile,
|
|
37
38
|
onClearFiles,
|
|
38
39
|
maxSize,
|
|
39
|
-
errorMessages,
|
|
40
40
|
label,
|
|
41
|
-
}) =>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
preview: URL.createObjectURL(file),
|
|
63
|
-
})
|
|
64
|
-
)
|
|
41
|
+
}) => {
|
|
42
|
+
const [cmp, setCmp] = useState(0)
|
|
43
|
+
const [max, setMax] = useState<any>(0)
|
|
44
|
+
//const [thumbs, setThumbs] = useState("");
|
|
45
|
+
const {
|
|
46
|
+
getRootProps,
|
|
47
|
+
getInputProps,
|
|
48
|
+
fileRejections,
|
|
49
|
+
acceptedFiles,
|
|
50
|
+
isDragActive,
|
|
51
|
+
} = useDropzone({
|
|
52
|
+
multiple: true,
|
|
53
|
+
accept: accept,
|
|
54
|
+
maxSize: maxSize,
|
|
55
|
+
maxFiles: maxFiles,
|
|
56
|
+
onDrop: (acceptedFiles) => {
|
|
57
|
+
setFiles(
|
|
58
|
+
acceptedFiles.map((file, index) =>
|
|
59
|
+
Object.assign(file, {
|
|
60
|
+
preview: URL.createObjectURL(file),
|
|
61
|
+
})
|
|
65
62
|
)
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
63
|
+
)
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
useEffect(
|
|
67
|
+
() => () => {
|
|
68
|
+
files?.forEach((file: any) => {
|
|
69
|
+
URL.revokeObjectURL(file.preview)
|
|
70
|
+
})
|
|
71
|
+
},
|
|
72
|
+
[files]
|
|
73
|
+
)
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
setFiles(acceptedFiles)
|
|
76
|
+
}, [acceptedFiles, cmp])
|
|
77
|
+
onClearFiles = () => {
|
|
78
|
+
acceptedFiles.length = 0
|
|
79
|
+
acceptedFiles.splice(0, acceptedFiles.length)
|
|
80
|
+
setFiles([])
|
|
81
|
+
}
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (maxSize > 0) {
|
|
84
|
+
const k = 1024
|
|
85
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
|
|
86
|
+
const i = Math.floor(Math.log(maxSize) / Math.log(1024))
|
|
89
87
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
}, [maxSize])
|
|
95
|
-
const errs = fileRejections.map((rej, i) => {
|
|
96
|
-
return (
|
|
97
|
-
<HawaAlert
|
|
98
|
-
text={rej.file.name}
|
|
99
|
-
title={rej.errors[0].code}
|
|
100
|
-
severity="error"
|
|
101
|
-
/>
|
|
88
|
+
setMax(
|
|
89
|
+
parseFloat((maxSize / Math.pow(1024, i)).toFixed(2)) + " " + sizes[i]
|
|
102
90
|
)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
91
|
+
}
|
|
92
|
+
}, [maxSize])
|
|
93
|
+
const errs = fileRejections.map((rej, i) => {
|
|
94
|
+
return (
|
|
95
|
+
<HawaAlert
|
|
96
|
+
text={rej.file.name}
|
|
97
|
+
title={rej.errors[0].code}
|
|
98
|
+
severity="error"
|
|
99
|
+
/>
|
|
100
|
+
)
|
|
101
|
+
})
|
|
102
|
+
const thumbs = files?.map((file: any, index: any) => (
|
|
103
|
+
<div className="relative m-3 rounded ">
|
|
104
|
+
<button
|
|
105
|
+
onClick={(e) => {
|
|
106
|
+
e.stopPropagation()
|
|
107
|
+
acceptedFiles.splice(acceptedFiles.indexOf(file), 1)
|
|
108
|
+
setCmp(Math.random)
|
|
109
|
+
onDeleteFile(file)
|
|
110
|
+
}}
|
|
111
|
+
type="button"
|
|
112
|
+
className="absolute left-0 ml-auto inline-flex items-center rounded rounded-tr-none rounded-bl-none bg-gray-900 p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
113
|
+
data-modal-toggle="defaultModal"
|
|
114
|
+
>
|
|
115
|
+
<svg
|
|
116
|
+
aria-hidden="true"
|
|
117
|
+
className="h-5 w-5"
|
|
118
|
+
fill="currentColor"
|
|
119
|
+
viewBox="0 0 20 20"
|
|
120
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
116
121
|
>
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
fillRule="evenodd"
|
|
126
|
-
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
127
|
-
clipRule="evenodd"
|
|
128
|
-
></path>
|
|
129
|
-
</svg>
|
|
130
|
-
<span className="sr-only">Close modal</span>
|
|
131
|
-
</button>
|
|
122
|
+
<path
|
|
123
|
+
fillRule="evenodd"
|
|
124
|
+
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
125
|
+
clipRule="evenodd"
|
|
126
|
+
></path>
|
|
127
|
+
</svg>
|
|
128
|
+
<span className="sr-only">Close modal</span>
|
|
129
|
+
</button>
|
|
132
130
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
131
|
+
<div
|
|
132
|
+
style={{
|
|
133
|
+
display: "flex",
|
|
134
|
+
justifyContent: "center",
|
|
135
|
+
alignItems: "center",
|
|
136
|
+
overflow: "hidden",
|
|
137
|
+
height: 100,
|
|
138
|
+
width: 100,
|
|
139
|
+
backgroundImage: `url(${file.preview})`,
|
|
140
|
+
backgroundSize: "cover",
|
|
141
|
+
backgroundPosition: "center",
|
|
142
|
+
border: "1px solid black",
|
|
143
|
+
}}
|
|
144
|
+
className="rounded-lg"
|
|
145
|
+
key={file.name}
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
))
|
|
151
149
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}}
|
|
175
|
-
>
|
|
176
|
-
Clear All
|
|
177
|
-
</HawaButton>
|
|
178
|
-
)}
|
|
179
|
-
</div>
|
|
180
|
-
{thumbs && showPreview ? (
|
|
181
|
-
<aside
|
|
182
|
-
style={{
|
|
183
|
-
display: "flex",
|
|
184
|
-
flexDirection: "row",
|
|
185
|
-
flexWrap: "wrap",
|
|
186
|
-
// marginTop: 10,
|
|
150
|
+
return (
|
|
151
|
+
<div>
|
|
152
|
+
{label && (
|
|
153
|
+
<div className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-300">
|
|
154
|
+
{label}
|
|
155
|
+
</div>
|
|
156
|
+
)}
|
|
157
|
+
<div
|
|
158
|
+
{...getRootProps({})}
|
|
159
|
+
className="flex flex-col justify-center rounded border border-dashed border-black bg-white transition-all hover:bg-gray-100 "
|
|
160
|
+
>
|
|
161
|
+
<input {...getInputProps()} />
|
|
162
|
+
<div className="pt-4 text-center">{texts.clickHereToUpload}</div>
|
|
163
|
+
<div className="pb-4 text-center text-xs">
|
|
164
|
+
{texts.maxFileSize} {max}
|
|
165
|
+
</div>
|
|
166
|
+
<div className="flex justify-center ">
|
|
167
|
+
{acceptedFiles.length > 0 && (
|
|
168
|
+
<HawaButton
|
|
169
|
+
onClick={(e) => {
|
|
170
|
+
e.stopPropagation()
|
|
171
|
+
onClearFiles(acceptedFiles)
|
|
187
172
|
}}
|
|
188
|
-
className="rounded-lg border-red-500"
|
|
189
173
|
>
|
|
190
|
-
|
|
191
|
-
</
|
|
192
|
-
)
|
|
193
|
-
<div className="px-2">
|
|
194
|
-
{fileRejections[0]?.errors[0]?.code === "too-many-files" ? (
|
|
195
|
-
<HawaAlert text={texts.tooManyFiles} severity="error" />
|
|
196
|
-
) : fileRejections[0]?.errors[0]?.code === "file-too-large" ? (
|
|
197
|
-
<HawaAlert text={texts.fileTooLarge} severity="error" />
|
|
198
|
-
) : (
|
|
199
|
-
errs
|
|
200
|
-
)}
|
|
201
|
-
</div>
|
|
202
|
-
{}
|
|
174
|
+
Clear All
|
|
175
|
+
</HawaButton>
|
|
176
|
+
)}
|
|
203
177
|
</div>
|
|
178
|
+
{thumbs && showPreview ? (
|
|
179
|
+
<aside
|
|
180
|
+
style={{
|
|
181
|
+
display: "flex",
|
|
182
|
+
flexDirection: "row",
|
|
183
|
+
flexWrap: "wrap",
|
|
184
|
+
// marginTop: 10,
|
|
185
|
+
}}
|
|
186
|
+
className="rounded-lg border-red-500"
|
|
187
|
+
>
|
|
188
|
+
{thumbs}
|
|
189
|
+
</aside>
|
|
190
|
+
) : null}
|
|
191
|
+
<div className="px-2">
|
|
192
|
+
{fileRejections[0]?.errors[0]?.code === "too-many-files" ? (
|
|
193
|
+
<HawaAlert text={texts.tooManyFiles} severity="error" />
|
|
194
|
+
) : fileRejections[0]?.errors[0]?.code === "file-too-large" ? (
|
|
195
|
+
<HawaAlert text={texts.fileTooLarge} severity="error" />
|
|
196
|
+
) : (
|
|
197
|
+
errs
|
|
198
|
+
)}
|
|
199
|
+
</div>
|
|
200
|
+
{}
|
|
204
201
|
</div>
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
</div>
|
|
203
|
+
)
|
|
204
|
+
}
|