@homefile/components-v2 2.38.13 → 2.38.14

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.
@@ -1,2 +1,2 @@
1
1
  import { HomeCardWithRecipentI } from '../../interfaces';
2
- export declare const HomeCardWithRecipent: ({ address: { city, state, street, number, zip }, addImage, externalLink, handleEdit, handleDeleteAccountType, handleSubmitAccountType, image, _id, loading, menu, name, onAddRecords, onViewDetails, panelSize, recipients, records, disabled, propertyDisabled }: HomeCardWithRecipentI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const HomeCardWithRecipent: ({ address: { city, state, street, number, zip }, addImage, externalLink, handleEdit, handleDeleteAccountType, handleSubmitAccountType, image, _id, loading, menu, name, onAddRecords, onViewDetails, panelSize, recipients, records, disabled, propertyDisabled, }: HomeCardWithRecipentI) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { t } from 'i18next';
3
3
  import { Container } from '@chakra-ui/react';
4
4
  import { HomeCard, EditAccountType, RightPanel, HomeCardRecipients, TabsHeader, HomeCardRecords, } from '../../components';
5
5
  import { useHomeCardWithRecipent } from '../../hooks';
6
- export const HomeCardWithRecipent = ({ address: { city, state, street, number = '', zip }, addImage, externalLink, handleEdit, handleDeleteAccountType, handleSubmitAccountType, image, _id, loading = false, menu, name, onAddRecords, onViewDetails, panelSize = 'md', recipients, records = {}, disabled, propertyDisabled }) => {
6
+ export const HomeCardWithRecipent = ({ address: { city, state, street, number = '', zip }, addImage, externalLink, handleEdit, handleDeleteAccountType, handleSubmitAccountType, image, _id, loading = false, menu, name, onAddRecords, onViewDetails, panelSize = 'md', recipients, records = {}, disabled, propertyDisabled, }) => {
7
7
  const { isRightOpen, onRightClose, editingAccountType, handleEditAccountType, } = useHomeCardWithRecipent();
8
8
  const tabs = [
9
9
  {
@@ -19,7 +19,7 @@ export const HomeCardWithRecipent = ({ address: { city, state, street, number =
19
19
  {
20
20
  label: t('homeBoard.tabs.tab2'),
21
21
  component: (_jsx(HomeCardRecipients, { recipients: recipients, menu: menu, onEditClick: handleEditAccountType })),
22
- }
22
+ },
23
23
  ];
24
- return (_jsxs(Container, { variant: "launchpad", children: [_jsx(HomeCard, { city: city, externalLink: externalLink, imageUrl: image, name: name, number: number, street: street, state: state, zip: zip, handleEditClick: () => handleEdit(_id), addImage: addImage, loading: loading, edit: !disabled }), _jsx(TabsHeader, { tabList: propertyDisabled ? noPropertyTabs : tabs }), (handleDeleteAccountType && handleSubmitAccountType) && (_jsx(RightPanel, { isOpen: isRightOpen, onClose: onRightClose, size: panelSize, children: _jsx(EditAccountType, { associateAccount: editingAccountType, handleClose: onRightClose, handleDelete: handleDeleteAccountType, handleSubmit: handleSubmitAccountType, isLoading: loading }) }))] }));
24
+ return (_jsxs(Container, { variant: "launchpad", children: [_jsx(HomeCard, { city: city, externalLink: externalLink, imageUrl: image, name: name, number: number, street: street, state: state, zip: zip, handleEditClick: () => handleEdit(_id), addImage: addImage, loading: loading, edit: false }), _jsx(TabsHeader, { tabList: propertyDisabled ? noPropertyTabs : tabs }), handleDeleteAccountType && handleSubmitAccountType && (_jsx(RightPanel, { isOpen: isRightOpen, onClose: onRightClose, size: panelSize, children: _jsx(EditAccountType, { associateAccount: editingAccountType, handleClose: onRightClose, handleDelete: handleDeleteAccountType, handleSubmit: handleSubmitAccountType, isLoading: loading }) }))] }));
25
25
  };
@@ -1,2 +1,2 @@
1
1
  import { MyHomeCardI } from '../../interfaces';
2
- export declare const MyHomeCard: ({ accountType, address: { city, state, street, number, zip }, externalLink, image, index, name, handleCardClick, _id, addImage, loading, loadingId, }: MyHomeCardI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MyHomeCard: ({ accountType, address: { city, state, street, number, zip }, externalLink, editImage, image, index, name, handleCardClick, _id, addImage, loading, loadingId, }: MyHomeCardI) => import("react/jsx-runtime").JSX.Element;
@@ -5,11 +5,11 @@ import { BeatLoader } from 'react-spinners';
5
5
  import { Link, EditFileUploader, TextBadge } from '../../components';
6
6
  import { useMyHomeCard } from '../../hooks';
7
7
  import { randomImages } from '../../utils';
8
- export const MyHomeCard = ({ accountType, address: { city, state, street, number = '', zip }, externalLink, image, index, name, handleCardClick, _id, addImage, loading, loadingId, }) => {
8
+ export const MyHomeCard = ({ accountType, address: { city, state, street, number = '', zip }, externalLink, editImage = true, image, index, name, handleCardClick, _id, addImage, loading, loadingId, }) => {
9
9
  const { imageUrl, minHeight, minWidth, type } = useMyHomeCard({
10
10
  accountType,
11
11
  image,
12
12
  });
13
13
  const isLoading = loading && loadingId === _id;
14
- return (_jsxs(_Fragment, { children: [_jsx(Box, { position: "absolute", left: "-1", top: "-1", id: index === 0 ? 'role' : '', children: type && (_jsx(TextBadge, { bgColor: type === null || type === void 0 ? void 0 : type.bg, text: accountType, width: type === null || type === void 0 ? void 0 : type.width })) }), _jsxs(Center, { pos: "relative", h: "8rem", bg: "lightBlue.2", overflow: "hidden", w: "full", children: [isLoading && (_jsx(Center, { h: "8rem", children: _jsx(BeatLoader, { color: "gray", size: 8 }) })), !isLoading && (_jsxs(_Fragment, { children: [accountType !== "Member" && (_jsx(EditFileUploader, { handleInputChange: (event) => addImage({ event, _id }), "aria-label": t('ariaLabels.edit'), position: "absolute", right: "2", top: "1", id: index === 0 ? 'homePicture' : '' })), _jsx(Image, { src: ((image === null || image === void 0 ? void 0 : image.bucketName) && imageUrl) || randomImages(0), alt: `${name} ${t('images.altImage')}`, objectFit: "cover", minH: minHeight, minW: minWidth, onClick: () => handleCardClick({ _id, name }), cursor: "pointer" })] }))] }), _jsx(Tooltip, { label: t('tooltips.viewHome'), children: _jsx(Stack, { children: _jsxs(Stack, { id: index === 0 ? 'viewHome' : '', bg: "neutral.white", px: "2", py: "4", children: [_jsxs(Flex, { align: "center", gap: "1", children: [_jsx(Box, { as: "button", onClick: () => handleCardClick({ _id, name }), children: _jsx(Text, { textOverflow: "ellipsis", noOfLines: 1, textAlign: "left", textTransform: "uppercase", children: name }) }), externalLink && (_jsx(Tooltip, { label: externalLink, fontSize: "small", children: _jsx(Center, { cursor: "pointer", children: _jsx(Link, { size: 22 }) }) }))] }), _jsxs(Box, { lineHeight: "1.2", as: "button", onClick: () => handleCardClick({ _id, name }), textAlign: "left", children: [_jsx(Text, { isTruncated: true, variant: "home", children: `${number} ${street}` }), _jsxs(Flex, { gap: "1", children: [_jsx(Text, { isTruncated: true, variant: "home", children: `${city},` }), _jsx(Text, { isTruncated: true, variant: "home", children: state })] }), _jsx(Text, { variant: "home", children: zip })] })] }) }) })] }));
14
+ return (_jsxs(_Fragment, { children: [_jsx(Box, { position: "absolute", left: "-1", top: "-1", id: index === 0 ? 'role' : '', children: type && (_jsx(TextBadge, { bgColor: type === null || type === void 0 ? void 0 : type.bg, text: accountType, width: type === null || type === void 0 ? void 0 : type.width })) }), _jsxs(Center, { pos: "relative", h: "8rem", bg: "lightBlue.2", overflow: "hidden", w: "full", children: [isLoading && (_jsx(Center, { h: "8rem", children: _jsx(BeatLoader, { color: "gray", size: 8 }) })), !isLoading && (_jsxs(_Fragment, { children: [accountType !== 'Member' && editImage && (_jsx(EditFileUploader, { handleInputChange: (event) => addImage({ event, _id }), "aria-label": t('ariaLabels.edit'), position: "absolute", right: "2", top: "1", id: index === 0 ? 'homePicture' : '' })), _jsx(Image, { src: ((image === null || image === void 0 ? void 0 : image.bucketName) && imageUrl) || randomImages(0), alt: `${name} ${t('images.altImage')}`, objectFit: "cover", minH: minHeight, minW: minWidth, onClick: () => handleCardClick({ _id, name }), cursor: "pointer" })] }))] }), _jsx(Tooltip, { label: t('tooltips.viewHome'), children: _jsx(Stack, { children: _jsxs(Stack, { id: index === 0 ? 'viewHome' : '', bg: "neutral.white", px: "2", py: "4", children: [_jsxs(Flex, { align: "center", gap: "1", children: [_jsx(Box, { as: "button", onClick: () => handleCardClick({ _id, name }), children: _jsx(Text, { textOverflow: "ellipsis", noOfLines: 1, textAlign: "left", textTransform: "uppercase", children: name }) }), externalLink && (_jsx(Tooltip, { label: externalLink, fontSize: "small", children: _jsx(Center, { cursor: "pointer", children: _jsx(Link, { size: 22 }) }) }))] }), _jsxs(Box, { lineHeight: "1.2", as: "button", onClick: () => handleCardClick({ _id, name }), textAlign: "left", children: [_jsx(Text, { isTruncated: true, variant: "home", children: `${number} ${street}` }), _jsxs(Flex, { gap: "1", children: [_jsx(Text, { isTruncated: true, variant: "home", children: `${city},` }), _jsx(Text, { isTruncated: true, variant: "home", children: state })] }), _jsx(Text, { variant: "home", children: zip })] })] }) }) })] }));
15
15
  };
@@ -10,5 +10,5 @@ export const MyHomes = ({ cardList = [], cardMenuItems = [], handleCardClick, ha
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, { size: 32 }), 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') }) }))] }) }));
13
+ }, id: index === 0 ? 'homeCard' : '', children: [_jsx(ContainerHeader, { menuItems: accountType === 'Member' ? [] : cardMenuItems, itemForm: { _id, name }, icon: _jsx(MoreHorizontal, { size: 32 }), 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, editImage: false }) })] }) }, _id)))) }), showLoadMore && (_jsx(Flex, { justifyContent: 'center', mt: '2rem', children: _jsx(Button, { onClick: handleLoadMore, variant: 'primaryFooter', disabled: loadMoreDisabled, children: t('buttons.loadMore') }) }))] }) }));
14
14
  };
@@ -18,6 +18,7 @@ export interface MyHomeCardI {
18
18
  accountType?: string;
19
19
  active?: boolean;
20
20
  address: HomeAddressI;
21
+ editImage?: boolean;
21
22
  externalLink?: string;
22
23
  _id: string;
23
24
  index?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.38.13",
3
+ "version": "2.38.14",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",