@homefile/components-v2 2.39.26 → 2.39.27

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.
@@ -174,7 +174,8 @@
174
174
  },
175
175
  "rating": "Homeowner Rating",
176
176
  "recipient": "recipient",
177
- "title": "Contacts"
177
+ "title": "Contacts",
178
+ "noContacts": "You currently have no contacts. To add new contacts, click the Add Contact button."
178
179
  },
179
180
  "counter": {
180
181
  "of": "of",
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { t } from 'i18next';
3
3
  import { DrawerContent, DrawerHeader, DrawerBody, Flex, Stack, Checkbox, Box, Text, DrawerFooter, Button, } from '@chakra-ui/react';
4
4
  import { Contacts } from '../../assets/images';
@@ -13,16 +13,17 @@ export const ContactsContent = ({ apiError, contacts, menuItems, handleClose, ch
13
13
  const { windowDimensions: { width }, } = useWindowDimensions();
14
14
  const maxW = width > 413 ? '16rem' : '10rem';
15
15
  const isDisabled = Number(itemsSelected.length) === 0 || disabled;
16
- 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) => {
17
- const showLetterDivider = idx !== 0;
18
- return (_jsxs(Stack, { spacing: "0", children: [showLetterDivider && _jsx(LetterDivider, { letter: letter }), _jsx(Stack, { spacing: "2px", children: splittedContacts[letter].map((contact, idx) => {
19
- const selected = isItemSelected(contact._id);
20
- return (_jsx(Card, { apiError: apiError, contact: contact, onClick: onClick, index: idx, menuItems: menuItems, selected: selected, onChange: handleItemSelect, onShareContact: (contact) => onShareContacts([contact]) }, contact._id));
21
- }) })] }, letter));
22
- }) }), Number(contactsWithoutFirstOrLastName.length) > 0 && (_jsx(LetterDivider, { letter: "Others" })), _jsx(Box, { children: contactsWithoutFirstOrLastName.map((contact, idx) => {
23
- const selected = isItemSelected(contact._id);
24
- return (_jsx(Card, { apiError: apiError, contact: contact, onClick: onClick, index: idx, menuItems: menuItems, selected: selected, onChange: handleItemSelect, onShareContact: (contact) => onShareContacts([contact]) }, contact._id));
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: {
16
+ const hasContacts = contacts.length > 0;
17
+ 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: [!hasContacts && (_jsx(Stack, { bg: "lightBlue.2", h: '100%', children: _jsx(Box, { px: "base", py: "6", bg: "lightBlue.1", children: _jsx(Text, { fontFamily: "secondary", children: t('contacts.noContacts') }) }) })), hasContacts && (_jsxs(_Fragment, { 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) => {
18
+ const showLetterDivider = idx !== 0;
19
+ return (_jsxs(Stack, { spacing: "0", children: [showLetterDivider && _jsx(LetterDivider, { letter: letter }), _jsx(Stack, { spacing: "2px", children: splittedContacts[letter].map((contact, idx) => {
20
+ const selected = isItemSelected(contact._id);
21
+ return (_jsx(Card, { apiError: apiError, contact: contact, onClick: onClick, index: idx, menuItems: menuItems, selected: selected, onChange: handleItemSelect, onShareContact: (contact) => onShareContacts([contact]) }, contact._id));
22
+ }) })] }, letter));
23
+ }) }), Number(contactsWithoutFirstOrLastName.length) > 0 && (_jsx(LetterDivider, { letter: "Others" })), _jsx(Box, { children: contactsWithoutFirstOrLastName.map((contact, idx) => {
24
+ const selected = isItemSelected(contact._id);
25
+ return (_jsx(Card, { apiError: apiError, contact: contact, onClick: onClick, index: idx, menuItems: menuItems, selected: selected, onChange: handleItemSelect, onShareContact: (contact) => onShareContacts([contact]) }, contact._id));
26
+ }) })] }), 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
27
  buttonStyle: 'primaryFooter',
27
28
  label: t('buttons.share'),
28
29
  onClick: () => onShareContacts(getContactByIds(itemsSelected)),
@@ -9,6 +9,7 @@ export default {
9
9
  component: ContactsContent,
10
10
  args: {
11
11
  onClick: action('onClick'),
12
+ // contacts: [],
12
13
  contacts: ContactsMock,
13
14
  menuItems: menuMock,
14
15
  showLoadMore: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.39.26",
3
+ "version": "2.39.27",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",