@homefile/components-v2 1.5.0 → 1.6.0
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/alerts/index.d.ts +2 -0
- package/dist/assets/images/alerts/index.js +2 -0
- package/dist/assets/images/alerts/index.ts +3 -0
- package/dist/assets/images/alerts/smoke-detector-expired.jpg +0 -0
- package/dist/assets/images/battery.svg +9 -0
- package/dist/assets/images/index.d.ts +4 -1
- package/dist/assets/images/index.js +4 -1
- package/dist/assets/images/index.ts +5 -0
- package/dist/assets/images/wind-white.svg +7 -0
- package/dist/assets/locales/en/index.json +68 -1
- package/dist/components/animations/HomieAnimation.d.ts +1 -0
- package/dist/components/animations/HomieAnimation.js +11 -0
- package/dist/components/animations/index.d.ts +1 -0
- package/dist/components/animations/index.js +1 -0
- package/dist/components/badge/CustomBadge.d.ts +5 -0
- package/dist/components/badge/CustomBadge.js +5 -0
- package/dist/components/badge/index.d.ts +5 -4
- package/dist/components/badge/index.js +5 -4
- package/dist/components/contacts/ContactCard.d.ts +1 -1
- package/dist/components/contacts/ContactCard.js +5 -5
- package/dist/components/contacts/ContactCardHeader.d.ts +1 -1
- package/dist/components/contacts/ContactCardHeader.js +4 -4
- package/dist/components/contacts/ContactCardInfo.d.ts +1 -1
- package/dist/components/contacts/ContactCardInfo.js +2 -2
- package/dist/components/contacts/ContactHeaderMenu.js +3 -3
- package/dist/components/contacts/ContactsContent.d.ts +1 -1
- package/dist/components/contacts/ContactsContent.js +31 -6
- package/dist/components/contacts/LetterDivider.d.ts +3 -0
- package/dist/components/contacts/LetterDivider.js +5 -0
- package/dist/components/contacts/ShareContactSection.d.ts +2 -0
- package/dist/components/contacts/ShareContactSection.js +26 -0
- package/dist/components/contacts/index.d.ts +3 -1
- package/dist/components/contacts/index.js +3 -1
- package/dist/components/contacts/shareContactForms/AddReceiverButton.d.ts +2 -0
- package/dist/components/contacts/shareContactForms/AddReceiverButton.js +7 -0
- package/dist/components/contacts/shareContactForms/SendToList.d.ts +2 -0
- package/dist/components/contacts/shareContactForms/SendToList.js +11 -0
- package/dist/components/contacts/shareContactForms/ShareContactByEmail.d.ts +2 -2
- package/dist/components/contacts/shareContactForms/ShareContactByEmail.js +7 -17
- package/dist/components/contacts/shareContactForms/ShareContactByHomefile.d.ts +2 -0
- package/dist/components/contacts/shareContactForms/ShareContactByHomefile.js +17 -0
- package/dist/components/contacts/shareContactForms/ShareContactBySMS.d.ts +2 -0
- package/dist/components/contacts/shareContactForms/ShareContactBySMS.js +11 -0
- package/dist/components/contacts/shareContactForms/index.d.ts +4 -0
- package/dist/components/contacts/shareContactForms/index.js +4 -0
- package/dist/components/contacts/sharePanel/SelectedContacts.d.ts +2 -0
- package/dist/components/contacts/sharePanel/SelectedContacts.js +8 -0
- package/dist/components/contacts/sharePanel/ShareContactsContent.d.ts +2 -0
- package/dist/components/contacts/sharePanel/ShareContactsContent.js +28 -0
- package/dist/components/contacts/sharePanel/index.d.ts +2 -0
- package/dist/components/contacts/sharePanel/index.js +2 -0
- package/dist/components/homeAssistant/HomeAssistant.js +2 -1
- package/dist/components/homeAssistant/HomeAssistantWrapper.d.ts +2 -1
- package/dist/components/homeAssistant/HomeAssistantWrapper.js +2 -3
- package/dist/components/homeAssistant/HomeMonitor.d.ts +2 -0
- package/dist/components/homeAssistant/HomeMonitor.js +6 -0
- package/dist/components/homeAssistant/HomeMonitorButton.d.ts +2 -0
- package/dist/components/homeAssistant/HomeMonitorButton.js +31 -0
- package/dist/components/homeAssistant/HomeMonitorSteps.d.ts +2 -0
- package/dist/components/homeAssistant/HomeMonitorSteps.js +11 -0
- package/dist/components/homeAssistant/index.d.ts +4 -0
- package/dist/components/homeAssistant/index.js +4 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertHeader.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertHeader.js +7 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertTemplate.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertTemplate.js +5 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertTitle.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertTitle.js +5 -0
- package/dist/components/homeAssistant/monitorAlerts/BaseAlertCard.d.ts +3 -0
- package/dist/components/homeAssistant/monitorAlerts/BaseAlertCard.js +21 -0
- package/dist/components/homeAssistant/monitorAlerts/MonitorAlerts.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/MonitorAlerts.js +32 -0
- package/dist/components/homeAssistant/monitorAlerts/Notifications.d.ts +4 -0
- package/dist/components/homeAssistant/monitorAlerts/Notifications.js +9 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/ChangeAirFilter.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/ChangeAirFilter.js +11 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/CustomDivider.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/CustomDivider.js +5 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorBattery.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorBattery.js +11 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorExpired.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorExpired.js +11 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/index.d.ts +4 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/index.js +4 -0
- package/dist/components/homeAssistant/monitorAlerts/index.d.ts +7 -0
- package/dist/components/homeAssistant/monitorAlerts/index.js +7 -0
- package/dist/components/homeAssistant/panel/HomeAssistantPanel.js +1 -1
- package/dist/components/homeBoard/HomeBoard.js +1 -1
- package/dist/components/inputs/TextInput.d.ts +1 -1
- package/dist/components/inputs/TextInput.js +2 -2
- package/dist/components/partner/PartnerFooter.d.ts +1 -1
- package/dist/components/partner/PartnerFooter.js +2 -2
- package/dist/components/partner/ShortPartnerTile.d.ts +1 -1
- package/dist/components/partner/ShortPartnerTile.js +2 -2
- package/dist/helpers/homeAssistant/HomeAssistant.helper.js +4 -4
- package/dist/hooks/contacts/index.d.ts +3 -0
- package/dist/hooks/contacts/index.js +3 -0
- package/dist/hooks/contacts/useContactsContent.d.ts +2 -1
- package/dist/hooks/contacts/useContactsContent.js +28 -2
- package/dist/hooks/contacts/useShareContactBy.d.ts +15 -0
- package/dist/hooks/contacts/useShareContactBy.js +33 -0
- package/dist/hooks/contacts/useShareContactByHomefile.d.ts +16 -0
- package/dist/hooks/contacts/useShareContactByHomefile.js +25 -0
- package/dist/hooks/contacts/useShareContactsContent.d.ts +8 -0
- package/dist/hooks/contacts/useShareContactsContent.js +26 -0
- package/dist/hooks/useAssignableList.d.ts +2 -0
- package/dist/hooks/useAssignableList.js +10 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interfaces/contacts/ContactCard.interface.d.ts +4 -3
- package/dist/interfaces/contacts/ContactCardHeader.interface.d.ts +3 -3
- package/dist/interfaces/contacts/ContactCardInfo.interface.d.ts +1 -0
- package/dist/interfaces/contacts/ContactsContent.interface.d.ts +12 -2
- package/dist/interfaces/contacts/SelectedContacts.interface.d.ts +5 -0
- package/dist/interfaces/contacts/ShareContactBy.interface.d.ts +21 -0
- package/dist/interfaces/contacts/ShareContactSection.interface.d.ts +4 -0
- package/dist/interfaces/contacts/ShareContactSection.interface.js +1 -0
- package/dist/interfaces/contacts/ShareContactsContent.interface.d.ts +17 -0
- package/dist/interfaces/contacts/ShareContactsContent.interface.js +1 -0
- package/dist/interfaces/contacts/ViewContactPanel.interface.d.ts +2 -2
- package/dist/interfaces/contacts/index.d.ts +4 -2
- package/dist/interfaces/contacts/index.js +4 -2
- package/dist/interfaces/homeAssistant/BaseAlertCard.interface.d.ts +8 -0
- package/dist/interfaces/homeAssistant/BaseAlertCard.interface.js +1 -0
- package/dist/interfaces/homeAssistant/HomeMonitorSteps.interface.d.ts +11 -0
- package/dist/interfaces/homeAssistant/HomeMonitorSteps.interface.js +1 -0
- package/dist/interfaces/homeAssistant/MonitorAlerts.interface.d.ts +4 -0
- package/dist/interfaces/homeAssistant/MonitorAlerts.interface.js +1 -0
- package/dist/interfaces/homeAssistant/index.d.ts +3 -0
- package/dist/interfaces/homeAssistant/index.js +3 -0
- package/dist/interfaces/partner/PartnerFooter.interface.d.ts +1 -0
- package/dist/mocks/contacts/contacts.mock.d.ts +1 -0
- package/dist/mocks/contacts/contacts.mock.js +86 -2
- package/dist/stories/animations/HomieAnimation.stories.d.ts +4 -0
- package/dist/stories/animations/HomieAnimation.stories.js +11 -0
- package/dist/stories/assets/Illustrations.stories.js +2 -2
- package/dist/stories/contacts/ContactsContent.stories.d.ts +1 -10
- package/dist/stories/contacts/ContactsContent.stories.js +40 -13
- package/dist/stories/homeAssistant/HomeMonitor.stories.d.ts +4 -0
- package/dist/stories/homeAssistant/HomeMonitor.stories.js +25 -0
- package/dist/stories/homeAssistant/monitorAlerts/HomeAssistant.stories.d.ts +5 -0
- package/dist/stories/homeAssistant/monitorAlerts/HomeAssistant.stories.js +22 -0
- package/dist/theme/colors.d.ts +4 -0
- package/dist/theme/colors.js +4 -0
- package/package.json +2 -1
- package/src/assets/images/alerts/index.ts +3 -0
- package/src/assets/images/alerts/smoke-detector-expired.jpg +0 -0
- package/src/assets/images/battery.svg +9 -0
- package/src/assets/images/index.ts +5 -0
- package/src/assets/images/wind-white.svg +7 -0
- package/src/assets/locales/en/index.json +68 -1
- package/src/components/animations/HomieAnimation.tsx +12 -0
- package/src/components/animations/index.ts +1 -0
- package/src/components/badge/CustomBadge.tsx +22 -0
- package/src/components/badge/index.ts +5 -4
- package/src/components/contacts/ContactCard.tsx +10 -11
- package/src/components/contacts/ContactCardHeader.tsx +12 -4
- package/src/components/contacts/ContactCardInfo.tsx +11 -8
- package/src/components/contacts/ContactHeaderMenu.tsx +3 -15
- package/src/components/contacts/ContactsContent.tsx +143 -17
- package/src/components/contacts/LetterDivider.tsx +15 -0
- package/src/components/contacts/ShareContactSection.tsx +58 -0
- package/src/components/contacts/index.ts +3 -1
- package/src/components/contacts/shareContactForms/AddReceiverButton.tsx +20 -0
- package/src/components/contacts/shareContactForms/SendToList.tsx +47 -0
- package/src/components/contacts/shareContactForms/ShareContactByEmail.tsx +40 -41
- package/src/components/contacts/shareContactForms/ShareContactByHomefile.tsx +88 -0
- package/src/components/contacts/shareContactForms/ShareContactBySMS.tsx +49 -0
- package/src/components/contacts/shareContactForms/index.ts +4 -0
- package/src/components/contacts/sharePanel/SelectedContacts.tsx +37 -0
- package/src/components/contacts/sharePanel/ShareContactsContent.tsx +68 -0
- package/src/components/contacts/sharePanel/index.ts +2 -0
- package/src/components/homeAssistant/HomeAssistant.tsx +5 -1
- package/src/components/homeAssistant/HomeAssistantWrapper.tsx +3 -1
- package/src/components/homeAssistant/HomeMonitor.tsx +11 -0
- package/src/components/homeAssistant/HomeMonitorButton.tsx +69 -0
- package/src/components/homeAssistant/HomeMonitorSteps.tsx +29 -0
- package/src/components/homeAssistant/index.ts +4 -0
- package/src/components/homeAssistant/monitorAlerts/AlertHeader.tsx +30 -0
- package/src/components/homeAssistant/monitorAlerts/AlertTemplate.tsx +25 -0
- package/src/components/homeAssistant/monitorAlerts/AlertTitle.tsx +16 -0
- package/src/components/homeAssistant/monitorAlerts/BaseAlertCard.tsx +60 -0
- package/src/components/homeAssistant/monitorAlerts/MonitorAlerts.tsx +47 -0
- package/src/components/homeAssistant/monitorAlerts/Notifications.tsx +32 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/ChangeAirFilter.tsx +54 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/CustomDivider.tsx +5 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorBattery.tsx +54 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorExpired.tsx +43 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/index.ts +4 -0
- package/src/components/homeAssistant/monitorAlerts/index.ts +7 -0
- package/src/components/homeAssistant/panel/HomeAssistantPanel.tsx +1 -1
- package/src/components/homeBoard/HomeBoard.tsx +2 -1
- package/src/components/inputs/TextInput.tsx +2 -1
- package/src/components/partner/PartnerFooter.tsx +2 -2
- package/src/components/partner/ShortPartnerTile.tsx +2 -1
- package/src/helpers/homeAssistant/HomeAssistant.helper.tsx +4 -4
- package/src/hooks/contacts/index.ts +4 -1
- package/src/hooks/contacts/useContactsContent.ts +38 -4
- package/src/hooks/contacts/useShareContactBy.ts +45 -0
- package/src/hooks/contacts/useShareContactByHomefile.ts +46 -0
- package/src/hooks/contacts/useShareContactsContent.ts +38 -0
- package/src/hooks/useAssignableList.ts +11 -1
- package/src/index.ts +5 -0
- package/src/interfaces/contacts/ContactCard.interface.ts +4 -7
- package/src/interfaces/contacts/ContactCardHeader.interface.ts +3 -3
- package/src/interfaces/contacts/ContactCardInfo.interface.ts +1 -0
- package/src/interfaces/contacts/ContactsContent.interface.ts +13 -2
- package/src/interfaces/contacts/SelectedContacts.interface.ts +6 -0
- package/src/interfaces/contacts/ShareContactBy.interface.ts +25 -0
- package/src/interfaces/contacts/ShareContactSection.interface.ts +6 -0
- package/src/interfaces/contacts/ShareContactsContent.interface.ts +24 -0
- package/src/interfaces/contacts/ViewContactPanel.interface.ts +2 -2
- package/src/interfaces/contacts/index.ts +4 -2
- package/src/interfaces/homeAssistant/BaseAlertCard.interface.ts +8 -0
- package/src/interfaces/homeAssistant/HomeMonitorSteps.interface.ts +13 -0
- package/src/interfaces/homeAssistant/MonitorAlerts.interface.ts +8 -0
- package/src/interfaces/homeAssistant/index.ts +3 -0
- package/src/interfaces/partner/PartnerFooter.interface.ts +1 -0
- package/src/mocks/contacts/contacts.mock.ts +87 -2
- package/src/stories/animations/HomieAnimation.stories.tsx +17 -0
- package/src/stories/assets/Illustrations.stories.tsx +2 -0
- package/src/stories/contacts/ContactsContent.stories.tsx +73 -16
- package/src/stories/homeAssistant/HomeMonitor.stories.tsx +54 -0
- package/src/stories/homeAssistant/monitorAlerts/HomeAssistant.stories.tsx +30 -0
- package/src/theme/colors.ts +4 -0
- package/dist/components/contacts/ShareContactPopover.d.ts +0 -2
- package/dist/components/contacts/ShareContactPopover.js +0 -32
- package/dist/interfaces/contacts/ShareContactByEmail.interface.d.ts +0 -11
- package/dist/interfaces/contacts/ShareContactPopover.interface.d.ts +0 -8
- package/src/components/contacts/ShareContactPopover.tsx +0 -106
- package/src/interfaces/contacts/ShareContactByEmail.interface.ts +0 -12
- package/src/interfaces/contacts/ShareContactPopover.interface.ts +0 -9
- /package/dist/interfaces/contacts/{ShareContactByEmail.interface.js → SelectedContacts.interface.js} +0 -0
- /package/dist/interfaces/contacts/{ShareContactPopover.interface.js → ShareContactBy.interface.js} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { t } from 'i18next'
|
|
2
|
+
import {
|
|
3
|
+
DrawerContent,
|
|
4
|
+
DrawerHeader,
|
|
5
|
+
DrawerBody,
|
|
6
|
+
Stack,
|
|
7
|
+
DrawerFooter,
|
|
8
|
+
} from '@chakra-ui/react'
|
|
9
|
+
import { Contacts } from '@/assets/images'
|
|
10
|
+
import {
|
|
11
|
+
FooterButtons,
|
|
12
|
+
FooterDrawer,
|
|
13
|
+
PanelHeader,
|
|
14
|
+
SelectedContacts,
|
|
15
|
+
ShareContactSection,
|
|
16
|
+
} from '@/components'
|
|
17
|
+
import { ShareContactsContentI } from '@/interfaces'
|
|
18
|
+
import { useShareContactsContent } from '@/hooks'
|
|
19
|
+
|
|
20
|
+
export const ShareContactsContent = ({
|
|
21
|
+
contacts,
|
|
22
|
+
onClose,
|
|
23
|
+
onShare,
|
|
24
|
+
...props
|
|
25
|
+
}: ShareContactsContentI) => {
|
|
26
|
+
const {
|
|
27
|
+
contactsSelected,
|
|
28
|
+
recipientsToSend,
|
|
29
|
+
handleAddRecipient,
|
|
30
|
+
handleDeleteSelectedContact,
|
|
31
|
+
handleShareContacts,
|
|
32
|
+
} = useShareContactsContent({ contacts, onShare })
|
|
33
|
+
|
|
34
|
+
const numberOfContacts = Number(contacts.length)
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<DrawerContent bg="lightBlue.1">
|
|
38
|
+
<DrawerHeader p="0">
|
|
39
|
+
<PanelHeader
|
|
40
|
+
handleCloseButton={onClose}
|
|
41
|
+
icon={Contacts}
|
|
42
|
+
title={`${t('contacts.shareContact')} (${numberOfContacts})`}
|
|
43
|
+
/>
|
|
44
|
+
</DrawerHeader>
|
|
45
|
+
<DrawerBody p="0" overflowX="hidden" overflowY="scroll" bg="lightBlue.2">
|
|
46
|
+
<Stack pb="120px" spacing="0">
|
|
47
|
+
<SelectedContacts
|
|
48
|
+
contacts={contactsSelected}
|
|
49
|
+
onDeleteSelected={handleDeleteSelectedContact}
|
|
50
|
+
/>
|
|
51
|
+
<ShareContactSection {...props} onShare={handleAddRecipient} />
|
|
52
|
+
</Stack>
|
|
53
|
+
</DrawerBody>
|
|
54
|
+
<DrawerFooter p="0">
|
|
55
|
+
<FooterDrawer isOpen>
|
|
56
|
+
<FooterButtons
|
|
57
|
+
button1={{
|
|
58
|
+
buttonStyle: 'primaryFooter',
|
|
59
|
+
label: t('buttons.send'),
|
|
60
|
+
isDisabled: Number(recipientsToSend.length) === 0,
|
|
61
|
+
onClick: handleShareContacts,
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
</FooterDrawer>
|
|
65
|
+
</DrawerFooter>
|
|
66
|
+
</DrawerContent>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
+
import { t } from 'i18next'
|
|
2
3
|
import {
|
|
3
4
|
HomeAssistantSteps,
|
|
4
5
|
HomeAssistantTutorial,
|
|
@@ -14,7 +15,10 @@ export const HomeAssistant = ({
|
|
|
14
15
|
const [startSetup, setStartSetup] = useState(false)
|
|
15
16
|
const showAirplane = props.currentStep === 6 && (!showTutorial || startSetup)
|
|
16
17
|
return (
|
|
17
|
-
<HomeAssistantWrapper
|
|
18
|
+
<HomeAssistantWrapper
|
|
19
|
+
showAirplane={showAirplane}
|
|
20
|
+
title={t('homeAssistant.title')}
|
|
21
|
+
>
|
|
18
22
|
{!startSetup && showTutorial && (
|
|
19
23
|
<HomeAssistantTutorial
|
|
20
24
|
onStart={() => setStartSetup(true)}
|
|
@@ -22,8 +22,10 @@ import { colors } from '@/theme/colors'
|
|
|
22
22
|
export const HomeAssistantWrapper = ({
|
|
23
23
|
children,
|
|
24
24
|
showAirplane,
|
|
25
|
+
title,
|
|
25
26
|
}: PropsWithChildren<{
|
|
26
27
|
showAirplane?: boolean
|
|
28
|
+
title: string
|
|
27
29
|
}>) => {
|
|
28
30
|
const treesAlt = getImageAltText(TreesCrop)
|
|
29
31
|
|
|
@@ -37,7 +39,7 @@ export const HomeAssistantWrapper = ({
|
|
|
37
39
|
position="relative"
|
|
38
40
|
overflowX="hidden"
|
|
39
41
|
>
|
|
40
|
-
<ContainerHeader title={
|
|
42
|
+
<ContainerHeader title={title} titleIcon={IA} />
|
|
41
43
|
<Center minH="477px">{children}</Center>
|
|
42
44
|
<Image
|
|
43
45
|
src={Cloud1}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react'
|
|
2
|
+
import { t } from 'i18next'
|
|
3
|
+
import { HomeAssistantWrapper } from '@/components'
|
|
4
|
+
|
|
5
|
+
export const HomeMonitor = ({ children }: PropsWithChildren<{}>) => {
|
|
6
|
+
return (
|
|
7
|
+
<HomeAssistantWrapper showAirplane title={t('homeAssistant.homeMonitor')}>
|
|
8
|
+
{children}
|
|
9
|
+
</HomeAssistantWrapper>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Box, Center, Image, Stack, Text } from '@chakra-ui/react'
|
|
2
|
+
import { HomeMonitorButtonI } from '@/interfaces'
|
|
3
|
+
import { getIconAltText } from '@/utils'
|
|
4
|
+
|
|
5
|
+
export const HomeMonitorButton = ({
|
|
6
|
+
currentStep,
|
|
7
|
+
onStepClick,
|
|
8
|
+
status,
|
|
9
|
+
step,
|
|
10
|
+
}: HomeMonitorButtonI) => {
|
|
11
|
+
const iconAltText = getIconAltText(step.icon)
|
|
12
|
+
const handleClick = () => {
|
|
13
|
+
console.log({ status })
|
|
14
|
+
if (status !== 'ok') onStepClick(currentStep)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Box>
|
|
19
|
+
<Stack
|
|
20
|
+
as="button"
|
|
21
|
+
spacing="2"
|
|
22
|
+
borderRadius="lg"
|
|
23
|
+
boxShadow="lg"
|
|
24
|
+
border="1px solid transparent"
|
|
25
|
+
w="90px"
|
|
26
|
+
align="center"
|
|
27
|
+
h="96px"
|
|
28
|
+
py="base"
|
|
29
|
+
bg="neutral.white"
|
|
30
|
+
{...setStyles(status)}
|
|
31
|
+
onClick={handleClick}
|
|
32
|
+
>
|
|
33
|
+
<Center h="60%">
|
|
34
|
+
<Image src={step.icon} alt={iconAltText} w="auto" h="28px" />
|
|
35
|
+
</Center>
|
|
36
|
+
<Center h="40%">
|
|
37
|
+
<Text
|
|
38
|
+
fontSize="xs"
|
|
39
|
+
textTransform="uppercase"
|
|
40
|
+
textAlign="center"
|
|
41
|
+
lineHeight="14px"
|
|
42
|
+
>
|
|
43
|
+
{step.title}
|
|
44
|
+
</Text>
|
|
45
|
+
</Center>
|
|
46
|
+
</Stack>
|
|
47
|
+
</Box>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const setStyles = (status: HomeMonitorButtonI['status']) => {
|
|
52
|
+
switch (status) {
|
|
53
|
+
case 'alert':
|
|
54
|
+
return {
|
|
55
|
+
cursor: 'pointer',
|
|
56
|
+
border: '1px solid',
|
|
57
|
+
borderColor: 'error.2',
|
|
58
|
+
transition: 'all 0.3s',
|
|
59
|
+
_hover: {
|
|
60
|
+
bg: 'lightGreen.7',
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
case 'ok':
|
|
64
|
+
return {
|
|
65
|
+
cursor: 'not-allowed',
|
|
66
|
+
filter: 'grayscale(1) opacity(0.6)',
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Box, Flex } from '@chakra-ui/react'
|
|
2
|
+
import { HomeMonitortStepsI } from '@/interfaces'
|
|
3
|
+
import { HomeMonitorButton } from '@/components'
|
|
4
|
+
import { homeAssistantSteps } from '@/helpers'
|
|
5
|
+
|
|
6
|
+
export const HomeMonitorSteps = ({
|
|
7
|
+
onStepClick,
|
|
8
|
+
stepsWithAlerts,
|
|
9
|
+
}: HomeMonitortStepsI) => {
|
|
10
|
+
return (
|
|
11
|
+
<Flex gap="base">
|
|
12
|
+
{homeAssistantSteps.map((step, index) => (
|
|
13
|
+
<Box key={step.title} flex="auto">
|
|
14
|
+
<HomeMonitorButton
|
|
15
|
+
currentStep={index + 1}
|
|
16
|
+
onStepClick={onStepClick}
|
|
17
|
+
status={getStatus(index + 1, stepsWithAlerts)}
|
|
18
|
+
step={step}
|
|
19
|
+
/>
|
|
20
|
+
</Box>
|
|
21
|
+
))}
|
|
22
|
+
</Flex>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const getStatus = (index: number, stepsWithAlerts: number[]) => {
|
|
27
|
+
const hasAlert = stepsWithAlerts.includes(index)
|
|
28
|
+
return hasAlert ? 'alert' : 'ok'
|
|
29
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './monitorAlerts'
|
|
1
2
|
export * from './panel'
|
|
2
3
|
export * from './HomeAssistant'
|
|
3
4
|
export * from './HomeAssistantButton'
|
|
@@ -5,3 +6,6 @@ export * from './HomeAssistantStepper'
|
|
|
5
6
|
export * from './HomeAssistantSteps'
|
|
6
7
|
export * from './HomeAssistantTutorial'
|
|
7
8
|
export * from './HomeAssistantWrapper'
|
|
9
|
+
export * from './HomeMonitor'
|
|
10
|
+
export * from './HomeMonitorButton'
|
|
11
|
+
export * from './HomeMonitorSteps'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { t } from 'i18next'
|
|
2
|
+
import { Flex, Center, Image, Text } from '@chakra-ui/react'
|
|
3
|
+
import { Exclamation } from '@/assets/images'
|
|
4
|
+
|
|
5
|
+
export const AlertHeader = () => {
|
|
6
|
+
return (
|
|
7
|
+
<Flex
|
|
8
|
+
justifyContent="space-between"
|
|
9
|
+
px="base"
|
|
10
|
+
py="1"
|
|
11
|
+
bg="error.2"
|
|
12
|
+
borderTopRadius="lg"
|
|
13
|
+
align="center"
|
|
14
|
+
>
|
|
15
|
+
<Flex align="center" gap="2">
|
|
16
|
+
<Center p="1" borderRadius="full" bg="pink.1" h="18px" w="18px">
|
|
17
|
+
<Image src={Exclamation} h="100%" w="auto" />
|
|
18
|
+
</Center>
|
|
19
|
+
<Text
|
|
20
|
+
color="white"
|
|
21
|
+
fontSize="sm"
|
|
22
|
+
fontWeight="medium"
|
|
23
|
+
textTransform="uppercase"
|
|
24
|
+
>
|
|
25
|
+
{t('homeAssistant.monitorAlerts.homeAction')}
|
|
26
|
+
</Text>
|
|
27
|
+
</Flex>
|
|
28
|
+
</Flex>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseAlertCardI } from '@/interfaces'
|
|
2
|
+
import { Center, Flex, Image, Stack, Text } from '@chakra-ui/react'
|
|
3
|
+
|
|
4
|
+
export const AlertTemplate = ({
|
|
5
|
+
bg = 'error.1',
|
|
6
|
+
description,
|
|
7
|
+
icon,
|
|
8
|
+
title,
|
|
9
|
+
}: Pick<BaseAlertCardI, 'bg' | 'description' | 'title' | 'icon'>) => {
|
|
10
|
+
return (
|
|
11
|
+
<Flex gap="base" px="base" pt="1" pb="4">
|
|
12
|
+
<Center minW="60px" h="60px" bg={bg} borderRadius="md">
|
|
13
|
+
<Image src={icon} maxH="36px" w="auto" />
|
|
14
|
+
</Center>
|
|
15
|
+
<Stack>
|
|
16
|
+
<Text fontWeight="semibold" fontSize="xl" lineHeight="1.2">
|
|
17
|
+
{title}
|
|
18
|
+
</Text>
|
|
19
|
+
<Text fontFamily="secondary" fontSize="sm" lineHeight="1.2">
|
|
20
|
+
{description}
|
|
21
|
+
</Text>
|
|
22
|
+
</Stack>
|
|
23
|
+
</Flex>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Flex, Image, Text } from '@chakra-ui/react'
|
|
2
|
+
import { BaseAlertCardI } from '@/interfaces'
|
|
3
|
+
|
|
4
|
+
export const AlertTitle = ({
|
|
5
|
+
alertIcon,
|
|
6
|
+
alertTitle,
|
|
7
|
+
}: Pick<BaseAlertCardI, 'alertIcon' | 'alertTitle'>) => {
|
|
8
|
+
return (
|
|
9
|
+
<Flex align="center" gap="1" p="base">
|
|
10
|
+
<Image src={alertIcon} h="20px" w="20px" />
|
|
11
|
+
<Text fontSize="xs" textTransform="uppercase">
|
|
12
|
+
{alertTitle}
|
|
13
|
+
</Text>
|
|
14
|
+
</Flex>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react'
|
|
2
|
+
import { t } from 'i18next'
|
|
3
|
+
import { Box, Button, Collapse, Flex, useDisclosure } from '@chakra-ui/react'
|
|
4
|
+
import { AlertHeader, AlertTemplate, AlertTitle, Overlay } from '@/components'
|
|
5
|
+
import { BaseAlertCardI } from '@/interfaces'
|
|
6
|
+
import { Warranty } from '@/assets/images'
|
|
7
|
+
|
|
8
|
+
export const BaseAlertCard = ({
|
|
9
|
+
alertIcon = Warranty,
|
|
10
|
+
alertTitle = t('homeAssistant.monitorAlerts.protection'),
|
|
11
|
+
children,
|
|
12
|
+
...props
|
|
13
|
+
}: PropsWithChildren<BaseAlertCardI>) => {
|
|
14
|
+
const { isOpen, onToggle } = useDisclosure()
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<Box
|
|
18
|
+
display="flex"
|
|
19
|
+
flexDir="column"
|
|
20
|
+
bg="neutral.white"
|
|
21
|
+
boxShadow="lg"
|
|
22
|
+
borderRadius="lg"
|
|
23
|
+
overflow="hidden"
|
|
24
|
+
maxW="420px"
|
|
25
|
+
position={isOpen ? 'absolute' : 'relative'}
|
|
26
|
+
top={isOpen ? '4' : 'auto'}
|
|
27
|
+
left={isOpen ? 'calc(50% - 218px)' : 'auto'}
|
|
28
|
+
zIndex="popover"
|
|
29
|
+
>
|
|
30
|
+
<AlertHeader />
|
|
31
|
+
<AlertTitle alertIcon={alertIcon} alertTitle={alertTitle} />
|
|
32
|
+
<AlertTemplate {...props} />
|
|
33
|
+
<Collapse in={isOpen} animateOpacity>
|
|
34
|
+
<Box p="base" bg="lightBlue.1">
|
|
35
|
+
{children}
|
|
36
|
+
</Box>
|
|
37
|
+
</Collapse>
|
|
38
|
+
<Flex py="base" bg="lightBlue.1" justify="flex-end">
|
|
39
|
+
<Button
|
|
40
|
+
variant="leftRounded"
|
|
41
|
+
w="fit-content"
|
|
42
|
+
px="8"
|
|
43
|
+
fontSize="sm"
|
|
44
|
+
fontWeight="medium"
|
|
45
|
+
onClick={onToggle}
|
|
46
|
+
bg={isOpen ? 'blue.8' : 'blue.2'}
|
|
47
|
+
>
|
|
48
|
+
{t(`homeAssistant.monitorAlerts.${isOpen ? 'collapse' : 'review'}`)}
|
|
49
|
+
</Button>
|
|
50
|
+
</Flex>
|
|
51
|
+
</Box>
|
|
52
|
+
<Overlay
|
|
53
|
+
bg="overlayWhite"
|
|
54
|
+
showOverlay={isOpen}
|
|
55
|
+
position="absolute"
|
|
56
|
+
zIndex="modal"
|
|
57
|
+
/>
|
|
58
|
+
</>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode } from 'react'
|
|
2
|
+
import { t } from 'i18next'
|
|
3
|
+
import {
|
|
4
|
+
BaseAlertCard,
|
|
5
|
+
ChangeAirFilter,
|
|
6
|
+
SmokeDetectorBattery,
|
|
7
|
+
SmokeDetectorExpired,
|
|
8
|
+
} from '@/components'
|
|
9
|
+
import { BaseAlertCardI, MonitorAlertsI, MonitorAlertsType } from '@/interfaces'
|
|
10
|
+
import { Battery, Fire, GearTime, Wind, WindWhite } from '@/assets/images'
|
|
11
|
+
|
|
12
|
+
export const MonitorAlerts = ({ alertId }: MonitorAlertsI) => {
|
|
13
|
+
const alertChildren: Record<MonitorAlertsType, ReactNode> = {
|
|
14
|
+
'smoke-detector-battery': <SmokeDetectorBattery />,
|
|
15
|
+
'smoke-detector-expired': <SmokeDetectorExpired />,
|
|
16
|
+
'change-air-filter': <ChangeAirFilter />,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const alerts: Record<MonitorAlertsType, BaseAlertCardI> = {
|
|
20
|
+
'change-air-filter': {
|
|
21
|
+
bg: 'lightBlue.8',
|
|
22
|
+
alertIcon: GearTime,
|
|
23
|
+
alertTitle: t('homeAssistant.monitorAlerts.maintenance'),
|
|
24
|
+
icon: WindWhite,
|
|
25
|
+
title: t('homeAssistant.alerts.airFilter.main.title'),
|
|
26
|
+
description: t('homeAssistant.alerts.airFilter.main.description'),
|
|
27
|
+
},
|
|
28
|
+
'smoke-detector-battery': {
|
|
29
|
+
icon: Battery,
|
|
30
|
+
title: t('homeAssistant.alerts.smokeDetectorBattery.main.title'),
|
|
31
|
+
description: t(
|
|
32
|
+
'homeAssistant.alerts.smokeDetectorBattery.main.description'
|
|
33
|
+
),
|
|
34
|
+
},
|
|
35
|
+
'smoke-detector-expired': {
|
|
36
|
+
icon: Fire,
|
|
37
|
+
title: t('homeAssistant.alerts.smokeDetectorExpired.main.title'),
|
|
38
|
+
description: t(
|
|
39
|
+
'homeAssistant.alerts.smokeDetectorExpired.main.description'
|
|
40
|
+
),
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<BaseAlertCard {...alerts[alertId]}>{alertChildren[alertId]}</BaseAlertCard>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Stack, Flex, Center, Text } from '@chakra-ui/react'
|
|
2
|
+
import { t } from 'i18next'
|
|
3
|
+
|
|
4
|
+
export const Notifications = ({ date = '', local = '' }) => {
|
|
5
|
+
return (
|
|
6
|
+
<Stack spacing="base" minH="full" zIndex="2">
|
|
7
|
+
<Flex justify="space-between">
|
|
8
|
+
<CustomText>{date}</CustomText>
|
|
9
|
+
<CustomText>{local}</CustomText>
|
|
10
|
+
</Flex>
|
|
11
|
+
<Center
|
|
12
|
+
w="188px"
|
|
13
|
+
h="full"
|
|
14
|
+
border="1px dashed"
|
|
15
|
+
borderColor="blue.1"
|
|
16
|
+
borderRadius="sm"
|
|
17
|
+
>
|
|
18
|
+
<Text fontSize="sm" fontFamily="secondary">
|
|
19
|
+
{t('homeAssistant.notifications')}
|
|
20
|
+
</Text>
|
|
21
|
+
</Center>
|
|
22
|
+
</Stack>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const CustomText = ({ children = '' }) => {
|
|
27
|
+
return (
|
|
28
|
+
<Text fontSize="sm" fontFamily="secondary" textTransform="uppercase">
|
|
29
|
+
{children}
|
|
30
|
+
</Text>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t } from 'i18next'
|
|
2
|
+
import { Box, Flex, Stack, Text } from '@chakra-ui/react'
|
|
3
|
+
import { CustomBadge } from '@/components/badge'
|
|
4
|
+
import { CustomDivider } from '@/components'
|
|
5
|
+
|
|
6
|
+
export const ChangeAirFilter = () => {
|
|
7
|
+
return (
|
|
8
|
+
<Stack spacing="base">
|
|
9
|
+
<Text fontSize="sm" fontFamily="secondary" lineHeight="1.2">
|
|
10
|
+
{t('homeAssistant.alerts.airFilter.description')}
|
|
11
|
+
</Text>
|
|
12
|
+
<CustomDivider />
|
|
13
|
+
<Text fontWeight="semibold">
|
|
14
|
+
{t('homeAssistant.alerts.airFilter.title')}
|
|
15
|
+
</Text>
|
|
16
|
+
<CustomDivider />
|
|
17
|
+
<FilterType
|
|
18
|
+
badgeText={t('homeAssistant.alerts.airFilter.bestBadge')}
|
|
19
|
+
title={t('homeAssistant.alerts.airFilter.best.title')}
|
|
20
|
+
description={t('homeAssistant.alerts.airFilter.best.description')}
|
|
21
|
+
/>
|
|
22
|
+
<CustomDivider />
|
|
23
|
+
<FilterType
|
|
24
|
+
badgeText={t('homeAssistant.alerts.airFilter.betterBadge')}
|
|
25
|
+
title={t('homeAssistant.alerts.airFilter.better.title')}
|
|
26
|
+
description={t('homeAssistant.alerts.airFilter.better.description')}
|
|
27
|
+
bg="blue.11"
|
|
28
|
+
/>
|
|
29
|
+
</Stack>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const FilterType = ({
|
|
34
|
+
badgeText = '',
|
|
35
|
+
title = '',
|
|
36
|
+
description = '',
|
|
37
|
+
bg = 'blue.10',
|
|
38
|
+
}) => {
|
|
39
|
+
return (
|
|
40
|
+
<Flex gap="base">
|
|
41
|
+
<Box h="fit-content" minW="48px">
|
|
42
|
+
<CustomBadge label={badgeText} bg={bg} />
|
|
43
|
+
</Box>
|
|
44
|
+
<Stack spacing="1">
|
|
45
|
+
<Text fontSize="sm" fontWeight="semibold" lineHeight="1.2">
|
|
46
|
+
{title}
|
|
47
|
+
</Text>
|
|
48
|
+
<Text fontSize="sm" fontFamily="secondary" lineHeight="1.2">
|
|
49
|
+
{description}
|
|
50
|
+
</Text>
|
|
51
|
+
</Stack>
|
|
52
|
+
</Flex>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t } from 'i18next'
|
|
2
|
+
import { Box, Flex, Stack, Text } from '@chakra-ui/react'
|
|
3
|
+
import { CustomBadge } from '@/components/badge'
|
|
4
|
+
import { CustomDivider } from '@/components'
|
|
5
|
+
|
|
6
|
+
export const SmokeDetectorBattery = () => {
|
|
7
|
+
return (
|
|
8
|
+
<Stack spacing="base">
|
|
9
|
+
<Text fontWeight="semibold">
|
|
10
|
+
{t('homeAssistant.alerts.smokeDetectorBattery.title')}
|
|
11
|
+
</Text>
|
|
12
|
+
<CustomDivider />
|
|
13
|
+
<BatteryType
|
|
14
|
+
badgeText={t('homeAssistant.alerts.smokeDetectorBattery.bestBadge')}
|
|
15
|
+
title={t('homeAssistant.alerts.smokeDetectorBattery.best.title')}
|
|
16
|
+
description={t(
|
|
17
|
+
'homeAssistant.alerts.smokeDetectorBattery.best.description'
|
|
18
|
+
)}
|
|
19
|
+
/>
|
|
20
|
+
<CustomDivider />
|
|
21
|
+
<BatteryType
|
|
22
|
+
badgeText={t('homeAssistant.alerts.smokeDetectorBattery.betterBadge')}
|
|
23
|
+
title={t('homeAssistant.alerts.smokeDetectorBattery.better.title')}
|
|
24
|
+
description={t(
|
|
25
|
+
'homeAssistant.alerts.smokeDetectorBattery.better.description'
|
|
26
|
+
)}
|
|
27
|
+
bg="blue.11"
|
|
28
|
+
/>
|
|
29
|
+
</Stack>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const BatteryType = ({
|
|
34
|
+
badgeText = '',
|
|
35
|
+
title = '',
|
|
36
|
+
description = '',
|
|
37
|
+
bg = 'blue.10',
|
|
38
|
+
}) => {
|
|
39
|
+
return (
|
|
40
|
+
<Flex gap="base">
|
|
41
|
+
<Box h="fit-content" minW="48px">
|
|
42
|
+
<CustomBadge label={badgeText} bg={bg} />
|
|
43
|
+
</Box>
|
|
44
|
+
<Stack spacing="1">
|
|
45
|
+
<Text fontSize="sm" fontWeight="semibold" lineHeight="1.2">
|
|
46
|
+
{title}
|
|
47
|
+
</Text>
|
|
48
|
+
<Text fontSize="sm" fontFamily="secondary" lineHeight="1.2">
|
|
49
|
+
{description}
|
|
50
|
+
</Text>
|
|
51
|
+
</Stack>
|
|
52
|
+
</Flex>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { t } from 'i18next'
|
|
2
|
+
import { Box, Flex, Image, Stack, Text } from '@chakra-ui/react'
|
|
3
|
+
import { CustomDivider } from '@/components'
|
|
4
|
+
import { SmokeDetectroExpiredImage } from '@/assets/images'
|
|
5
|
+
|
|
6
|
+
export const SmokeDetectorExpired = () => {
|
|
7
|
+
return (
|
|
8
|
+
<Stack spacing="base">
|
|
9
|
+
<Text fontSize="sm" fontFamily="secondary" lineHeight="1.2">
|
|
10
|
+
{t('homeAssistant.alerts.smokeDetectorExpired.description')}
|
|
11
|
+
</Text>
|
|
12
|
+
<CustomDivider />
|
|
13
|
+
<Text fontWeight="semibold">
|
|
14
|
+
{t('homeAssistant.alerts.smokeDetectorExpired.title')}
|
|
15
|
+
</Text>
|
|
16
|
+
<Flex gap="base">
|
|
17
|
+
<Image src={SmokeDetectroExpiredImage} boxSize="84px" />
|
|
18
|
+
<Stack spacing="1">
|
|
19
|
+
<CheckItem
|
|
20
|
+
text={t('homeAssistant.alerts.smokeDetectorExpired.check1')}
|
|
21
|
+
/>
|
|
22
|
+
<CheckItem
|
|
23
|
+
text={t('homeAssistant.alerts.smokeDetectorExpired.check2')}
|
|
24
|
+
/>
|
|
25
|
+
<CheckItem
|
|
26
|
+
text={t('homeAssistant.alerts.smokeDetectorExpired.check3')}
|
|
27
|
+
/>
|
|
28
|
+
</Stack>
|
|
29
|
+
</Flex>
|
|
30
|
+
</Stack>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const CheckItem = ({ text = '' }) => {
|
|
35
|
+
return (
|
|
36
|
+
<Flex align="center" gap="base">
|
|
37
|
+
<Box boxSize="6px" borderRadius="full" bg="gray.3" />
|
|
38
|
+
<Text fontSize="sm" fontFamily="secondary">
|
|
39
|
+
{text}
|
|
40
|
+
</Text>
|
|
41
|
+
</Flex>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -35,7 +35,7 @@ export const HomeAssistantPanel = ({
|
|
|
35
35
|
}: PropsWithChildren<HomeAssistantPanelI>) => {
|
|
36
36
|
const { title } = homeAssistantSteps[currentStep - 1]
|
|
37
37
|
const text = `${t('homeAssistant.details')} ${title.toLowerCase()}:`
|
|
38
|
-
const isAppliances = currentStep ===
|
|
38
|
+
const isAppliances = currentStep === 4
|
|
39
39
|
const { form, updatedFields } = useSimpleDynamicForm({
|
|
40
40
|
fields: currentForm,
|
|
41
41
|
})
|
|
@@ -11,6 +11,7 @@ export const TextInput = ({
|
|
|
11
11
|
isDisabled,
|
|
12
12
|
placeholder,
|
|
13
13
|
value = '',
|
|
14
|
+
type = 'text',
|
|
14
15
|
...props
|
|
15
16
|
}: InputI) => {
|
|
16
17
|
const error = hasError && !isDisabled
|
|
@@ -23,8 +24,8 @@ export const TextInput = ({
|
|
|
23
24
|
autoCorrect={autoCorrect}
|
|
24
25
|
id={id}
|
|
25
26
|
placeholder={placeholder}
|
|
26
|
-
type="text"
|
|
27
27
|
value={value}
|
|
28
|
+
type={type}
|
|
28
29
|
onChange={handleChange}
|
|
29
30
|
isInvalid={error}
|
|
30
31
|
isDisabled={isDisabled}
|