@homefile/components-v2 1.0.1 → 1.0.2
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.
- package/dist/apis/locationApi.js +2 -2
- package/dist/components/rooms/GroupCard.js +1 -1
- package/dist/components/sendDocument/DocumentPreview.js +1 -1
- package/dist/hooks/display/useMediaPreview.js +1 -1
- package/dist/hooks/folderPanel/useDisplayFiles.js +1 -1
- package/dist/hooks/homeBoard/useHomeCard.js +1 -1
- package/dist/hooks/myHomes/useEditHomeBody.js +1 -1
- package/dist/hooks/myHomes/useMyHomeCard.js +1 -1
- package/dist/hooks/sendDocument/useThumbs.js +1 -1
- package/dist/utils/AddMedia.utils.js +1 -1
- package/package.json +1 -1
- package/src/apis/locationApi.ts +2 -2
- package/src/components/rooms/GroupCard.tsx +1 -1
- package/src/components/sendDocument/DocumentPreview.tsx +1 -1
- package/src/hooks/display/useMediaPreview.ts +1 -1
- package/src/hooks/folderPanel/useDisplayFiles.ts +1 -1
- package/src/hooks/homeBoard/useHomeCard.ts +1 -1
- package/src/hooks/myHomes/useEditHomeBody.ts +1 -1
- package/src/hooks/myHomes/useMyHomeCard.ts +1 -1
- package/src/hooks/sendDocument/useThumbs.ts +1 -1
- package/src/utils/AddMedia.utils.ts +1 -1
package/dist/apis/locationApi.js
CHANGED
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.locationApi = void 0;
|
|
7
7
|
var axios_1 = __importDefault(require("axios"));
|
|
8
8
|
var locationApi = axios_1.default.create({
|
|
9
|
-
baseURL: process.env.
|
|
9
|
+
baseURL: process.env.LOCATION_BASE_URL,
|
|
10
10
|
params: {
|
|
11
11
|
limit: 1,
|
|
12
12
|
language: 'en',
|
|
13
13
|
country: 'us',
|
|
14
|
-
access_token: process.env.
|
|
14
|
+
access_token: process.env.MAPBOX_TOKEN,
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
17
|
exports.locationApi = locationApi;
|
|
@@ -39,7 +39,7 @@ var components_1 = require("..");
|
|
|
39
39
|
var utils_1 = require("../../utils");
|
|
40
40
|
var hooks_1 = require("../../hooks");
|
|
41
41
|
var helpers_1 = require("../../helpers");
|
|
42
|
-
var storageUrl = process.env.
|
|
42
|
+
var storageUrl = process.env.STORAGE_URL;
|
|
43
43
|
var GroupCard = function (_a) {
|
|
44
44
|
var items = _a.items, menuItems = _a.menuItems, onAddItem = _a.onAddItem, onAddImage = _a.onAddImage, onClickDelete = _a.onClickDelete, onClickDetails = _a.onClickDetails, title = _a.title, totalAmount = _a.totalAmount, disabled = _a.disabled, props = __rest(_a, ["items", "menuItems", "onAddItem", "onAddImage", "onClickDelete", "onClickDetails", "title", "totalAmount", "disabled"]);
|
|
45
45
|
var _b = (0, hooks_1.useGroupCard)({ items: items, onAddItem: onAddItem, title: title, totalAmount: totalAmount }), filteredResults = _b.filteredResults, handleAddItem = _b.handleAddItem, handleChange = _b.handleChange, isItemsEmpty = _b.isItemsEmpty, searchValue = _b.searchValue, totalAmountFormatted = _b.totalAmountFormatted;
|
|
@@ -8,7 +8,7 @@ var react_spinners_1 = require("react-spinners");
|
|
|
8
8
|
var components_1 = require("..");
|
|
9
9
|
var images_1 = require("../../assets/images");
|
|
10
10
|
var hooks_1 = require("../../hooks");
|
|
11
|
-
var storageUrl = process.env.
|
|
11
|
+
var storageUrl = process.env.STORAGE_URL;
|
|
12
12
|
var DocumentPreview = function (_a) {
|
|
13
13
|
var companyInfo = _a.companyInfo, date = _a.date, document = _a.document, form = _a.form, handleClose = _a.handleClose, handleSend = _a.handleSend, home = _a.home, images = _a.images, _b = _a.loading, loading = _b === void 0 ? false : _b, userInfo = _a.userInfo;
|
|
14
14
|
var _c = (0, hooks_1.useDocumentPreview)({ handleClose: handleClose, handleSend: handleSend }), ButtonsFooter = _c.ButtonsFooter, columnsDesktop = _c.columnsDesktop, columnsMobile = _c.columnsMobile, columnWidth = _c.columnWidth, contentRef = _c.contentRef;
|
|
@@ -18,7 +18,7 @@ var useMediaPreview = function (_a) {
|
|
|
18
18
|
var _e = (0, react_1.useState)([]), dbImages = _e[0], setDbImages = _e[1];
|
|
19
19
|
var _f = (0, react_1.useState)([]), totalFiles = _f[0], setTotalFiles = _f[1];
|
|
20
20
|
var _g = (0, react_1.useState)(0), index = _g[0], setIndex = _g[1];
|
|
21
|
-
var storageUrl = process.env.
|
|
21
|
+
var storageUrl = process.env.STORAGE_URL;
|
|
22
22
|
var urlModal = "".concat(storageUrl, "/").concat((_b = totalFiles[index]) === null || _b === void 0 ? void 0 : _b.bucketName, "/").concat((_c = totalFiles[index]) === null || _c === void 0 ? void 0 : _c.fileName, ".").concat((_d = totalFiles[index]) === null || _d === void 0 ? void 0 : _d.extension);
|
|
23
23
|
var findIndex = function (value) {
|
|
24
24
|
return totalFiles.findIndex(function (file) { return file.name || file._id === value; });
|
|
@@ -11,7 +11,7 @@ var useDisplayFiles = function (_a) {
|
|
|
11
11
|
var firstFile = files[0];
|
|
12
12
|
updateFileExtension(firstFile.extension);
|
|
13
13
|
if (firstFile.bucketName === "homefile-images") {
|
|
14
|
-
var storageUrl = process.env.
|
|
14
|
+
var storageUrl = process.env.STORAGE_URL;
|
|
15
15
|
updateImageUrl("".concat(storageUrl, "/").concat(firstFile === null || firstFile === void 0 ? void 0 : firstFile.bucketName, "/").concat(firstFile === null || firstFile === void 0 ? void 0 : firstFile.fileName, ".").concat(firstFile === null || firstFile === void 0 ? void 0 : firstFile.extension));
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useHomeCard = void 0;
|
|
4
4
|
var useHomeCard = function (image) {
|
|
5
|
-
var storageUrl = process.env.
|
|
5
|
+
var storageUrl = process.env.STORAGE_URL;
|
|
6
6
|
var imageUrl = "".concat(storageUrl, "/").concat(image === null || image === void 0 ? void 0 : image.bucketName, "/").concat(image === null || image === void 0 ? void 0 : image.fileName, ".").concat(image === null || image === void 0 ? void 0 : image.extension);
|
|
7
7
|
var isUndefined = imageUrl.includes('undefined');
|
|
8
8
|
if (isUndefined)
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useEditHomeBody = void 0;
|
|
4
4
|
var useEditHomeBody = function (_a) {
|
|
5
5
|
var image = _a.image;
|
|
6
|
-
var storageUrl = process.env.
|
|
6
|
+
var storageUrl = process.env.STORAGE_URL;
|
|
7
7
|
var imageUrl = "".concat(storageUrl, "/").concat(image === null || image === void 0 ? void 0 : image.bucketName, "/").concat(image === null || image === void 0 ? void 0 : image.fileName, ".").concat(image === null || image === void 0 ? void 0 : image.extension);
|
|
8
8
|
var hasImage = !!(image === null || image === void 0 ? void 0 : image.fileName);
|
|
9
9
|
return {
|
|
@@ -5,7 +5,7 @@ var helpers_1 = require("../../helpers");
|
|
|
5
5
|
var hooks_1 = require("..");
|
|
6
6
|
var useMyHomeCard = function (_a) {
|
|
7
7
|
var accountType = _a.accountType, image = _a.image;
|
|
8
|
-
var storageUrl = process.env.
|
|
8
|
+
var storageUrl = process.env.STORAGE_URL;
|
|
9
9
|
var imageUrl = "".concat(storageUrl, "/").concat(image === null || image === void 0 ? void 0 : image.bucketName, "/").concat(image === null || image === void 0 ? void 0 : image.fileName, ".").concat(image === null || image === void 0 ? void 0 : image.extension);
|
|
10
10
|
var isWidthBiggerThanHeight = (0, hooks_1.useImage)(((image === null || image === void 0 ? void 0 : image.bucketName) && imageUrl) || '').isWidthBiggerThanHeight;
|
|
11
11
|
var type = helpers_1.homeRoles[(accountType === null || accountType === void 0 ? void 0 : accountType.toLowerCase()) || ''];
|
|
@@ -4,7 +4,7 @@ exports.useThumbs = void 0;
|
|
|
4
4
|
var i18next_1 = require("i18next");
|
|
5
5
|
var useThumbs = function (_a) {
|
|
6
6
|
var file = _a.file, handleClick = _a.handleClick, handleDelete = _a.handleDelete, handleDescription = _a.handleDescription, handleEdit = _a.handleEdit, handleEditDescription = _a.handleEditDescription, handleOpen = _a.handleOpen, handleSaveDescription = _a.handleSaveDescription, index = _a.index, onOpen = _a.onOpen, removeFile = _a.removeFile;
|
|
7
|
-
var storageUrl = process.env.
|
|
7
|
+
var storageUrl = process.env.STORAGE_URL;
|
|
8
8
|
var bucketName = file.bucketName, description = file.description, editing = file.editing, extension = file.extension, fileName = file.fileName, _id = file._id, imageUrl = file.imageUrl, name = file.name, uploaded = file.uploaded;
|
|
9
9
|
var url = "".concat(storageUrl, "/").concat(bucketName, "/").concat(fileName, ".").concat(extension);
|
|
10
10
|
var handleCloseButton = function () {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleMapMedia = exports.handleMapFile = void 0;
|
|
4
4
|
var utils_1 = require("./");
|
|
5
|
-
var storageUrl = process.env.
|
|
5
|
+
var storageUrl = process.env.STORAGE_URL;
|
|
6
6
|
var handleMapFile = function (_a) {
|
|
7
7
|
var files = _a.files, _b = _a.isLocal, isLocal = _b === void 0 ? true : _b;
|
|
8
8
|
return files.map(function (file) {
|
package/package.json
CHANGED
package/src/apis/locationApi.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import axios from 'axios'
|
|
2
2
|
|
|
3
3
|
const locationApi = axios.create({
|
|
4
|
-
baseURL: process.env.
|
|
4
|
+
baseURL: process.env.LOCATION_BASE_URL,
|
|
5
5
|
params: {
|
|
6
6
|
limit: 1,
|
|
7
7
|
language: 'en',
|
|
8
8
|
country: 'us',
|
|
9
|
-
access_token: process.env.
|
|
9
|
+
access_token: process.env.MAPBOX_TOKEN,
|
|
10
10
|
},
|
|
11
11
|
})
|
|
12
12
|
|
|
@@ -13,7 +13,7 @@ import { handleMapMedia } from '@/utils'
|
|
|
13
13
|
import { useGroupCard } from '@/hooks'
|
|
14
14
|
import { receiptOrigins } from '@/helpers'
|
|
15
15
|
|
|
16
|
-
const {
|
|
16
|
+
const { STORAGE_URL: storageUrl } = process.env
|
|
17
17
|
|
|
18
18
|
export const GroupCard = ({
|
|
19
19
|
items,
|
|
@@ -26,7 +26,7 @@ import { ProgressReport } from '@/assets/images'
|
|
|
26
26
|
import { DocumentPreviewI } from '@/interfaces'
|
|
27
27
|
import { useDocumentPreview } from '@/hooks'
|
|
28
28
|
|
|
29
|
-
const {
|
|
29
|
+
const { STORAGE_URL: storageUrl } = process.env
|
|
30
30
|
|
|
31
31
|
export const DocumentPreview = ({
|
|
32
32
|
companyInfo,
|
|
@@ -10,7 +10,7 @@ export const useMediaPreview = ({ images }: MediaPreviewHookI) => {
|
|
|
10
10
|
const [dbImages, setDbImages] = useState<ImagesI[]>([])
|
|
11
11
|
const [totalFiles, setTotalFiles] = useState<ImagesI[]>([])
|
|
12
12
|
const [index, setIndex] = useState(0)
|
|
13
|
-
const {
|
|
13
|
+
const { STORAGE_URL: storageUrl } = process.env
|
|
14
14
|
const urlModal = `${storageUrl}/${totalFiles[index]?.bucketName}/${totalFiles[index]?.fileName}.${totalFiles[index]?.extension}`
|
|
15
15
|
|
|
16
16
|
const findIndex = (value: string) => {
|
|
@@ -11,7 +11,7 @@ export const useDisplayFiles = ({files, title}: {files?: FileDBI[], title: strin
|
|
|
11
11
|
const firstFile: FileDBI = files[0]
|
|
12
12
|
updateFileExtension(firstFile.extension)
|
|
13
13
|
if (firstFile.bucketName === "homefile-images") {
|
|
14
|
-
const {
|
|
14
|
+
const { STORAGE_URL: storageUrl } = process.env
|
|
15
15
|
updateImageUrl(`${storageUrl}/${firstFile?.bucketName}/${firstFile?.fileName}.${firstFile?.extension}`)
|
|
16
16
|
} else {
|
|
17
17
|
updateImageUrl("")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ImageI } from '@/interfaces'
|
|
2
2
|
|
|
3
3
|
export const useHomeCard = (image: ImageI | null | undefined) => {
|
|
4
|
-
const {
|
|
4
|
+
const { STORAGE_URL: storageUrl } = process.env
|
|
5
5
|
const imageUrl = `${storageUrl}/${image?.bucketName}/${image?.fileName}.${image?.extension}`
|
|
6
6
|
|
|
7
7
|
const isUndefined = imageUrl.includes('undefined')
|
|
@@ -5,7 +5,7 @@ interface UseEditHomeFormI {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export const useEditHomeBody = ({ image }: UseEditHomeFormI) => {
|
|
8
|
-
const {
|
|
8
|
+
const { STORAGE_URL: storageUrl } = process.env
|
|
9
9
|
const imageUrl = `${storageUrl}/${image?.bucketName}/${image?.fileName}.${image?.extension}`
|
|
10
10
|
const hasImage = !!image?.fileName
|
|
11
11
|
|
|
@@ -8,7 +8,7 @@ interface useMyHomeCardI {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const useMyHomeCard = ({ accountType, image }: useMyHomeCardI) => {
|
|
11
|
-
const {
|
|
11
|
+
const { STORAGE_URL: storageUrl } = process.env
|
|
12
12
|
const imageUrl = `${storageUrl}/${image?.bucketName}/${image?.fileName}.${image?.extension}`
|
|
13
13
|
const { isWidthBiggerThanHeight } = useImage(
|
|
14
14
|
(image?.bucketName && imageUrl) || ''
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { formatDate } from '@/utils'
|
|
2
2
|
import { MapFileI, MapImagesI } from '@/interfaces'
|
|
3
|
-
const {
|
|
3
|
+
const { STORAGE_URL: storageUrl } = process.env
|
|
4
4
|
|
|
5
5
|
export const handleMapFile = ({ files, isLocal = true }: MapFileI) => {
|
|
6
6
|
return files.map((file: any) => {
|