@homefile/components-v2 2.39.13 → 2.39.15

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.
@@ -3,5 +3,5 @@ import { Flex, IconButton } from '@chakra-ui/react';
3
3
  import { ShareIcon, MoreHorizontal, IconMenu, Edit, DuplicateIcon, } from '../../components';
4
4
  export const ContactHeaderMenu = ({ contact, menuItems, onShare, onEdit, onDuplicate, }) => {
5
5
  const hasMenuItems = Boolean(menuItems && menuItems.length > 0);
6
- return (_jsxs(Flex, { align: "center", position: "relative", gap: "base", children: [_jsx(IconButton, { "aria-label": "share", variant: "menuIcon", icon: _jsx(ShareIcon, { size: 18 }), onClick: onShare, w: "fit-content" }), _jsx(IconButton, { "aria-label": "duplicate", variant: "menuIcon", icon: _jsx(DuplicateIcon, { size: 19 }), onClick: onDuplicate, w: "fit-content" }), _jsx(IconButton, { "aria-label": "edit", variant: "menuIcon", icon: _jsx(Edit, { size: 18, strokeWidth: 1.5 }), onClick: onEdit, w: "fit-content" }), hasMenuItems && (_jsx(IconMenu, { icon: _jsx(MoreHorizontal, { size: 32 }), itemForm: contact, menuItems: menuItems, disabled: Number(menuItems === null || menuItems === void 0 ? void 0 : menuItems.length) < 1 }))] }));
6
+ return (_jsxs(Flex, { align: "center", position: "relative", gap: "base", children: [onShare && (_jsx(IconButton, { "aria-label": "share", variant: "menuIcon", icon: _jsx(ShareIcon, { size: 18 }), onClick: onShare, w: "fit-content" })), onDuplicate && (_jsx(IconButton, { "aria-label": "duplicate", variant: "menuIcon", icon: _jsx(DuplicateIcon, { size: 19 }), onClick: onDuplicate, w: "fit-content" })), onEdit && (_jsx(IconButton, { "aria-label": "edit", variant: "menuIcon", icon: _jsx(Edit, { size: 18, strokeWidth: 1.5 }), onClick: onEdit, w: "fit-content" })), hasMenuItems && (_jsx(IconMenu, { icon: _jsx(MoreHorizontal, { size: 32 }), itemForm: contact, menuItems: menuItems, disabled: Number(menuItems === null || menuItems === void 0 ? void 0 : menuItems.length) < 1 }))] }));
7
7
  };
