@homefile/components-v2 2.0.0 → 2.1.1
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/assets/images/ia.svg +15 -16
- package/dist/assets/locales/en/index.json +8 -7
- package/dist/components/contacts/ContactsContent.js +1 -1
- package/dist/components/customToast/CustomToast.js +1 -1
- package/dist/components/customToast/StatusIllustration.js +3 -3
- package/dist/components/forms/dynamicForm/DynamicForm.d.ts +1 -1
- package/dist/components/forms/dynamicForm/DynamicForm.js +16 -2
- package/dist/components/forms/dynamicForm/fields/SingleFields.d.ts +2 -5
- package/dist/components/forms/dynamicForm/fields/SingleFields.js +16 -2
- package/dist/components/forms/dynamicForm/fields/index.d.ts +1 -0
- package/dist/components/forms/dynamicForm/fields/index.js +1 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.js +18 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +24 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.js +6 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.tsx +11 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.d.ts +3 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.js +5 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +9 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.js +5 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.tsx +10 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.js +6 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.tsx +11 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.js +5 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +14 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.js +5 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +31 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/index.d.ts +7 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/index.js +7 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/index.ts +7 -0
- package/dist/components/homeAssistant/HomeAssistantTutorial.js +1 -1
- package/dist/components/homeAssistant/HomeAssistantWrapper.js +1 -1
- package/dist/components/homeAssistant/HomeMonitorButton.d.ts +1 -1
- package/dist/components/homeAssistant/HomeMonitorButton.js +3 -8
- package/dist/components/homeAssistant/HomeMonitorSteps.js +22 -4
- package/dist/components/homeAssistant/panel/ApplianceSteps.js +4 -1
- package/dist/components/homeAssistant/panel/HomeAssistantPanel.js +14 -1
- package/dist/components/homeBoard/HomeBoard.js +2 -2
- package/dist/components/inputs/SelectButton.js +1 -1
- package/dist/components/launchpad/IconMenu.d.ts +1 -1
- package/dist/components/launchpad/IconMenu.js +2 -2
- package/dist/components/sendDocument/RecipientContent.js +3 -1
- package/dist/helpers/forms/dynamicForm.helper.js +7 -1
- package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +9 -4
- package/dist/interfaces/forms/dynamicForm/fields/GroupField.interface.d.ts +6 -1
- package/dist/interfaces/forms/dynamicForm/fields/UIFields.interface.d.ts +20 -0
- package/dist/interfaces/forms/dynamicForm/fields/UIFields.interface.js +1 -0
- package/dist/interfaces/forms/dynamicForm/fields/index.d.ts +1 -0
- package/dist/interfaces/forms/dynamicForm/fields/index.js +1 -0
- package/dist/interfaces/homeAssistant/ApplianceSteps.interface.d.ts +1 -2
- package/dist/interfaces/homeAssistant/HomeMonitorSteps.interface.d.ts +0 -1
- package/dist/interfaces/launchpad/IconMenu.interface.d.ts +2 -0
- package/dist/interfaces/partner/PartnerFooter.interface.d.ts +0 -1
- package/dist/mocks/forms/dynamicForm.mock.d.ts +1 -0
- package/dist/mocks/forms/dynamicForm.mock.js +159 -0
- package/dist/mocks/homeAssistant/homeAssistantForms.js +6 -0
- package/dist/stories/forms/dynamicForm/DynamicForm.stories.d.ts +1 -0
- package/dist/stories/forms/dynamicForm/DynamicForm.stories.js +9 -3
- package/package.json +1 -1
- package/src/assets/images/ia.svg +15 -16
- package/src/assets/locales/en/index.json +8 -7
- package/src/components/contacts/ContactsContent.tsx +1 -1
- package/src/components/customToast/CustomToast.tsx +4 -3
- package/src/components/customToast/StatusIllustration.tsx +3 -3
- package/src/components/forms/dynamicForm/DynamicForm.tsx +14 -0
- package/src/components/forms/dynamicForm/fields/SingleFields.tsx +62 -6
- package/src/components/forms/dynamicForm/fields/index.ts +1 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +24 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBodyAction.tsx +11 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +9 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.tsx +10 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.tsx +11 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +14 -0
- package/src/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +31 -0
- package/src/components/forms/dynamicForm/fields/uiFields/index.ts +7 -0
- package/src/components/homeAssistant/HomeAssistantTutorial.tsx +3 -0
- package/src/components/homeAssistant/HomeAssistantWrapper.tsx +0 -5
- package/src/components/homeAssistant/HomeMonitorButton.tsx +3 -17
- package/src/components/homeAssistant/HomeMonitorSteps.tsx +40 -10
- package/src/components/homeAssistant/panel/ApplianceSteps.tsx +7 -1
- package/src/components/homeAssistant/panel/HomeAssistantPanel.tsx +21 -3
- package/src/components/homeBoard/HomeBoard.tsx +18 -0
- package/src/components/inputs/SelectButton.tsx +3 -1
- package/src/components/launchpad/IconMenu.tsx +4 -1
- package/src/components/sendDocument/RecipientContent.tsx +15 -7
- package/src/helpers/forms/dynamicForm.helper.ts +12 -0
- package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +28 -2
- package/src/interfaces/forms/dynamicForm/fields/GroupField.interface.ts +7 -1
- package/src/interfaces/forms/dynamicForm/fields/UIFields.interface.ts +24 -0
- package/src/interfaces/forms/dynamicForm/fields/index.ts +1 -0
- package/src/interfaces/homeAssistant/ApplianceSteps.interface.ts +1 -1
- package/src/interfaces/homeAssistant/HomeMonitorSteps.interface.ts +0 -1
- package/src/interfaces/launchpad/IconMenu.interface.ts +2 -0
- package/src/interfaces/partner/PartnerFooter.interface.ts +0 -1
- package/src/mocks/forms/dynamicForm.mock.ts +162 -0
- package/src/mocks/homeAssistant/homeAssistantForms.ts +6 -0
- package/src/stories/forms/dynamicForm/DynamicForm.stories.tsx +14 -3
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
2
|
-
<g id="
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<line id="Line_3402" data-name="Line 3402" x2="2.485" transform="translate(14.052 14.039)" fill="none" stroke="#fff" stroke-width="2"/>
|
|
15
|
-
<path id="Path_15024" data-name="Path 15024" d="M-112.806,1761.029a2.621,2.621,0,0,0,2.622,2.231,2.666,2.666,0,0,0,2.618-2.231" transform="translate(122.294 -1742.01)" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="1"/>
|
|
16
|
-
</g>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="30.202" height="30.2" viewBox="0 0 30.202 30.2">
|
|
2
|
+
<g id="Group_21564" data-name="Group 21564" transform="translate(10417.861 8318.462)">
|
|
3
|
+
<circle id="Ellipse_1093" data-name="Ellipse 1093" cx="2.157" cy="2.157" r="2.157" transform="translate(-10404.917 -8318.462)" fill="#bcd1d8"/>
|
|
4
|
+
<line id="Line_3403" data-name="Line 3403" y2="2.725" transform="translate(-10402.761 -8314.146)" fill="none" stroke="#bcd1d8" stroke-width="1"/>
|
|
5
|
+
<rect id="Rectangle_24537" data-name="Rectangle 24537" width="10.786" height="4.314" rx="2.157" transform="translate(-10408.155 -8311.99)" fill="#00a1aa"/>
|
|
6
|
+
<circle id="Ellipse_1090" data-name="Ellipse 1090" cx="3.236" cy="3.236" r="3.236" transform="translate(-10417.861 -8304.439)" fill="#00a1aa"/>
|
|
7
|
+
<ellipse id="Ellipse_1092" data-name="Ellipse 1092" cx="2.696" cy="3.236" rx="2.696" ry="3.236" transform="translate(-10393.053 -8304.439)" fill="#00a1aa"/>
|
|
8
|
+
<circle id="Ellipse_1091" data-name="Ellipse 1091" cx="3.236" cy="3.236" r="3.236" transform="translate(-10397.368 -8304.439)" fill="#00a1aa"/>
|
|
9
|
+
<rect id="Rectangle_24536" data-name="Rectangle 24536" width="23.729" height="21.572" rx="3" transform="translate(-10414.626 -8309.834)" fill="#02c0b7"/>
|
|
10
|
+
<rect id="Rectangle_24476" data-name="Rectangle 24476" width="15.1" height="6.472" rx="3" transform="translate(-10410.311 -8304.439)" fill="#324459"/>
|
|
11
|
+
<line id="Line_3401" data-name="Line 3401" x2="2.725" transform="translate(-10407.915 -8300.908)" fill="none" stroke="#fff" stroke-width="2"/>
|
|
12
|
+
<line id="Line_3402" data-name="Line 3402" x2="2.725" transform="translate(-10399.874 -8300.908)" fill="none" stroke="#fff" stroke-width="2"/>
|
|
13
|
+
<path id="Path_15024" data-name="Path 15024" d="M-112.806,1761.029a2.874,2.874,0,0,0,2.876,2.446,2.924,2.924,0,0,0,2.871-2.446" transform="translate(-10292.654 -10055.396)" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="1"/>
|
|
17
14
|
</g>
|
|
18
15
|
</svg>
|
|
16
|
+
|
|
17
|
+
|
|
@@ -399,8 +399,8 @@
|
|
|
399
399
|
}
|
|
400
400
|
},
|
|
401
401
|
"details": "Provide details about your home’s",
|
|
402
|
-
"homeMonitor": "
|
|
403
|
-
"homeMonitoring": "
|
|
402
|
+
"homeMonitor": "Homie",
|
|
403
|
+
"homeMonitoring": "Homie is monitoring your home.",
|
|
404
404
|
"monitorAlerts": {
|
|
405
405
|
"collapse": "Collapse Alert",
|
|
406
406
|
"homeAction": "Home Action",
|
|
@@ -418,10 +418,11 @@
|
|
|
418
418
|
"smoke": "Smoke & CO2 detectors",
|
|
419
419
|
"structure": "Structure"
|
|
420
420
|
},
|
|
421
|
-
"title": "
|
|
421
|
+
"title": "Set Up Homie",
|
|
422
422
|
"tutorialButton": "Start Quick Setup",
|
|
423
|
-
"tutorialDescription": "
|
|
424
|
-
"tutorialTitle": "Let’s quickly
|
|
423
|
+
"tutorialDescription": "Homie helps you manage every aspect of your home. We've added a short overview to help you learn more about it.",
|
|
424
|
+
"tutorialTitle": "Let’s quickly set up Homie, your friendly AI home assistant.",
|
|
425
|
+
"tutorialNote": "Just a few set-up questions to help Homie get going."
|
|
425
426
|
},
|
|
426
427
|
"homeBoard": {
|
|
427
428
|
"addRecords": "Add Property Records",
|
|
@@ -603,7 +604,7 @@
|
|
|
603
604
|
"newPassword": {
|
|
604
605
|
"confirm": "Confirm Password",
|
|
605
606
|
"create": "Create Password",
|
|
606
|
-
"title": "
|
|
607
|
+
"title": "Please enter your new password."
|
|
607
608
|
},
|
|
608
609
|
"partner": {
|
|
609
610
|
"aphw": {
|
|
@@ -743,7 +744,7 @@
|
|
|
743
744
|
"title": "Property Taxes"
|
|
744
745
|
},
|
|
745
746
|
"trending": {
|
|
746
|
-
"addMortgage": "
|
|
747
|
+
"addMortgage": "Mortgage Info",
|
|
747
748
|
"estimated": "Estimated Market Value",
|
|
748
749
|
"mortgage": "Mortgage Balance*",
|
|
749
750
|
"public": "*Estimated from Public Data",
|
|
@@ -12,7 +12,7 @@ export const ContactsContent = ({ apiError, contacts, menuItems, handleClose, ch
|
|
|
12
12
|
});
|
|
13
13
|
const { windowDimensions: { width }, } = useWindowDimensions();
|
|
14
14
|
const maxW = width > 413 ? '16rem' : '10rem';
|
|
15
|
-
return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsxs(DrawerHeader, { p: "0", children: [_jsx(PanelHeader, { handleCloseButton: handleClose, icon: Contacts, title: t('contacts.title') }), _jsxs(Flex, { justify: "space-between", pl: "base", my: "base", align: "center", gap: "base", children: [_jsx(SearchInput, { maxW: maxW, value: search, onChange: handleChange }), _jsx(LeftButtonAnimated, { onClick: handleAdd, label: t('contacts.addBtn'), disabled: disabled })] })] }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", children: [_jsxs(Stack, { spacing: "base", pt: "base", pb: "120px", pr: "base", bg: "lightBlue.
|
|
15
|
+
return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsxs(DrawerHeader, { p: "0", children: [_jsx(PanelHeader, { handleCloseButton: handleClose, icon: Contacts, title: t('contacts.title') }), _jsxs(Flex, { justify: "space-between", pl: "base", my: "base", align: "center", gap: "base", children: [_jsx(SearchInput, { maxW: maxW, value: search, onChange: handleChange }), _jsx(LeftButtonAnimated, { onClick: handleAdd, label: t('contacts.addBtn'), disabled: disabled })] })] }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", children: [_jsxs(Stack, { spacing: "base", pt: "base", pb: "120px", pr: "base", bg: "lightBlue.2", minHeight: "full", children: [_jsxs(Flex, { gap: "3", pl: "base", children: [_jsx(Checkbox, { onChange: handleSelectAll }), _jsx(Text, { fontFamily: "secondary", fontSize: "xs", children: t('subscription.select') })] }), _jsx(Box, { children: Object.keys(splittedContacts).map((letter, idx) => {
|
|
16
16
|
const showLetterDivider = idx !== 0;
|
|
17
17
|
return (_jsxs(Stack, { spacing: "0", children: [showLetterDivider && _jsx(LetterDivider, { letter: letter }), _jsx(Stack, { spacing: "2px", children: splittedContacts[letter].map((contact, idx) => {
|
|
18
18
|
const selected = isItemSelected(contact._id);
|
|
@@ -8,5 +8,5 @@ export const CustomToast = ({ description, onClose, status = 'success', title, }
|
|
|
8
8
|
success: '#5E42B2',
|
|
9
9
|
error: '#CF3593',
|
|
10
10
|
};
|
|
11
|
-
return (_jsxs(Box, { bg: bgColors[status], borderRadius: "lg", boxShadow: "lg", position: "relative",
|
|
11
|
+
return (_jsxs(Box, { paddingTop: 0, paddingBottom: 0, bg: bgColors[status], borderRadius: "lg", boxShadow: "lg", position: "relative", children: [_jsxs(Flex, { gap: "base", p: "base", align: "center", position: "relative", left: "-26px", children: [_jsx(StatusIllustration, { status: status }), _jsxs(Box, { children: [_jsx(Text, { fontSize: "22px", fontWeight: "medium", color: "neutral.white", lineHeight: "1.1", children: title }), _jsx(Text, { color: "neutral.white", children: description })] })] }), _jsx(Box, { as: "button", "aria-label": t('ariaLabels.close'), onClick: onClose, position: "absolute", top: "8px", right: "8px", children: _jsx(Close, { stroke: colors.neutral.white, size: 20 }) })] }));
|
|
12
12
|
};
|
|
@@ -8,15 +8,15 @@ export const StatusIllustration = ({ status = 'success', }) => {
|
|
|
8
8
|
src: Check,
|
|
9
9
|
alt: t('ariaLabels.success'),
|
|
10
10
|
bg: '#28B5A8',
|
|
11
|
-
height: '
|
|
11
|
+
height: '21px',
|
|
12
12
|
},
|
|
13
13
|
error: {
|
|
14
14
|
src: Exclamation,
|
|
15
15
|
alt: t('ariaLabels.error'),
|
|
16
16
|
bg: '#991365',
|
|
17
|
-
height: '
|
|
17
|
+
height: '28px',
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
const { alt, bg, height, src } = props[status];
|
|
21
|
-
return (_jsx(Center, { borderRadius: "full", bg: bg, boxShadow: "xl", w: "
|
|
21
|
+
return (_jsx(Center, { borderRadius: "full", bg: bg, boxShadow: "xl", w: "43px", h: "43px", children: _jsx(Image, { src: src, alt: alt, h: height, w: "auto" }) }));
|
|
22
22
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DynamicFormI } from '../../../interfaces';
|
|
2
|
-
export declare const DynamicForm: ({ form: fields, onUpload, showTitle, uploadingFieldId, }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const DynamicForm: ({ callback, form: fields, menuItems, onUpload, showTitle, uploadingFieldId, ...props }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import { FormProvider } from 'react-hook-form';
|
|
3
14
|
import { t } from 'i18next';
|
|
4
15
|
import { Stack, Text } from '@chakra-ui/react';
|
|
5
|
-
import { HiddenFieldSection, GroupField, TextField, TextAreaField, SelectField, RatingField, GridField, FieldWithDelete, FileField, SwitchField, DateField, NumberField, CurrencyField, } from '../..';
|
|
16
|
+
import { HiddenFieldSection, GroupField, TextField, TextAreaField, SelectField, RatingField, GridField, FieldWithDelete, FileField, SwitchField, DateField, NumberField, CurrencyField, TileBody, } from '../..';
|
|
6
17
|
import { useDynamicForm } from '../../../hooks';
|
|
7
18
|
import { fieldIcons } from '../../../helpers';
|
|
8
|
-
export const DynamicForm = (
|
|
19
|
+
export const DynamicForm = (_a) => {
|
|
20
|
+
var { callback, form: fields, menuItems, onUpload, showTitle = true, uploadingFieldId } = _a, props = __rest(_a, ["callback", "form", "menuItems", "onUpload", "showTitle", "uploadingFieldId"]);
|
|
9
21
|
const { form, visibleFields, hiddenFields, handleAddAll, handleAdd, handleFilesUpload, handleRemove, } = useDynamicForm({ fields, onUpload });
|
|
10
22
|
return (_jsxs(Stack, { bg: "lightBlue.1", spacing: "0", h: "full", children: [showTitle && (_jsx(Text, { fontFamily: "secondary", px: "base", pt: "4", pb: "2", children: t('forms.itemDetails') })), _jsx(FormProvider, Object.assign({}, form, { children: _jsx(_Fragment, { children: visibleFields === null || visibleFields === void 0 ? void 0 : visibleFields.map((field) => {
|
|
11
23
|
const { canBeHidden, children, description, icon, id, name, options, type, value, } = field;
|
|
@@ -49,6 +61,8 @@ export const DynamicForm = ({ form: fields, onUpload, showTitle = true, uploadin
|
|
|
49
61
|
return (_jsx(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { children: _jsx(FileField, { icon: baseProps.icon, description: description, onUpload: (files) => handleFilesUpload({ id, files }), uploading: uploadingFieldId === id }) })));
|
|
50
62
|
case 'group':
|
|
51
63
|
return (_jsx(GroupField, { id: id, fields: children, onRemove: handleRemove, canBeHidden: canBeHidden }, id));
|
|
64
|
+
case 'tile-body':
|
|
65
|
+
return (_jsx(TileBody, Object.assign({ callback: callback, fields: children, menuItems: menuItems }, props), id));
|
|
52
66
|
default:
|
|
53
67
|
return null;
|
|
54
68
|
}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
fields?: DynamicFormI['form'];
|
|
4
|
-
}
|
|
5
|
-
export declare const SingleFields: ({ fields }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { FieldTypesI } from '../../../../interfaces';
|
|
2
|
+
export declare const SingleFields: ({ callback, fields, menuItems }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { fieldIcons } from '../../../../helpers';
|
|
3
|
-
import { GridField, RatingField, TextAreaField, TextField, SelectField, SwitchField, NumberField, DateField, CurrencyField, } from '../../..';
|
|
4
|
-
export const SingleFields = ({ fields }) => {
|
|
3
|
+
import { GridField, RatingField, TextAreaField, TextField, SelectField, SwitchField, NumberField, DateField, CurrencyField, TileBodyHeader, TileBodyLogo, VerticalIcon, TileBodySectionGrid, TileBodyAction, TileCta, } from '../../..';
|
|
4
|
+
export const SingleFields = ({ callback, fields, menuItems }) => {
|
|
5
5
|
return (_jsx(_Fragment, { children: fields === null || fields === void 0 ? void 0 : fields.map(({ children, description, id, name, type, value, icon, options = [], }) => {
|
|
6
6
|
const baseProps = {
|
|
7
7
|
key: id,
|
|
@@ -34,6 +34,20 @@ export const SingleFields = ({ fields }) => {
|
|
|
34
34
|
return _jsx(TextField, Object.assign({}, baseProps, { type: "tel" }));
|
|
35
35
|
case 'textarea':
|
|
36
36
|
return _jsx(TextAreaField, Object.assign({}, baseProps));
|
|
37
|
+
case 'tile-body-section-grid':
|
|
38
|
+
return _jsx(TileBodySectionGrid, { fields: children }, id);
|
|
39
|
+
case 'tile-body-header':
|
|
40
|
+
return (_jsx(TileBodyHeader, { value: String(baseProps.value) }, baseProps.key));
|
|
41
|
+
case 'tile-body-logo':
|
|
42
|
+
return (_jsx(TileBodyLogo, { name: name, value: String(baseProps.value), menuItems: menuItems }, baseProps.key));
|
|
43
|
+
case 'vertical-icon':
|
|
44
|
+
return (_jsx(VerticalIcon, { icon: baseProps.icon, value: String(baseProps.value) }, id));
|
|
45
|
+
case 'tile-body-action':
|
|
46
|
+
return (_jsx(TileBodyAction, { fields: children, callback: callback }, id));
|
|
47
|
+
case 'primary-cta':
|
|
48
|
+
return (_jsx(TileCta, { type: type, value: String(baseProps.value), callback: callback }, id));
|
|
49
|
+
case 'secondary-cta':
|
|
50
|
+
return (_jsx(TileCta, { type: type, value: String(baseProps.value), callback: callback }, id));
|
|
37
51
|
default:
|
|
38
52
|
return null;
|
|
39
53
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Box, Stack } from '@chakra-ui/react';
|
|
14
|
+
import { PartnerFooter, SingleFields } from '../../../..';
|
|
15
|
+
export const TileBody = (_a) => {
|
|
16
|
+
var { callback, fields, websiteUrl = '', menuItems } = _a, props = __rest(_a, ["callback", "fields", "websiteUrl", "menuItems"]);
|
|
17
|
+
return (_jsx(Box, { display: "flex", flexDir: "column", bg: "neutral.white", boxShadow: "lg", children: _jsxs(Stack, { spacing: "0", flex: "1", children: [_jsx(SingleFields, { callback: callback, fields: fields, menuItems: menuItems }), _jsx(PartnerFooter, Object.assign({}, props, { websiteUrl: websiteUrl }))] }) }));
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Box, Stack } from '@chakra-ui/react'
|
|
2
|
+
import { TileBodyI } from '@/interfaces'
|
|
3
|
+
import { PartnerFooter, SingleFields } from '@/components'
|
|
4
|
+
|
|
5
|
+
export const TileBody = ({
|
|
6
|
+
callback,
|
|
7
|
+
fields,
|
|
8
|
+
websiteUrl = '',
|
|
9
|
+
menuItems,
|
|
10
|
+
...props
|
|
11
|
+
}: TileBodyI) => {
|
|
12
|
+
return (
|
|
13
|
+
<Box display="flex" flexDir="column" bg="neutral.white" boxShadow="lg">
|
|
14
|
+
<Stack spacing="0" flex="1">
|
|
15
|
+
<SingleFields
|
|
16
|
+
callback={callback}
|
|
17
|
+
fields={fields}
|
|
18
|
+
menuItems={menuItems}
|
|
19
|
+
/>
|
|
20
|
+
<PartnerFooter {...props} websiteUrl={websiteUrl} />
|
|
21
|
+
</Stack>
|
|
22
|
+
</Box>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Flex } from '@chakra-ui/react';
|
|
3
|
+
import { SingleFields } from '../../../..';
|
|
4
|
+
export const TileBodyAction = ({ fields }) => {
|
|
5
|
+
return (_jsx(Flex, { p: "base", align: "center", gap: "base", children: _jsx(SingleFields, { fields: fields }) }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Flex } from '@chakra-ui/react'
|
|
2
|
+
import { SingleFields } from '@/components'
|
|
3
|
+
import { TileBodyI } from '@/interfaces'
|
|
4
|
+
|
|
5
|
+
export const TileBodyAction = ({ fields }: TileBodyI) => {
|
|
6
|
+
return (
|
|
7
|
+
<Flex p="base" align="center" gap="base">
|
|
8
|
+
<SingleFields fields={fields} />
|
|
9
|
+
</Flex>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PartnerHeader } from '@/components'
|
|
2
|
+
import { TileBodyLogoI } from '@/interfaces'
|
|
3
|
+
|
|
4
|
+
export const TileBodyLogo = ({
|
|
5
|
+
menuItems,
|
|
6
|
+
name = '',
|
|
7
|
+
value,
|
|
8
|
+
}: TileBodyLogoI) => {
|
|
9
|
+
return <PartnerHeader logo={value} partnerName={name} menuItems={menuItems} />
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SimpleGrid } from '@chakra-ui/react';
|
|
3
|
+
import { SingleFields } from '../../../..';
|
|
4
|
+
export const TileBodySectionGrid = ({ fields }) => {
|
|
5
|
+
return (_jsx(SimpleGrid, { columns: 3, spacing: "base", p: "base", children: _jsx(SingleFields, { fields: fields }) }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SimpleGrid } from '@chakra-ui/react'
|
|
2
|
+
import { SingleFields } from '@/components'
|
|
3
|
+
import { TileBodyI } from '@/interfaces'
|
|
4
|
+
|
|
5
|
+
export const TileBodySectionGrid = ({ fields }: TileBodyI) => {
|
|
6
|
+
return (
|
|
7
|
+
<SimpleGrid columns={3} spacing="base" p="base">
|
|
8
|
+
<SingleFields fields={fields} />
|
|
9
|
+
</SimpleGrid>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@chakra-ui/react';
|
|
3
|
+
export const TileCta = ({ callback, type, value }) => {
|
|
4
|
+
return (_jsx(Button, { onClick: () => callback === null || callback === void 0 ? void 0 : callback(value), variant: type === 'primary-cta' ? 'tertiaryFooter' : 'secondaryFooter', fontSize: "sm", children: value }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Button } from '@chakra-ui/react'
|
|
2
|
+
import { TileCtaI } from '@/interfaces'
|
|
3
|
+
|
|
4
|
+
export const TileCta = ({ callback, type, value }: TileCtaI) => {
|
|
5
|
+
return (
|
|
6
|
+
<Button
|
|
7
|
+
onClick={() => callback?.(value)}
|
|
8
|
+
variant={type === 'primary-cta' ? 'tertiaryFooter' : 'secondaryFooter'}
|
|
9
|
+
fontSize="sm"
|
|
10
|
+
>
|
|
11
|
+
{value}
|
|
12
|
+
</Button>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Image, Text } from '@chakra-ui/react';
|
|
3
|
+
export const VerticalIcon = ({ icon, value }) => {
|
|
4
|
+
return (_jsxs(Box, { bg: "neutral.white", borderRadius: "md", border: "1px solid", borderColor: "lightBlue.6", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", children: [_jsx(Box, { h: "46px", display: "flex", alignItems: "center", children: _jsx(Image, { src: icon, alt: value, w: "auto", h: "80%" }) }), _jsx(Box, { pb: "2", children: _jsx(Text, { fontWeight: "semibold", textAlign: "center", fontSize: "13px", lineHeight: "14px", children: value }) })] }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Box, Image, Text } from '@chakra-ui/react'
|
|
2
|
+
import { VerticalIconI } from '@/interfaces'
|
|
3
|
+
|
|
4
|
+
export const VerticalIcon = ({ icon, value }: VerticalIconI) => {
|
|
5
|
+
return (
|
|
6
|
+
<Box
|
|
7
|
+
bg="neutral.white"
|
|
8
|
+
borderRadius="md"
|
|
9
|
+
border="1px solid"
|
|
10
|
+
borderColor="lightBlue.6"
|
|
11
|
+
display="flex"
|
|
12
|
+
flexDirection="column"
|
|
13
|
+
alignItems="center"
|
|
14
|
+
justifyContent="center"
|
|
15
|
+
>
|
|
16
|
+
<Box h="46px" display="flex" alignItems="center">
|
|
17
|
+
<Image src={icon} alt={value} w="auto" h="80%" />
|
|
18
|
+
</Box>
|
|
19
|
+
<Box pb="2">
|
|
20
|
+
<Text
|
|
21
|
+
fontWeight="semibold"
|
|
22
|
+
textAlign="center"
|
|
23
|
+
fontSize="13px"
|
|
24
|
+
lineHeight="14px"
|
|
25
|
+
>
|
|
26
|
+
{value}
|
|
27
|
+
</Text>
|
|
28
|
+
</Box>
|
|
29
|
+
</Box>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -6,5 +6,5 @@ import { ChevronRight, VideoPlayerModal, VideoPlayerTrigger, } from '..';
|
|
|
6
6
|
import { colors } from '../../theme/colors';
|
|
7
7
|
export const HomeAssistantTutorial = ({ onStart, videoUrl, }) => {
|
|
8
8
|
const [url, setUrl] = useState();
|
|
9
|
-
return (_jsxs(Stack, { spacing: "base", align: "center", maxW: "483px", px: ['base', 0], zIndex: "2", children: [_jsx(Text, { fontSize: "30px", lineHeight: "32px", textAlign: "center", children: t('homeAssistant.tutorialTitle') }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: t('homeAssistant.tutorialDescription') }), _jsxs(Stack, { spacing: "base", w: "284px", children: [_jsx(Box, { boxShadow: "lg", children: _jsx(VideoPlayerTrigger, { url: videoUrl, value: videoUrl, ratio: 16 / 9, onPlay: (value) => setUrl(value) }) }), _jsx(Button, { onClick: onStart, textTransform: "capitalize", children: _jsxs(Flex, { align: "center", justify: "space-between", w: "100%", px: "base", children: [_jsx(Text, { color: "neutral.white", children: t('homeAssistant.tutorialButton') }), _jsx(Circle, { size: "40px", bg: "blue.1", color: "neutral.white", children: _jsx(ChevronRight, { size: 26, stroke: colors.neutral.white }) })] }) })] }), url && (_jsx(VideoPlayerModal, { url: url, onClose: () => setUrl(undefined), showOverlay: true }))] }));
|
|
9
|
+
return (_jsxs(Stack, { spacing: "base", align: "center", maxW: "483px", px: ['base', 0], zIndex: "2", children: [_jsx(Text, { fontSize: "30px", lineHeight: "32px", textAlign: "center", children: t('homeAssistant.tutorialTitle') }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: t('homeAssistant.tutorialDescription') }), _jsxs(Stack, { spacing: "base", w: "284px", children: [_jsx(Box, { boxShadow: "lg", children: _jsx(VideoPlayerTrigger, { url: videoUrl, value: videoUrl, ratio: 16 / 9, onPlay: (value) => setUrl(value) }) }), _jsx(Button, { onClick: onStart, textTransform: "capitalize", children: _jsxs(Flex, { align: "center", justify: "space-between", w: "100%", px: "base", children: [_jsx(Text, { color: "neutral.white", children: t('homeAssistant.tutorialButton') }), _jsx(Circle, { size: "40px", bg: "blue.1", color: "neutral.white", children: _jsx(ChevronRight, { size: 26, stroke: colors.neutral.white }) })] }) })] }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: t('homeAssistant.tutorialNote') }), url && (_jsx(VideoPlayerModal, { url: url, onClose: () => setUrl(undefined), showOverlay: true }))] }));
|
|
10
10
|
};
|
|
@@ -6,5 +6,5 @@ import { getImageAltText } from '../../utils';
|
|
|
6
6
|
import { colors } from '../../theme/colors';
|
|
7
7
|
export const HomeAssistantWrapper = ({ children, showAirplane, title, }) => {
|
|
8
8
|
const treesAlt = getImageAltText(TreesCrop);
|
|
9
|
-
return (_jsx(GridItem, { colSpan: [1, 2], children: _jsx(TileTooltip, { label: "homeAssistant", children: _jsxs(Box, { bgGradient: colors.skyGradient, boxShadow: "base", h: "full", position: "relative", overflowX: "hidden", children: [_jsx(ContainerHeader, { title: title, titleIcon: IA }), _jsx(Center, { minH: "477px", children: children }), _jsx(Image, { src: Cloud1, position: "absolute", w: "auto", h: "80px", top: "80px", animation: `${moveRightToLeftWithFade} 400s linear infinite
|
|
9
|
+
return (_jsx(GridItem, { colSpan: [1, 2], children: _jsx(TileTooltip, { label: "homeAssistant", children: _jsxs(Box, { bgGradient: colors.skyGradient, boxShadow: "base", h: "full", position: "relative", overflowX: "hidden", children: [_jsx(ContainerHeader, { title: title, titleIcon: IA }), _jsx(Center, { minH: "477px", children: children }), _jsx(Image, { src: Cloud1, position: "absolute", w: "auto", h: "80px", top: "80px", animation: `${moveRightToLeftWithFade} 400s linear infinite` }), _jsx(Image, { src: Cloud2, position: "absolute", w: "auto", h: "112px", top: "150px", animation: `${moveRightToLeft} 200s linear infinite` }), _jsx(Image, { src: Cloud3, position: "absolute", w: "auto", h: "160px", top: "200px", animation: `${moveRightToLeft} 130s linear infinite` }), showAirplane && (_jsx(Image, { src: Airplane, position: "absolute", w: "auto", h: "40px", top: "85px", animation: `${moveLeftToRightAirplane} 500s cubic-bezier(1, 1, 1, 500) infinite` })), _jsx(Image, { src: TreesCrop, alt: treesAlt, position: "absolute", bottom: "0", right: "2", w: "auto", h: "70px" })] }) }) }));
|
|
10
10
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { HomeMonitorButtonI } from '../../interfaces';
|
|
2
|
-
export declare const HomeMonitorButton: ({ currentStep,
|
|
2
|
+
export declare const HomeMonitorButton: ({ currentStep, onStepClick, status, step, }: HomeMonitorButtonI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Center, Image, Stack, Text } from '@chakra-ui/react';
|
|
3
3
|
import { getIconAltText } from '../../utils';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export const HomeMonitorButton = ({ currentStep, onStepClick, status = 'ok', step, }) => {
|
|
5
|
+
const buttonId = `homeMonitorButton-${currentStep}`;
|
|
6
6
|
const iconAltText = getIconAltText(step.icon);
|
|
7
|
-
|
|
8
|
-
if (status !== 'ok')
|
|
9
|
-
onStepClick(currentStep);
|
|
10
|
-
};
|
|
11
|
-
const isDisabled = Number(menuItems.length) === 0;
|
|
12
|
-
return (_jsxs(Box, { position: "relative", children: [_jsxs(Box, { position: "relative", bg: "neutral.white", borderRadius: "lg", boxShadow: "lg", zIndex: "2", children: [_jsx(Box, { bg: status === 'alert' ? 'error.2' : 'green.1', boxSize: "10px", borderRadius: "full", position: "absolute", top: "6px", left: "6px", zIndex: "8" }), _jsxs(Stack, Object.assign({ position: "relative", zIndex: "2", as: "button", spacing: "2", border: "1px solid transparent", w: "90px", align: "center", h: "96px", py: "base" }, setStyles(status), { onClick: handleClick, children: [_jsx(Center, { h: "60%", marginTop: "2", children: _jsx(Image, { src: step.icon, alt: iconAltText, w: "auto", h: "28px" }) }), _jsx(Center, { h: "40%", children: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", textAlign: "center", lineHeight: "14px", children: step.title }) })] }))] }), _jsx(Box, { position: "absolute", top: "-2px", right: "4px", zIndex: "4", children: _jsx(IconMenu, { icon: _jsx(MoreHorizontal, { size: 26 }), itemForm: currentStep, menuItems: menuItems, disabled: isDisabled }) })] }));
|
|
7
|
+
return (_jsx(Box, { position: "relative", id: buttonId, children: _jsxs(Box, { position: "relative", bg: "neutral.white", borderRadius: "lg", boxShadow: "lg", zIndex: "2", children: [_jsx(Box, { bg: status === 'alert' ? 'error.2' : 'green.1', boxSize: "10px", borderRadius: "full", position: "absolute", top: "6px", left: "6px", zIndex: "8" }), _jsxs(Stack, Object.assign({ position: "relative", zIndex: "2", as: "button", spacing: "2", border: "1px solid transparent", w: "90px", align: "center", h: "96px", py: "base" }, setStyles(status), { onClick: () => onStepClick(currentStep), children: [_jsx(Center, { h: "60%", marginTop: "2", children: _jsx(Image, { src: step.icon, alt: iconAltText, w: "auto", h: "28px" }) }), _jsx(Center, { h: "40%", children: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", textAlign: "center", lineHeight: "14px", children: step.title }) })] }))] }) }));
|
|
13
8
|
};
|
|
14
9
|
const setStyles = (status) => {
|
|
15
10
|
switch (status) {
|
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Flex } from '@chakra-ui/react';
|
|
3
|
-
import { HomeMonitorButton } from '..';
|
|
3
|
+
import { HomeMonitorButton, IconMenu, MoreHorizontal } from '..';
|
|
4
4
|
import { homeAssistantSteps } from '../../helpers';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { useComponentStyles } from '../../hooks';
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
export const HomeMonitorSteps = ({ menuItems = [], onStepClick, stepsWithAlerts, }) => {
|
|
8
|
+
const ids = [
|
|
9
|
+
'homeMonitorButton-1',
|
|
10
|
+
'homeMonitorButton-2',
|
|
11
|
+
'homeMonitorButton-3',
|
|
12
|
+
'homeMonitorButton-4',
|
|
13
|
+
'homeMonitorButton-5',
|
|
14
|
+
'homeMonitorButton-6',
|
|
15
|
+
'menuItems',
|
|
16
|
+
];
|
|
17
|
+
const [selectedId, setSelectedId] = useState('');
|
|
18
|
+
const isDisabled = menuItems.length === 0;
|
|
19
|
+
useComponentStyles({ ids, selectedId, zIndex: '2' });
|
|
20
|
+
const handleStepClick = (step) => {
|
|
21
|
+
onStepClick(step);
|
|
22
|
+
setSelectedId(`homeMonitorButton-${step}`);
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(Flex, { gap: "base", children: homeAssistantSteps.map((step, index) => (_jsx(Box, { position: "relative", children: _jsxs(Box, { flex: "auto", children: [_jsx(HomeMonitorButton, { currentStep: index + 1, onStepClick: handleStepClick, status: getStatus(index + 1, stepsWithAlerts), step: step }), _jsx(Box, { position: "absolute", top: "-2px", right: "4px", zIndex: "1400", children: _jsx(IconMenu, { zIndex: "2", icon: _jsx(MoreHorizontal, { size: 26 }), itemForm: index + 1, menuItems: menuItems, disabled: isDisabled, onClick: () => setSelectedId('menuItems') }) })] }) }, step === null || step === void 0 ? void 0 : step.title))) }));
|
|
7
25
|
};
|
|
8
26
|
const getStatus = (index, stepsWithAlerts) => {
|
|
9
27
|
const hasAlert = stepsWithAlerts.includes(index);
|
|
@@ -3,9 +3,12 @@ import { t } from 'i18next';
|
|
|
3
3
|
import { Center, SimpleGrid, Stack, Text } from '@chakra-ui/react';
|
|
4
4
|
import { ApplianceButton } from '../..';
|
|
5
5
|
import { Fridge, Freezer, Washer, Dryer, Dishwasher, CookTop, Oven, Hood, Microwave, Range, } from '../../../assets/images';
|
|
6
|
-
import { useState } from 'react';
|
|
6
|
+
import { useState, useEffect } from 'react';
|
|
7
7
|
export const ApplianceSteps = ({ addedAppliances = [], onClick, }) => {
|
|
8
8
|
const [appliances, setAppliances] = useState(addedAppliances);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setAppliances(addedAppliances);
|
|
11
|
+
}, [addedAppliances]);
|
|
9
12
|
const handleClick = (id) => {
|
|
10
13
|
if (appliances.includes(id)) {
|
|
11
14
|
const newAppliances = appliances.filter((appliance) => appliance !== id);
|