@homefile/components-v2 2.39.16 → 2.39.18
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
|
};
|
|
@@ -22,7 +22,7 @@ export const GroupCard = (_a) => {
|
|
|
22
22
|
var { items, menuItems, onAddItem, onAddImage, onClickDelete, onClickDetails, title, totalAmount, disabled, itemsDisabled } = _a, props = __rest(_a, ["items", "menuItems", "onAddItem", "onAddImage", "onClickDelete", "onClickDetails", "title", "totalAmount", "disabled", "itemsDisabled"]);
|
|
23
23
|
const { filteredResults, handleAddItem, handleChange, isItemsEmpty, searchValue, totalAmountFormatted, } = useGroupCard({ items, onAddItem, title, totalAmount });
|
|
24
24
|
const groupTitle = title;
|
|
25
|
-
return (_jsx(TileTooltip, { label: title, children: _jsxs(Box, { backgroundColor: "lightBlue.1", boxShadow: "base", w: "100%", children: [_jsx(GroupCardHeader, { menuItems: menuItems, title: title, totalAmount: totalAmountFormatted }), _jsxs(Flex, { justify: items.length >= 10 ? 'space-between' : 'flex-end', pl: "base", my: "base", align: "center", gap: "base", children: [items.length >= 10 && (_jsx(SearchInput, { value: searchValue, onChange: handleChange })), _jsx(LeftButtonAnimated, { onClick: handleAddItem, label: t('addHomeItem.btnLabel'), disabled: disabled, id: "addingItems" })] }), _jsxs(Box, { pb: "10", px: "base", children: [isItemsEmpty && _jsx(AddItemCard, { disabled: itemsDisabled, onClick: handleAddItem }), !isItemsEmpty && (_jsx(Wrap, { spacing: "base", children: filteredResults.map(({ _id, title, report, images, receipt, metadata, type, subType, room,
|
|
25
|
+
return (_jsx(TileTooltip, { label: title, children: _jsxs(Box, { backgroundColor: "lightBlue.1", boxShadow: "base", w: "100%", children: [_jsx(GroupCardHeader, { menuItems: menuItems, title: title, totalAmount: totalAmountFormatted }), _jsxs(Flex, { justify: items.length >= 10 ? 'space-between' : 'flex-end', pl: "base", my: "base", align: "center", gap: "base", children: [items.length >= 10 && (_jsx(SearchInput, { value: searchValue, onChange: handleChange })), _jsx(LeftButtonAnimated, { onClick: handleAddItem, label: t('addHomeItem.btnLabel'), disabled: disabled, id: "addingItems" })] }), _jsxs(Box, { pb: "10", px: "base", children: [isItemsEmpty && _jsx(AddItemCard, { disabled: itemsDisabled, onClick: handleAddItem }), !isItemsEmpty && (_jsx(Wrap, { spacing: "base", children: filteredResults.map(({ _id, title, report, images, receipt, metadata, type, subType, room, }) => {
|
|
26
26
|
var _a, _b, _c, _d;
|
|
27
27
|
const reportData = {
|
|
28
28
|
_id,
|
|
@@ -36,6 +36,7 @@ export const GroupCard = (_a) => {
|
|
|
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
38
|
const hasImage = images.length > 0;
|
|
39
|
+
const defaultImage = metadata === null || metadata === void 0 ? void 0 : metadata.defaultImage;
|
|
39
40
|
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
41
|
const storeImage = (metadata === null || metadata === void 0 ? void 0 : metadata.origin)
|
|
41
42
|
? getReceiptOrigin(metadata === null || metadata === void 0 ? void 0 : metadata.origin)
|
|
@@ -92,10 +92,10 @@ export const PaintItems = [
|
|
|
92
92
|
subType: 'image',
|
|
93
93
|
metadata: {
|
|
94
94
|
origin: 'homeDepot',
|
|
95
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/range.png",
|
|
95
96
|
},
|
|
96
97
|
needsReview: false,
|
|
97
98
|
reviewed: false,
|
|
98
|
-
defaultImage: "https://storage.googleapis.com/homefile-images/range.png",
|
|
99
99
|
images: [
|
|
100
100
|
{
|
|
101
101
|
bucketName: 'homefile-images',
|
|
@@ -138,7 +138,6 @@ 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",
|
|
142
141
|
report: [
|
|
143
142
|
{
|
|
144
143
|
id: faker.database.mongodbObjectId(),
|
|
@@ -226,6 +225,7 @@ export const PaintItems = [
|
|
|
226
225
|
subType: 'image',
|
|
227
226
|
metadata: {
|
|
228
227
|
origin: 'homeDepot',
|
|
228
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/freezer.png",
|
|
229
229
|
},
|
|
230
230
|
needsReview: false,
|
|
231
231
|
reviewed: false,
|
|
@@ -263,7 +263,6 @@ export const PaintItems = [
|
|
|
263
263
|
user: '62b3c96892d0bad2cc64c327',
|
|
264
264
|
home: '62b3cc68061c02d53850ddb6',
|
|
265
265
|
title: 'Cabinets-inside',
|
|
266
|
-
defaultImage: "https://storage.googleapis.com/homefile-images/fridge.png",
|
|
267
266
|
description: '',
|
|
268
267
|
report: [
|
|
269
268
|
{
|
|
@@ -351,6 +350,7 @@ export const PaintItems = [
|
|
|
351
350
|
subType: 'image',
|
|
352
351
|
metadata: {
|
|
353
352
|
origin: 'lowes',
|
|
353
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/fridge.png",
|
|
354
354
|
},
|
|
355
355
|
needsReview: false,
|
|
356
356
|
reviewed: false,
|
|
@@ -373,7 +373,9 @@ export const PaintItems = [
|
|
|
373
373
|
user: '62b3c96892d0bad2cc64c327',
|
|
374
374
|
home: '62b3cc68061c02d53850ddb6',
|
|
375
375
|
title: 'Cabinets-inside',
|
|
376
|
-
|
|
376
|
+
metadata: {
|
|
377
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/microwave.png",
|
|
378
|
+
},
|
|
377
379
|
description: '',
|
|
378
380
|
report: [
|
|
379
381
|
{
|
|
@@ -480,7 +482,9 @@ export const PaintItems = [
|
|
|
480
482
|
user: '62b3c96892d0bad2cc64c327',
|
|
481
483
|
home: '62b3cc68061c02d53850ddb6',
|
|
482
484
|
title: 'Cabinets-inside',
|
|
483
|
-
|
|
485
|
+
metadata: {
|
|
486
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/cook-top.png",
|
|
487
|
+
},
|
|
484
488
|
description: '',
|
|
485
489
|
report: [
|
|
486
490
|
{
|
|
@@ -586,7 +590,9 @@ export const PaintItems = [
|
|
|
586
590
|
_id: '62b49071061c02d53850dec6',
|
|
587
591
|
user: '62b3c96892d0bad2cc64c327',
|
|
588
592
|
home: '62b3cc68061c02d53850ddb6',
|
|
589
|
-
|
|
593
|
+
metadata: {
|
|
594
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/tank-waterhtr.png",
|
|
595
|
+
},
|
|
590
596
|
title: 'Cabinets-inside',
|
|
591
597
|
description: '',
|
|
592
598
|
report: [
|
|
@@ -694,7 +700,9 @@ export const PaintItems = [
|
|
|
694
700
|
user: '62b3c96892d0bad2cc64c327',
|
|
695
701
|
home: '62b3cc68061c02d53850ddb6',
|
|
696
702
|
title: 'Cabinets-inside',
|
|
697
|
-
|
|
703
|
+
metadata: {
|
|
704
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/hood.png",
|
|
705
|
+
},
|
|
698
706
|
description: '',
|
|
699
707
|
report: [
|
|
700
708
|
{
|
|
@@ -800,7 +808,9 @@ export const PaintItems = [
|
|
|
800
808
|
_id: '62b49071061c02d53850dec8',
|
|
801
809
|
user: '62b3c96892d0bad2cc64c327',
|
|
802
810
|
home: '62b3cc68061c02d53850ddb6',
|
|
803
|
-
|
|
811
|
+
metadata: {
|
|
812
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/washer.png",
|
|
813
|
+
},
|
|
804
814
|
title: 'Cabinets-inside',
|
|
805
815
|
description: '',
|
|
806
816
|
report: [
|
|
@@ -46,7 +46,8 @@ export interface UploadFileI extends FileInfoI {
|
|
|
46
46
|
file?: File | FileDBI;
|
|
47
47
|
}
|
|
48
48
|
export interface ReportMetadataI {
|
|
49
|
-
origin
|
|
49
|
+
origin?: string;
|
|
50
|
+
defaultImage?: string;
|
|
50
51
|
}
|
|
51
52
|
export interface ReportsI {
|
|
52
53
|
__v: number;
|
|
@@ -69,7 +70,6 @@ export interface ReportsI {
|
|
|
69
70
|
updatedAt: string;
|
|
70
71
|
user: string;
|
|
71
72
|
receipt?: string;
|
|
72
|
-
defaultImage?: string;
|
|
73
73
|
}
|
|
74
74
|
export interface MapFileI {
|
|
75
75
|
files: FolderFileI[] | File[] | FileI[] | ReportsI[];
|