@@ -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 === null || contact === void 0 ? void 0 : contact.companyInfo))
7
+ if (!(contact === null || contact === void 0 ? void 0 : contact.companyInfo) || Object.keys(contact.companyInfo).length === 0)
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 })] })] })] })] }));
@@ -35,12 +35,12 @@ export const GroupCard = (_a) => {
35
35
  const brand = receipt
36
36
  ? ''
37
37
  : ((_a = report === null || report === void 0 ? void 0 : report.find((doc) => { var _a; return (_a = doc === null || doc === void 0 ? void 0 : doc.name) === null || _a === void 0 ? void 0 : _a.includes('Brand'); })) === null || _a === void 0 ? void 0 : _a.value) || '';
38
- const hasImage = images.length > 0 || defaultImage;
39
- const imageUrl = `${storageUrl}/${(_b = images[0]) === null || _b === void 0 ? void 0 : _b.bucketName}/${(_c = images[0]) === null || _c === void 0 ? void 0 : _c.fileName}.${(_d = images[0]) === null || _d === void 0 ? void 0 : _d.extension}` || defaultImage;
38
+ const hasImage = images.length > 0;
39
+ const imageUrl = hasImage ? `${storageUrl}/${(_b = images[0]) === null || _b === void 0 ? void 0 : _b.bucketName}/${(_c = images[0]) === null || _c === void 0 ? void 0 : _c.fileName}.${(_d = images[0]) === null || _d === void 0 ? void 0 : _d.extension}` : defaultImage;
40
40
  const storeImage = (metadata === null || metadata === void 0 ? void 0 : metadata.origin)
41
41
  ? getReceiptOrigin(metadata === null || metadata === void 0 ? void 0 : metadata.origin)
42
42
  : '';
43
- const existingImage = hasImage ? imageUrl : storeImage;
43
+ const existingImage = (hasImage || imageUrl !== undefined) ? imageUrl : storeImage;
44
44
  const groupImage = GroupIcons[groupTitle] || Group;
45
45
  const handleImage = (files) => {
46
46
  if (files) {
@@ -97,13 +97,13 @@ export const PaintItems = [
97
97
  reviewed: false,
98
98
  defaultImage: "https://storage.googleapis.com/homefile-images/range.png",
99
99
  images: [
100
- // {
101
- // bucketName: 'homefile-images',
102
- // description: '',
103
- // extension: 'jpeg',
104
- // fileName: 'test-consult.jpeg-db224d',
105
- // _id: '62aa4c6db225dd3957d09b24',
106
- // },
100
+ {
101
+ bucketName: 'homefile-images',
102
+ description: '',
103
+ extension: 'jpeg',
104
+ fileName: 'test-consult.jpeg-db224d',
105
+ _id: '62aa4c6db225dd3957d09b24',
106
+ },
107
107
  ],
108
108
  status: 'completed',
109
109
  deleted: false,
@@ -138,6 +138,7 @@ export const PaintItems = [
138
138
  user: '62388ab2a1a4a98e69942bb5',
139
139
  home: '62a20af1cc6d1000ef17c7d0',
140
140
  title: 'Cabinets-Bottom',
141
+ defaultImage: "https://storage.googleapis.com/homefile-images/freezer.png",
141
142
  report: [
142
143
  {
143
144
  id: faker.database.mongodbObjectId(),
@@ -262,6 +263,7 @@ export const PaintItems = [
262
263
  user: '62b3c96892d0bad2cc64c327',
263
264
  home: '62b3cc68061c02d53850ddb6',
264
265
  title: 'Cabinets-inside',
266
+ defaultImage: "https://storage.googleapis.com/homefile-images/fridge.png",
265
267
  description: '',
266
268
  report: [
267
269
  {
@@ -371,6 +373,7 @@ export const PaintItems = [
371
373
  user: '62b3c96892d0bad2cc64c327',
372
374
  home: '62b3cc68061c02d53850ddb6',
373
375
  title: 'Cabinets-inside',
376
+ defaultImage: "https://storage.googleapis.com/homefile-images/microwave.png",
374
377
  description: '',
375
378
  report: [
376
379
  {
@@ -477,6 +480,7 @@ export const PaintItems = [
477
480
  user: '62b3c96892d0bad2cc64c327',
478
481
  home: '62b3cc68061c02d53850ddb6',
479
482
  title: 'Cabinets-inside',
483
+ defaultImage: "https://storage.googleapis.com/homefile-images/cook-top.png",
480
484
  description: '',
481
485
  report: [
482
486
  {
@@ -582,6 +586,7 @@ export const PaintItems = [
582
586
  _id: '62b49071061c02d53850dec6',
583
587
  user: '62b3c96892d0bad2cc64c327',
584
588
  home: '62b3cc68061c02d53850ddb6',
589
+ defaultImage: "https://storage.googleapis.com/homefile-images/tank-waterhtr.png",
585
590
  title: 'Cabinets-inside',
586
591
  description: '',
587
592
  report: [
@@ -689,6 +694,7 @@ export const PaintItems = [
689
694
  user: '62b3c96892d0bad2cc64c327',
690
695
  home: '62b3cc68061c02d53850ddb6',
691
696
  title: 'Cabinets-inside',
697
+ defaultImage: "https://storage.googleapis.com/homefile-images/hood.png",
692
698
  description: '',
693
699
  report: [
694
700
  {
@@ -794,6 +800,7 @@ export const PaintItems = [
794
800
  _id: '62b49071061c02d53850dec8',
795
801
  user: '62b3c96892d0bad2cc64c327',
796
802
  home: '62b3cc68061c02d53850ddb6',
803
+ defaultImage: "https://storage.googleapis.com/homefile-images/washer.png",
797
804
  title: 'Cabinets-inside',
798
805
  description: '',
799
806
  report: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.39.13",
3
+ "version": "2.39.15",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",