@homefile/components-v2 2.9.2 → 2.9.4
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/locales/en/index.json +2 -1
- package/dist/components/contacts/ContactsContent.d.ts +1 -1
- package/dist/components/contacts/ContactsContent.js +3 -3
- package/dist/components/homeBoard/HomeBoard.js +1 -1
- package/dist/components/launchpad/Launchpad.js +1 -1
- package/dist/components/myHomes/MyHomes.d.ts +1 -1
- package/dist/components/myHomes/MyHomes.js +3 -3
- package/dist/interfaces/contacts/ContactsContent.interface.d.ts +3 -0
- package/dist/interfaces/myHomes/MyHomes.interface.d.ts +3 -0
- package/dist/interfaces/myProfile/details/TwoFactorDialog.interface.d.ts +1 -1
- package/dist/interfaces/pages/TwoFactor.interface.d.ts +1 -1
- package/dist/stories/contacts/ContactsContent.stories.js +1 -0
- package/dist/stories/myHomes/MyHomes.stories.d.ts +3 -0
- package/dist/stories/myHomes/MyHomes.stories.js +3 -0
- package/package.json +1 -1
- package/src/assets/locales/en/index.json +2 -1
- package/src/components/contacts/ContactsContent.tsx +13 -0
- package/src/components/homeBoard/HomeBoard.tsx +3 -0
- package/src/components/launchpad/Launchpad.tsx +3 -0
- package/src/components/myHomes/MyHomes.tsx +13 -1
- package/src/interfaces/contacts/ContactsContent.interface.ts +3 -0
- package/src/interfaces/myHomes/MyHomes.interface.ts +3 -0
- package/src/interfaces/myProfile/details/TwoFactorDialog.interface.ts +1 -1
- package/src/interfaces/pages/TwoFactor.interface.ts +1 -1
- package/src/stories/contacts/ContactsContent.stories.tsx +1 -0
- package/src/stories/myHomes/MyHomes.stories.tsx +3 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ContactsContentI } from '../../interfaces';
|
|
2
|
-
export declare const ContactsContent: ({ apiError, contacts, menuItems, handleClose, children, handleAdd, disabled, onClick, onDeleteContacts, onShareContacts, }: ContactsContentI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const ContactsContent: ({ apiError, contacts, menuItems, handleClose, children, handleAdd, disabled, onClick, onDeleteContacts, onShareContacts, showLoadMore, handleLoadMore, loadMoreDisabled }: ContactsContentI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
|
-
import { DrawerContent, DrawerHeader, DrawerBody, Flex, Stack, Checkbox, Box, Text, DrawerFooter, } from '@chakra-ui/react';
|
|
3
|
+
import { DrawerContent, DrawerHeader, DrawerBody, Flex, Stack, Checkbox, Box, Text, DrawerFooter, Button } from '@chakra-ui/react';
|
|
4
4
|
import { Contacts } from '../../assets/images';
|
|
5
5
|
import { ContactCard, FooterButtons, FooterDrawer, LeftButtonAnimated, LetterDivider, PanelHeader, SearchInput, } from '..';
|
|
6
6
|
import { useAssignableList, useContactsContent, useWindowDimensions, } from '../../hooks';
|
|
7
|
-
export const ContactsContent = ({ apiError, contacts, menuItems, handleClose, children, handleAdd, disabled, onClick, onDeleteContacts, onShareContacts, }) => {
|
|
7
|
+
export const ContactsContent = ({ apiError, contacts, menuItems, handleClose, children, handleAdd, disabled, onClick, onDeleteContacts, onShareContacts, showLoadMore, handleLoadMore, loadMoreDisabled }) => {
|
|
8
8
|
const { contactsWithoutFirstOrLastName, handleChange, search, splittedContacts, } = useContactsContent(contacts);
|
|
9
9
|
const { getContactByIds, handleItemSelect, handleSelectAll, isItemSelected, itemsSelected, } = useAssignableList({
|
|
10
10
|
onItemSelectedChange: () => null,
|
|
@@ -22,7 +22,7 @@ export const ContactsContent = ({ apiError, contacts, menuItems, handleClose, ch
|
|
|
22
22
|
}) }), Number(contactsWithoutFirstOrLastName.length) > 0 && (_jsx(LetterDivider, { letter: "Others" })), _jsx(Box, { children: contactsWithoutFirstOrLastName.map((contact, idx) => {
|
|
23
23
|
const selected = isItemSelected(contact._id);
|
|
24
24
|
return (_jsx(Card, { apiError: apiError, contact: contact, onClick: onClick, index: idx, menuItems: menuItems, selected: selected, onChange: handleItemSelect }, contact._id));
|
|
25
|
-
}) })] }), children] }), _jsx(DrawerFooter, { p: "0", zIndex: "overlay", children: _jsx(FooterDrawer, { isOpen: !isDisabled, children: _jsx(FooterButtons, { button1: {
|
|
25
|
+
}) })] }), children, showLoadMore && (_jsx(Flex, { justifyContent: 'center', bg: "lightBlue.2", p: '1rem', children: _jsx(Button, { onClick: handleLoadMore, variant: "primaryFooter", disabled: loadMoreDisabled, children: t('buttons.loadMore') }) }))] }), _jsx(DrawerFooter, { p: "0", zIndex: "overlay", children: _jsx(FooterDrawer, { isOpen: !isDisabled, children: _jsx(FooterButtons, { button1: {
|
|
26
26
|
buttonStyle: 'primaryFooter',
|
|
27
27
|
label: t('buttons.share'),
|
|
28
28
|
onClick: () => onShareContacts(getContactByIds(itemsSelected)),
|
|
@@ -45,7 +45,7 @@ export const HomeBoard = () => {
|
|
|
45
45
|
label: 'Edit Contact',
|
|
46
46
|
handleClick: () => null,
|
|
47
47
|
},
|
|
48
|
-
], onShareContacts: () => null, onDeleteContacts: () => null })),
|
|
48
|
+
], onShareContacts: () => null, onDeleteContacts: () => null, handleLoadMore: () => null, showLoadMore: false, loadMoreDisabled: false })),
|
|
49
49
|
PartnerCatalog: (_jsx(PartnerCatalogPanel, { onClose: onRightClose, onPartnerAdd: () => null, partners: partnerCatalogMock })),
|
|
50
50
|
AddHouseholdItem: (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: handleClose, icon: Painting, title: "Add Household Item" }) }), _jsx(DrawerBody, { children: _jsx(DynamicForm, { form: formFieldsMock }) })] })),
|
|
51
51
|
HomeAssistant: (_jsx(HomeAssistantPanel, { currentStep: homeAssistantCurrentStep, currentForm: currentHomeAssistantForm, onNext: handleHomeAssistantFormChange, onBack: handleHomeAssistantBack, onApplianceClick: () => null, onClose: onRightClose, onSave: () => { }, backDisabled: false, nextDisabled: false, hasCompleted: true, isLoading: false })),
|
|
@@ -6,6 +6,6 @@ import { useLaunchpad } from '../../hooks';
|
|
|
6
6
|
import { videoMock } from '../../mocks';
|
|
7
7
|
export const Launchpad = () => {
|
|
8
8
|
const { activeTour, currentStep, firstName, handleCardClick, handleClose, handleStep, homes, isLeftOpen, isRightOpen, onLeftClose, onLeftOpen, onRightClose, setActiveTour, showOverlay, } = useLaunchpad();
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Box, { w: "full", children: [_jsx(LeftPanel, { children: _jsx(AddHomeContent, { handleSkipClick: onLeftClose, userFirstName: firstName, handleCreateHomeClick: onLeftClose, isFirstHome: false }), isOpen: isLeftOpen, onClose: onLeftClose, overlay: showOverlay }), _jsx(RightPanel, { children: _jsx(CreateDocumentContent, { handleDateRange: homes.handleDateRange, handleSelectHome: homes.handleSelectHome, homes: homes.homes, initialHome: homes.initialHome, onCloseButton: onRightClose }), isOpen: isRightOpen, onClose: onRightClose, size: "lg" }), _jsx(AppBarComponent, { setActiveTour: setActiveTour }), _jsxs(Box, { children: [_jsx(Header, { firstName: firstName }), _jsxs(Flex, { direction: ['column-reverse', 'row'], gap: "base", w: "full", px: [0, 'base'], children: [_jsx(Box, { w: "full", children: _jsx(MyHomes, { handleFilterClick: (_) => null, cardList: HomeCards, cardMenuItems: MenuItems, handleCardClick: handleCardClick, handleNewHomeClick: onLeftOpen, headerMenuItems: MyHomeMenuItems, addImage: () => null, loading: false, loadingId: "" }) }), _jsxs(Stack, { spacing: "base", children: [_jsx(Subscription, { availableStorage: 8, state: "paid", totalStorage: 10, totalUsed: 2 }), _jsx(LaunchpadReceiptAutofiler, { onClick: () => { }, totalReceipts: 5, totalTitle: "To be assigned" })] })] })] })] }), _jsx(LaunchpadTour, { currentStep: currentStep, handleStep: handleStep, handleClose: handleClose, meetStepUrl: videoMock, isActive: activeTour })] }));
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { w: "full", children: [_jsx(LeftPanel, { children: _jsx(AddHomeContent, { handleSkipClick: onLeftClose, userFirstName: firstName, handleCreateHomeClick: onLeftClose, isFirstHome: false }), isOpen: isLeftOpen, onClose: onLeftClose, overlay: showOverlay }), _jsx(RightPanel, { children: _jsx(CreateDocumentContent, { handleDateRange: homes.handleDateRange, handleSelectHome: homes.handleSelectHome, homes: homes.homes, initialHome: homes.initialHome, onCloseButton: onRightClose }), isOpen: isRightOpen, onClose: onRightClose, size: "lg" }), _jsx(AppBarComponent, { setActiveTour: setActiveTour }), _jsxs(Box, { children: [_jsx(Header, { firstName: firstName }), _jsxs(Flex, { direction: ['column-reverse', 'row'], gap: "base", w: "full", px: [0, 'base'], children: [_jsx(Box, { w: "full", children: _jsx(MyHomes, { handleFilterClick: (_) => null, cardList: HomeCards, cardMenuItems: MenuItems, handleCardClick: handleCardClick, handleNewHomeClick: onLeftOpen, headerMenuItems: MyHomeMenuItems, addImage: () => null, loading: false, loadingId: "", handleLoadMore: () => null, showLoadMore: false, loadMoreDisabled: false }) }), _jsxs(Stack, { spacing: "base", children: [_jsx(Subscription, { availableStorage: 8, state: "paid", totalStorage: 10, totalUsed: 2 }), _jsx(LaunchpadReceiptAutofiler, { onClick: () => { }, totalReceipts: 5, totalTitle: "To be assigned" })] })] })] })] }), _jsx(LaunchpadTour, { currentStep: currentStep, handleStep: handleStep, handleClose: handleClose, meetStepUrl: videoMock, isActive: activeTour })] }));
|
|
10
10
|
};
|
|
11
11
|
export default Launchpad;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MyHomesI } from '../../interfaces';
|
|
2
|
-
export declare const MyHomes: ({ cardList, cardMenuItems, handleCardClick, handleFilterClick, handleNewHomeClick, headerMenuItems, addImage, loading, loadingId, }: MyHomesI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const MyHomes: ({ cardList, cardMenuItems, handleCardClick, handleFilterClick, handleNewHomeClick, headerMenuItems, addImage, loading, loadingId, showLoadMore, handleLoadMore, loadMoreDisabled }: MyHomesI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
|
-
import { Box, Container, Wrap, WrapItem } from '@chakra-ui/react';
|
|
3
|
+
import { Box, Container, Wrap, WrapItem, Button, Flex } from '@chakra-ui/react';
|
|
4
4
|
import { MyHomesHeader, MyHomeCard, ContainerHeader, MoreHorizontal, TileTooltip, InviteRolesStep, BaseStep, } from '..';
|
|
5
5
|
import { House } from '../../assets/images';
|
|
6
6
|
import { useState } from 'react';
|
|
7
|
-
export const MyHomes = ({ cardList = [], cardMenuItems = [], handleCardClick, handleFilterClick, handleNewHomeClick, headerMenuItems, addImage, loading, loadingId, }) => {
|
|
7
|
+
export const MyHomes = ({ cardList = [], cardMenuItems = [], handleCardClick, handleFilterClick, handleNewHomeClick, headerMenuItems, addImage, loading, loadingId, showLoadMore, handleLoadMore, loadMoreDisabled }) => {
|
|
8
8
|
const [showChildren, setShowChildren] = useState(false);
|
|
9
9
|
const handleHelpClick = () => setShowChildren(!showChildren);
|
|
10
10
|
return (_jsx(TileTooltip, { label: "myHomes", children: _jsxs(Container, { variant: "launchpad", maxW: "none", pb: "3rem", position: "relative", children: [showChildren && (_jsx(BaseStep, { top: "60px", right: "60px", onClose: handleHelpClick, children: _jsx(InviteRolesStep, {}) })), _jsx(ContainerHeader, { disabled: true, menuItems: headerMenuItems, title: t('myHomes.title'), icon: _jsx(MoreHorizontal, { size: 38 }), titleIcon: House, showHelp: true, onHelpClick: handleHelpClick }), _jsx(MyHomesHeader, { onFilterClick: handleFilterClick, onNewHomeClick: handleNewHomeClick }), _jsx(Wrap, { spacing: "base", px: "base", alignItems: "start", children: cardList.length > 0 &&
|
|
11
11
|
(cardList === null || cardList === void 0 ? void 0 : cardList.map(({ accountType, address, active, _id, image, name }, index) => (_jsx(WrapItem, { children: _jsxs(Container, { w: "179px", position: "relative", transition: "all 0.3s ease-in-out", _hover: {
|
|
12
12
|
boxShadow: 'xl',
|
|
13
|
-
}, id: index === 0 ? 'homeCard' : '', children: [_jsx(ContainerHeader, { menuItems: accountType === "Member" ? [] : cardMenuItems, itemForm: { _id, name }, icon: _jsx(MoreHorizontal, {}), isThin: true, index: index }), _jsx(Box, { w: "179px", textAlign: "left", children: _jsx(MyHomeCard, { accountType: accountType, address: address, image: image, name: name, active: active, _id: _id, index: index, handleCardClick: handleCardClick, addImage: addImage, loading: loading, loadingId: loadingId }) })] }) }, _id)))) })] }) }));
|
|
13
|
+
}, id: index === 0 ? 'homeCard' : '', children: [_jsx(ContainerHeader, { menuItems: accountType === "Member" ? [] : cardMenuItems, itemForm: { _id, name }, icon: _jsx(MoreHorizontal, {}), isThin: true, index: index }), _jsx(Box, { w: "179px", textAlign: "left", children: _jsx(MyHomeCard, { accountType: accountType, address: address, image: image, name: name, active: active, _id: _id, index: index, handleCardClick: handleCardClick, addImage: addImage, loading: loading, loadingId: loadingId }) })] }) }, _id)))) }), showLoadMore && (_jsx(Flex, { justifyContent: 'center', mt: '2rem', children: _jsx(Button, { onClick: handleLoadMore, variant: "primaryFooter", disabled: loadMoreDisabled, children: t('buttons.loadMore') }) }))] }) }));
|
|
14
14
|
};
|
|
@@ -14,6 +14,9 @@ export interface ContactsContentI {
|
|
|
14
14
|
onClick?: (contact: ContactAndIndexForm) => void;
|
|
15
15
|
onDeleteContacts: (contactsIds: string[]) => void;
|
|
16
16
|
onShareContacts: (contacts: InfoContactCardI[]) => void;
|
|
17
|
+
showLoadMore: boolean;
|
|
18
|
+
handleLoadMore: () => void;
|
|
19
|
+
loadMoreDisabled: boolean;
|
|
17
20
|
}
|
|
18
21
|
export interface CardOnContactListI {
|
|
19
22
|
apiError: ContactsContentI['apiError'];
|
|
@@ -47,5 +47,8 @@ export declare const MyHomesComponent: {
|
|
|
47
47
|
loading: boolean;
|
|
48
48
|
loadingId: string;
|
|
49
49
|
handleFilterClick: import("@storybook/addon-actions").HandlerFunction;
|
|
50
|
+
showLoadMore: boolean;
|
|
51
|
+
handleLoadMore: import("@storybook/addon-actions").HandlerFunction;
|
|
52
|
+
loadMoreDisabled: boolean;
|
|
50
53
|
};
|
|
51
54
|
};
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Box,
|
|
10
10
|
Text,
|
|
11
11
|
DrawerFooter,
|
|
12
|
+
Button
|
|
12
13
|
} from '@chakra-ui/react'
|
|
13
14
|
import { Contacts } from '@/assets/images'
|
|
14
15
|
import {
|
|
@@ -42,6 +43,9 @@ export const ContactsContent = ({
|
|
|
42
43
|
onClick,
|
|
43
44
|
onDeleteContacts,
|
|
44
45
|
onShareContacts,
|
|
46
|
+
showLoadMore,
|
|
47
|
+
handleLoadMore,
|
|
48
|
+
loadMoreDisabled
|
|
45
49
|
}: ContactsContentI) => {
|
|
46
50
|
const {
|
|
47
51
|
contactsWithoutFirstOrLastName,
|
|
@@ -155,6 +159,15 @@ export const ContactsContent = ({
|
|
|
155
159
|
</Box>
|
|
156
160
|
</Stack>
|
|
157
161
|
{children}
|
|
162
|
+
{
|
|
163
|
+
showLoadMore && (
|
|
164
|
+
<Flex justifyContent={'center'} bg="lightBlue.2" p={'1rem'}>
|
|
165
|
+
<Button onClick={handleLoadMore} variant={"primaryFooter"} disabled={loadMoreDisabled}>
|
|
166
|
+
{t('buttons.loadMore')}
|
|
167
|
+
</Button>
|
|
168
|
+
</Flex>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
158
171
|
</DrawerBody>
|
|
159
172
|
<DrawerFooter p="0" zIndex="overlay">
|
|
160
173
|
<FooterDrawer isOpen={!isDisabled}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t } from 'i18next'
|
|
2
|
-
import { Box, Container, Wrap, WrapItem } from '@chakra-ui/react'
|
|
2
|
+
import { Box, Container, Wrap, WrapItem, Button, Flex } from '@chakra-ui/react'
|
|
3
3
|
import {
|
|
4
4
|
MyHomesHeader,
|
|
5
5
|
MyHomeCard,
|
|
@@ -23,6 +23,9 @@ export const MyHomes = ({
|
|
|
23
23
|
addImage,
|
|
24
24
|
loading,
|
|
25
25
|
loadingId,
|
|
26
|
+
showLoadMore,
|
|
27
|
+
handleLoadMore,
|
|
28
|
+
loadMoreDisabled
|
|
26
29
|
}: MyHomesI) => {
|
|
27
30
|
const [showChildren, setShowChildren] = useState(false)
|
|
28
31
|
const handleHelpClick = () => setShowChildren(!showChildren)
|
|
@@ -88,6 +91,15 @@ export const MyHomes = ({
|
|
|
88
91
|
)
|
|
89
92
|
)}
|
|
90
93
|
</Wrap>
|
|
94
|
+
{
|
|
95
|
+
showLoadMore && (
|
|
96
|
+
<Flex justifyContent={'center'} mt={'2rem'}>
|
|
97
|
+
<Button onClick={handleLoadMore} variant={"primaryFooter"} disabled={loadMoreDisabled}>
|
|
98
|
+
{t('buttons.loadMore')}
|
|
99
|
+
</Button>
|
|
100
|
+
</Flex>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
91
103
|
</Container>
|
|
92
104
|
</TileTooltip>
|
|
93
105
|
)
|
|
@@ -14,6 +14,9 @@ export interface ContactsContentI {
|
|
|
14
14
|
onClick?: (contact: ContactAndIndexForm) => void
|
|
15
15
|
onDeleteContacts: (contactsIds: string[]) => void
|
|
16
16
|
onShareContacts: (contacts: InfoContactCardI[]) => void
|
|
17
|
+
showLoadMore: boolean
|
|
18
|
+
handleLoadMore: () => void
|
|
19
|
+
loadMoreDisabled: boolean
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export interface CardOnContactListI {
|