@homefile/components-v2 2.39.11 → 2.39.12

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.
@@ -4,7 +4,7 @@ import { Box, Center, Flex, Stack, Text, Image } from '@chakra-ui/react';
4
4
  import { CompanyRating } from './CompanyRating';
5
5
  import { AddressInfo } from './AddressInfo';
6
6
  export const CompanyInfoCard = ({ contact, }) => {
7
- if (!contact.companyInfo)
7
+ if (!(contact === null || contact === void 0 ? void 0 : contact.companyInfo))
8
8
  return null;
9
9
  const { company, phone, url, address, city, state, zip, logoUrl } = contact.companyInfo;
10
10
  return (_jsxs(Box, { position: "relative", children: [_jsx(CompanyRating, { contact: contact, position: "absolute", top: "0", right: "0", zIndex: "1" }), _jsxs(Stack, { spacing: "base", children: [_jsx(Text, { textTransform: "uppercase", fontSize: "xs", children: t('contacts.companyInfo') }), _jsxs(Flex, { gap: "base", minH: "50px", children: [logoUrl && (_jsx(Center, { boxSize: "78px", overflow: "hidden", border: "1px", borderColor: "lightBlue.6", children: _jsx(Image, { src: logoUrl, alt: "company logo", objectFit: "cover", boxSize: "100%" }) })), _jsxs(Stack, { spacing: "6", children: [_jsxs(Box, { children: [_jsx(Text, { fontWeight: "bold", fontSize: "18px", lineHeight: "27px", children: company }), _jsxs(Box, { children: [_jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "18px", children: phone }), _jsx(Text, { variant: "email", lineHeight: "18px", fontSize: "sm", children: url })] })] }), _jsx(AddressInfo, { address: address, city: city, state: state, zip: zip })] })] })] })] }));
@@ -17,7 +17,7 @@ import { colors } from '../../../theme/colors';
17
17
  export const CompanyRating = (_a) => {
18
18
  var _b;
19
19
  var { contact } = _a, props = __rest(_a, ["contact"]);
20
- if (!((_b = contact.companyInfo) === null || _b === void 0 ? void 0 : _b.rating))
20
+ if (!((_b = contact === null || contact === void 0 ? void 0 : contact.companyInfo) === null || _b === void 0 ? void 0 : _b.rating))
21
21
  return null;
22
22
  const { rating, _id } = contact.companyInfo;
23
23
  return (_jsxs(Stack, Object.assign({ spacing: "0", align: "end" }, props, { children: [_jsx(Text, { textTransform: "uppercase", fontSize: "10px", children: t('contacts.rating') }), _jsx(Flex, { align: "center", gap: "1", children: Array.from({ length: 5 }).map((_, index) => {
@@ -5,5 +5,7 @@ import { Contacts } from '../../../assets/images';
5
5
  import { CompanyInfoCard, ContactAddressCard, ContactNotes, PanelHeader, RoleTag, PersonalInfoCard, ViewContactHeader, } from '../../../components';
6
6
  export const ViewContactPanel = ({ contact, menuItems, handleClose, onShare, onEdit, onDuplicate, roleType, }) => {
7
7
  const isHomeowner = roleType === 'homeowner';
8
- return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: handleClose, icon: Contacts, title: t('contacts.contactView') }) }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", position: "relative", children: [_jsx(RoleTag, { roleType: roleType }), _jsx(Stack, { px: "base", spacing: "base", children: _jsx(Container, { mt: "36px", p: "base", borderRadius: "lg", children: _jsxs(Stack, { spacing: "4", children: [_jsx(ViewContactHeader, { contact: contact, menuItems: menuItems, onShare: onShare, onEdit: onEdit, onDuplicate: onDuplicate }), _jsx(PersonalInfoCard, Object.assign({}, contact, { index: 0 })), isHomeowner && (_jsxs(_Fragment, { children: [_jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(ContactAddressCard, { contact: contact })] })), !isHomeowner && (_jsxs(_Fragment, { children: [_jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(CompanyInfoCard, { contact: contact }), _jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(ContactNotes, { notes: contact.notes })] }))] }) }) })] })] }));
8
+ if (!contact)
9
+ return (_jsx(DrawerContent, { bg: "lightBlue.1", children: _jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: handleClose, icon: Contacts, title: t('contacts.contactView') }) }) }));
10
+ return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: handleClose, icon: Contacts, title: t('contacts.contactView') }) }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", position: "relative", children: [_jsx(RoleTag, { roleType: roleType }), _jsx(Stack, { px: "base", spacing: "base", children: _jsx(Container, { mt: "36px", p: "base", borderRadius: "lg", children: _jsxs(Stack, { spacing: "4", children: [_jsx(ViewContactHeader, { contact: contact, menuItems: menuItems, onShare: onShare, onEdit: onEdit, onDuplicate: onDuplicate }), _jsx(PersonalInfoCard, Object.assign({}, contact, { index: 0 })), isHomeowner && contact && (_jsxs(_Fragment, { children: [_jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(ContactAddressCard, { contact: contact })] })), !isHomeowner && (contact === null || contact === void 0 ? void 0 : contact.companyInfo) && (_jsxs(_Fragment, { children: [_jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(CompanyInfoCard, { contact: contact }), _jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(ContactNotes, { notes: contact.notes })] }))] }) }) })] })] }));
9
11
  };
@@ -1,11 +1,11 @@
1
1
  import { RoleType } from '../../helpers';
2
2
  import { InfoContactCardI, MenuItemI } from '../../interfaces';
3
3
  export interface ViewContactPanelI {
4
- contact: InfoContactCardI;
4
+ contact: InfoContactCardI | null;
5
5
  handleClose: () => void;
6
- menuItems: MenuItemI[];
7
- onShare: () => void;
6
+ menuItems?: MenuItemI[];
7
+ onShare?: () => void;
8
8
  onEdit?: () => void;
9
9
  onDuplicate?: () => void;
10
- roleType: RoleType;
10
+ roleType?: RoleType;
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.39.11",
3
+ "version": "2.39.12",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",