@homefile/components-v2 2.39.15 → 2.39.17
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,5 +4,5 @@ import { randomColor } from '../../../utils';
|
|
|
4
4
|
export const PersonalInfoCard = ({ email, firstName, index, lastName, phone, title, }) => {
|
|
5
5
|
const name = `${firstName} ${lastName}`.trim();
|
|
6
6
|
const initials = firstName.charAt(0) + lastName.charAt(0);
|
|
7
|
-
return (_jsxs(Flex, { gap: "base", minH: "50px", align: "center", children: [_jsx(Center, { h: "78px", w: "78px", bg: randomColor(index), children: _jsx(Text, { fontSize: "35px", fontWeight: "bold", color: "neutral.white", children: initials }) }), _jsxs(Box, { children: [_jsx(Text, { fontWeight: "semibold", fontSize: "22px", lineHeight: "24px", children: name }), _jsxs(Box, { children: [_jsx(Text, { fontSize: "sm", lineHeight: "18px", fontFamily: "secondary", children: title }), _jsx(Text, { fontSize: "sm", lineHeight: "18px", fontFamily: "secondary", children: phone }), _jsx(Text, { variant: "email", lineHeight: "18px", fontSize: "sm", children: email })] })] })] }));
|
|
7
|
+
return (_jsxs(Flex, { gap: "base", minH: "50px", align: "center", children: [initials && (_jsx(Center, { h: "78px", w: "78px", bg: randomColor(index), children: _jsx(Text, { fontSize: "35px", fontWeight: "bold", color: "neutral.white", children: initials }) })), _jsxs(Box, { children: [_jsx(Text, { fontWeight: "semibold", fontSize: "22px", lineHeight: "24px", children: name }), _jsxs(Box, { children: [_jsx(Text, { fontSize: "sm", lineHeight: "18px", fontFamily: "secondary", children: title }), _jsx(Text, { fontSize: "sm", lineHeight: "18px", fontFamily: "secondary", children: phone }), _jsx(Text, { variant: "email", lineHeight: "18px", fontSize: "sm", children: email })] })] })] }));
|
|
8
8
|
};
|
|
@@ -5,7 +5,10 @@ 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
|
+
const hasContactInfo = (contact === null || contact === void 0 ? void 0 : contact.companyInfo) &&
|
|
9
|
+
Object.values(contact.companyInfo).some((value) => (typeof value === 'string' && value.trim() !== '') ||
|
|
10
|
+
(typeof value === 'number' && value > 0));
|
|
8
11
|
if (!contact)
|
|
9
12
|
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 &&
|
|
13
|
+
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 && hasContactInfo && (_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 })] }))] }) }) })] })] }));
|
|
11
14
|
};
|