@homefile/components-v2 2.8.12 → 2.8.13

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.
@@ -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
- const isDisabled = Number(itemsSelected.length) === 0;
15
+ const isDisabled = Number(itemsSelected.length) === 0 || disabled;
16
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
17
  const showLetterDivider = idx !== 0;
18
18
  return (_jsxs(Stack, { spacing: "0", children: [showLetterDivider && _jsx(LetterDivider, { letter: letter }), _jsx(Stack, { spacing: "2px", children: splittedContacts[letter].map((contact, idx) => {
@@ -22,15 +22,13 @@ 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: true, children: _jsx(FooterButtons, { button1: {
25
+ }) })] }), children] }), _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
- isDisabled,
29
28
  onClick: () => onShareContacts(getContactByIds(itemsSelected)),
30
29
  }, button2: {
31
30
  buttonStyle: 'secondaryFooter',
32
31
  label: t('buttons.delete'),
33
- isDisabled,
34
32
  onClick: () => onDeleteContacts(itemsSelected),
35
33
  } }) }) })] }));
36
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.8.12",
3
+ "version": "2.8.13",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -66,7 +66,7 @@ export const ContactsContent = ({
66
66
  } = useWindowDimensions()
67
67
 
68
68
  const maxW = width > 413 ? '16rem' : '10rem'
69
- const isDisabled = Number(itemsSelected.length) === 0
69
+ const isDisabled = Number(itemsSelected.length) === 0 || disabled
70
70
 
71
71
  return (
72
72
  <DrawerContent bg="lightBlue.1">
@@ -157,18 +157,16 @@ export const ContactsContent = ({
157
157
  {children}
158
158
  </DrawerBody>
159
159
  <DrawerFooter p="0" zIndex="overlay">
160
- <FooterDrawer isOpen>
160
+ <FooterDrawer isOpen={!isDisabled}>
161
161
  <FooterButtons
162
162
  button1={{
163
163
  buttonStyle: 'primaryFooter',
164
164
  label: t('buttons.share'),
165
- isDisabled,
166
165
  onClick: () => onShareContacts(getContactByIds(itemsSelected)),
167
166
  }}
168
167
  button2={{
169
168
  buttonStyle: 'secondaryFooter',
170
169
  label: t('buttons.delete'),
171
- isDisabled,
172
170
  onClick: () => onDeleteContacts(itemsSelected),
173
171
  }}
174
172
  />