From 98ecfd36aecd5763c153abec8d618edd6d6b8cc3 Mon Sep 17 00:00:00 2001 From: azimgd Date: Fri, 30 Dec 2022 00:51:22 +0500 Subject: [PATCH 01/12] check image constraints when image is selected at avatar picker --- src/CONST.js | 5 ++++ .../AttachmentPicker/index.native.js | 2 ++ src/components/AvatarWithImagePicker.js | 27 +++++++++++------- src/languages/en.js | 4 ++- src/languages/es.js | 4 ++- src/libs/Log.js | 2 +- src/libs/fileDownload/FileUtils.js | 28 +++++++++++++++++++ 7 files changed, 59 insertions(+), 13 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index ef02585f6aed..0a4ec2f55d29 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -32,6 +32,11 @@ const CONST = { // Minimum width and height size in px for a selected image AVATAR_MIN_WIDTH_PX: 80, AVATAR_MIN_HEIGHT_PX: 80, + + // Maximum width and height size in px for a selected image + AVATAR_MAX_WIDTH_PX: 400, + AVATAR_MAX_HEIGHT_PX: 400, + NEW_EXPENSIFY_URL: ACTIVE_EXPENSIFY_URL, APP_DOWNLOAD_LINKS: { ANDROID: `https://play.google.com/store/apps/details?id=${ANDROID_PACKAGE_NAME}`, diff --git a/src/components/AttachmentPicker/index.native.js b/src/components/AttachmentPicker/index.native.js index 418be07b819f..6944f75fd2cf 100644 --- a/src/components/AttachmentPicker/index.native.js +++ b/src/components/AttachmentPicker/index.native.js @@ -74,6 +74,8 @@ function getDataForUpload(fileData) { const fileResult = { name: fileName, type: fileData.type, + width: fileData.width, + height: fileData.height, uri: fileData.fileCopyUri || fileData.uri, size: fileData.fileSize || fileData.size, }; diff --git a/src/components/AvatarWithImagePicker.js b/src/components/AvatarWithImagePicker.js index 4d47a0f405e8..6988481dd7d9 100644 --- a/src/components/AvatarWithImagePicker.js +++ b/src/components/AvatarWithImagePicker.js @@ -148,17 +148,22 @@ class AvatarWithImagePicker extends React.Component { } /** - * Check if the attachment resolution is bigger than required. + * Check if the attachment resolution matches constraints. * - * @param {String} imageUri + * @param {Object} image * @returns {Promise} */ - isValidResolution(imageUri) { - return new Promise((resolve) => { - Image.getSize(imageUri, (width, height) => { - resolve(height >= CONST.AVATAR_MIN_HEIGHT_PX && width >= CONST.AVATAR_MIN_WIDTH_PX); - }); - }); + isValidResolution(image) { + const isResolutionWithinRange = resolution => ( + (resolution.height >= CONST.AVATAR_MIN_HEIGHT_PX && resolution.width >= CONST.AVATAR_MIN_WIDTH_PX) + && (resolution.height <= CONST.AVATAR_MAX_HEIGHT_PX && resolution.width <= CONST.AVATAR_MAX_WIDTH_PX) + ); + + if (image instanceof File) { + return FileUtils.getImageBlobResolution(image).then(isResolutionWithinRange); + } + + return Promise.resolve(image).then(isResolutionWithinRange); } /** @@ -182,14 +187,16 @@ class AvatarWithImagePicker extends React.Component { return; } - this.isValidResolution(image.uri) + this.isValidResolution(image) .then((isValidResolution) => { if (!isValidResolution) { this.showErrorModal( this.props.translate('avatarWithImagePicker.imageUploadFailed'), - this.props.translate('avatarWithImagePicker.tooSmallResolution', { + this.props.translate('avatarWithImagePicker.resolutionConstraints', { minHeightInPx: CONST.AVATAR_MIN_HEIGHT_PX, minWidthInPx: CONST.AVATAR_MIN_WIDTH_PX, + maxHeightInPx: CONST.AVATAR_MAX_HEIGHT_PX, + maxWidthInPx: CONST.AVATAR_MAX_WIDTH_PX, }), ); return; diff --git a/src/languages/en.js b/src/languages/en.js index d849ce04ee14..5a8e4f919df8 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -284,7 +284,9 @@ export default { imageUploadFailed: 'Image upload failed', deleteWorkspaceError: 'Sorry, there was an unexpected problem deleting your workspace avatar.', sizeExceeded: ({maxUploadSizeInMB}) => `The selected image exceeds the maximum upload size of ${maxUploadSizeInMB}MB.`, - tooSmallResolution: ({minHeightInPx, minWidthInPx}) => `Please upload an image larger than ${minHeightInPx}x${minWidthInPx} pixels`, + resolutionConstraints: ({ + minHeightInPx, minWidthInPx, maxHeightInPx, maxWidthInPx, + }) => `Please upload an image larger than ${minHeightInPx}x${minWidthInPx} and smaller than ${maxHeightInPx}x${maxWidthInPx} pixels`, notAllowedExtension: ({allowedExtensions}) => `Profile picture must be one of the following types: ${allowedExtensions.join(', ')}.`, }, profilePage: { diff --git a/src/languages/es.js b/src/languages/es.js index 889b0ab8c6bf..c1dc05c1e832 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -284,7 +284,9 @@ export default { imageUploadFailed: 'Error al cargar la imagen', deleteWorkspaceError: 'Lo sentimos, hubo un problema eliminando el avatar de su espacio de trabajo.', sizeExceeded: ({maxUploadSizeInMB}) => `La imagen supera el tamaño máximo de ${maxUploadSizeInMB}MB.`, - tooSmallResolution: ({minHeightInPx, minWidthInPx}) => `Por favor elige una imagen mas grande que ${minHeightInPx}x${minWidthInPx} píxeles`, + resolutionConstraints: ({ + minHeightInPx, minWidthInPx, maxHeightInPx, maxWidthInPx, + }) => `Por favor elige una imagen mas grande que ${minHeightInPx}x${minWidthInPx} píxeles y mas pequena que ${maxHeightInPx}x${maxWidthInPx}`, notAllowedExtension: ({allowedExtensions}) => `La foto de perfil debe ser de uno de los siguientes tipos: ${allowedExtensions.join(', ')}.`, }, profilePage: { diff --git a/src/libs/Log.js b/src/libs/Log.js index a3023bef1740..1a3d3dfb874b 100644 --- a/src/libs/Log.js +++ b/src/libs/Log.js @@ -52,7 +52,7 @@ function serverLoggingCallback(logger, params) { const Log = new Logger({ serverLoggingCallback, clientLoggingCallback: (message) => { - console.debug(message); + // console.debug(message); }, isDebug: true, }); diff --git a/src/libs/fileDownload/FileUtils.js b/src/libs/fileDownload/FileUtils.js index 197b00e22eb6..6e1c537617c6 100644 --- a/src/libs/fileDownload/FileUtils.js +++ b/src/libs/fileDownload/FileUtils.js @@ -116,6 +116,33 @@ function splitExtensionFromFileName(fullFileName) { return {fileName: splitFileName.join('.'), fileExtension}; } +/** + * Returns image dimensions for picked File object + * File object is returned as a result of a user selecting files using the element + * + * @param {*} file Picked file blob + * @returns {Promise} + */ +function getImageBlobResolution(file) { + if (!(file instanceof File)) { + return Promise.reject(new Error('Object is not an instance of File')); + } + + return new Promise((resolve, reject) => { + const image = new Image(); + const objectUrl = URL.createObjectURL(file); + image.onload = function () { + resolve({ + width: this.naturalWidth, + height: this.naturalHeight, + }); + URL.revokeObjectURL(objectUrl); + }; + image.onerror = reject; + image.src = objectUrl; + }); +} + export { showGeneralErrorAlert, showSuccessAlert, @@ -123,4 +150,5 @@ export { splitExtensionFromFileName, getAttachmentName, getFileType, + getImageBlobResolution, }; From b3eb495be878be3db27c63cc936c28ebe7219b6a Mon Sep 17 00:00:00 2001 From: azimgd Date: Fri, 30 Dec 2022 04:15:34 +0500 Subject: [PATCH 02/12] export getImageResolution into platform specific file --- src/components/AvatarWithImagePicker.js | 11 ++------ src/libs/fileDownload/getImageResolution.js | 28 +++++++++++++++++++ .../fileDownload/getImageResolution.native.js | 12 ++++++++ 3 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 src/libs/fileDownload/getImageResolution.js create mode 100644 src/libs/fileDownload/getImageResolution.native.js diff --git a/src/components/AvatarWithImagePicker.js b/src/components/AvatarWithImagePicker.js index 6988481dd7d9..4ba82ccea009 100644 --- a/src/components/AvatarWithImagePicker.js +++ b/src/components/AvatarWithImagePicker.js @@ -1,8 +1,6 @@ import _ from 'underscore'; import React from 'react'; -import { - Pressable, View, Image, -} from 'react-native'; +import {Pressable, View} from 'react-native'; import PropTypes from 'prop-types'; import lodashGet from 'lodash/get'; import Avatar from './Avatar'; @@ -21,6 +19,7 @@ import SpinningIndicatorAnimation from '../styles/animation/SpinningIndicatorAni import Tooltip from './Tooltip'; import stylePropTypes from '../styles/stylePropTypes'; import * as FileUtils from '../libs/fileDownload/FileUtils'; +import getImageResolution from '../libs/fileDownload/FileUtils'; const propTypes = { /** Avatar URL to display */ @@ -159,11 +158,7 @@ class AvatarWithImagePicker extends React.Component { && (resolution.height <= CONST.AVATAR_MAX_HEIGHT_PX && resolution.width <= CONST.AVATAR_MAX_WIDTH_PX) ); - if (image instanceof File) { - return FileUtils.getImageBlobResolution(image).then(isResolutionWithinRange); - } - - return Promise.resolve(image).then(isResolutionWithinRange); + return getImageResolution(image).then(isResolutionWithinRange); } /** diff --git a/src/libs/fileDownload/getImageResolution.js b/src/libs/fileDownload/getImageResolution.js new file mode 100644 index 000000000000..1fc30260f290 --- /dev/null +++ b/src/libs/fileDownload/getImageResolution.js @@ -0,0 +1,28 @@ +/** + * Returns image dimensions for picked File object + * File object is returned as a result of a user selecting files using the element + * + * @param {*} file Picked file blob + * @returns {Promise} + */ +function getImageBlobResolution(file) { + if (!(file instanceof File)) { + return Promise.reject(new Error('Object is not an instance of File')); + } + + return new Promise((resolve, reject) => { + const image = new Image(); + const objectUrl = URL.createObjectURL(file); + image.onload = function () { + resolve({ + width: this.naturalWidth, + height: this.naturalHeight, + }); + URL.revokeObjectURL(objectUrl); + }; + image.onerror = reject; + image.src = objectUrl; + }); +} + +export default getImageBlobResolution; diff --git a/src/libs/fileDownload/getImageResolution.native.js b/src/libs/fileDownload/getImageResolution.native.js new file mode 100644 index 000000000000..85a514287e94 --- /dev/null +++ b/src/libs/fileDownload/getImageResolution.native.js @@ -0,0 +1,12 @@ +/** + * Returns image dimensions for picked File object + * File object is returned as a result of a user selecting files using the element + * + * @param {*} file Picked file blob + * @returns {Promise} + */ +function getImageBlobResolution(file) { + return Promise.resolve({width: file.width, height: file.height}); +} + +export default getImageBlobResolution; From 365d10a444f8776f6e3e9d3d3767f57c8557d5dd Mon Sep 17 00:00:00 2001 From: azimgd Date: Fri, 30 Dec 2022 04:17:45 +0500 Subject: [PATCH 03/12] rename getImageBlobResolution -> getImageResolution and removed obsolete function --- src/libs/Log.js | 2 +- src/libs/fileDownload/FileUtils.js | 28 ------------------- src/libs/fileDownload/getImageResolution.js | 4 +-- .../fileDownload/getImageResolution.native.js | 4 +-- 4 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/libs/Log.js b/src/libs/Log.js index 1a3d3dfb874b..a3023bef1740 100644 --- a/src/libs/Log.js +++ b/src/libs/Log.js @@ -52,7 +52,7 @@ function serverLoggingCallback(logger, params) { const Log = new Logger({ serverLoggingCallback, clientLoggingCallback: (message) => { - // console.debug(message); + console.debug(message); }, isDebug: true, }); diff --git a/src/libs/fileDownload/FileUtils.js b/src/libs/fileDownload/FileUtils.js index 6e1c537617c6..197b00e22eb6 100644 --- a/src/libs/fileDownload/FileUtils.js +++ b/src/libs/fileDownload/FileUtils.js @@ -116,33 +116,6 @@ function splitExtensionFromFileName(fullFileName) { return {fileName: splitFileName.join('.'), fileExtension}; } -/** - * Returns image dimensions for picked File object - * File object is returned as a result of a user selecting files using the element - * - * @param {*} file Picked file blob - * @returns {Promise} - */ -function getImageBlobResolution(file) { - if (!(file instanceof File)) { - return Promise.reject(new Error('Object is not an instance of File')); - } - - return new Promise((resolve, reject) => { - const image = new Image(); - const objectUrl = URL.createObjectURL(file); - image.onload = function () { - resolve({ - width: this.naturalWidth, - height: this.naturalHeight, - }); - URL.revokeObjectURL(objectUrl); - }; - image.onerror = reject; - image.src = objectUrl; - }); -} - export { showGeneralErrorAlert, showSuccessAlert, @@ -150,5 +123,4 @@ export { splitExtensionFromFileName, getAttachmentName, getFileType, - getImageBlobResolution, }; diff --git a/src/libs/fileDownload/getImageResolution.js b/src/libs/fileDownload/getImageResolution.js index 1fc30260f290..32acccb06e06 100644 --- a/src/libs/fileDownload/getImageResolution.js +++ b/src/libs/fileDownload/getImageResolution.js @@ -5,7 +5,7 @@ * @param {*} file Picked file blob * @returns {Promise} */ -function getImageBlobResolution(file) { +function getImageResolution(file) { if (!(file instanceof File)) { return Promise.reject(new Error('Object is not an instance of File')); } @@ -25,4 +25,4 @@ function getImageBlobResolution(file) { }); } -export default getImageBlobResolution; +export default getImageResolution; diff --git a/src/libs/fileDownload/getImageResolution.native.js b/src/libs/fileDownload/getImageResolution.native.js index 85a514287e94..86baaacb55cc 100644 --- a/src/libs/fileDownload/getImageResolution.native.js +++ b/src/libs/fileDownload/getImageResolution.native.js @@ -5,8 +5,8 @@ * @param {*} file Picked file blob * @returns {Promise} */ -function getImageBlobResolution(file) { +function getImageResolution(file) { return Promise.resolve({width: file.width, height: file.height}); } -export default getImageBlobResolution; +export default getImageResolution; From ad215040dd0558ae6ac38ef22e2da319646682db Mon Sep 17 00:00:00 2001 From: azimgd Date: Fri, 30 Dec 2022 05:28:05 +0500 Subject: [PATCH 04/12] es translation fix --- src/languages/es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.js b/src/languages/es.js index c1dc05c1e832..23b9c922fcee 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -286,7 +286,7 @@ export default { sizeExceeded: ({maxUploadSizeInMB}) => `La imagen supera el tamaño máximo de ${maxUploadSizeInMB}MB.`, resolutionConstraints: ({ minHeightInPx, minWidthInPx, maxHeightInPx, maxWidthInPx, - }) => `Por favor elige una imagen mas grande que ${minHeightInPx}x${minWidthInPx} píxeles y mas pequena que ${maxHeightInPx}x${maxWidthInPx}`, + }) => `Por favor elige una imagen mas grande que ${minHeightInPx}x${minWidthInPx} píxeles y mas pequena que ${maxHeightInPx}x${maxWidthInPx} píxeles`, notAllowedExtension: ({allowedExtensions}) => `La foto de perfil debe ser de uno de los siguientes tipos: ${allowedExtensions.join(', ')}.`, }, profilePage: { From 2ec523a7a89cc95484cd2f8ac7cba85cac91ab14 Mon Sep 17 00:00:00 2001 From: azimgd Date: Fri, 30 Dec 2022 05:31:13 +0500 Subject: [PATCH 05/12] increase max avatar size to 2048px --- src/CONST.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index 0a4ec2f55d29..d235e83b4cc1 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -34,8 +34,8 @@ const CONST = { AVATAR_MIN_HEIGHT_PX: 80, // Maximum width and height size in px for a selected image - AVATAR_MAX_WIDTH_PX: 400, - AVATAR_MAX_HEIGHT_PX: 400, + AVATAR_MAX_WIDTH_PX: 2048, + AVATAR_MAX_HEIGHT_PX: 2048, NEW_EXPENSIFY_URL: ACTIVE_EXPENSIFY_URL, APP_DOWNLOAD_LINKS: { From ab1f5b7ef3893a9f4b2dd42b66a9d51051a07532 Mon Sep 17 00:00:00 2001 From: azimgd Date: Fri, 30 Dec 2022 22:55:29 +0500 Subject: [PATCH 06/12] fix english message translation --- src/languages/en.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index 5a8e4f919df8..83f897fb3b6c 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -286,7 +286,7 @@ export default { sizeExceeded: ({maxUploadSizeInMB}) => `The selected image exceeds the maximum upload size of ${maxUploadSizeInMB}MB.`, resolutionConstraints: ({ minHeightInPx, minWidthInPx, maxHeightInPx, maxWidthInPx, - }) => `Please upload an image larger than ${minHeightInPx}x${minWidthInPx} and smaller than ${maxHeightInPx}x${maxWidthInPx} pixels`, + }) => `Please upload an image larger than ${minHeightInPx}x${minWidthInPx} pixels and smaller than ${maxHeightInPx}x${maxWidthInPx} pixels`, notAllowedExtension: ({allowedExtensions}) => `Profile picture must be one of the following types: ${allowedExtensions.join(', ')}.`, }, profilePage: { From ca3f8fa7b686573c4f340655a609400d79965f92 Mon Sep 17 00:00:00 2001 From: azimgd Date: Fri, 30 Dec 2022 22:56:42 +0500 Subject: [PATCH 07/12] fix obsolete getImageResolution import --- src/components/AvatarWithImagePicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AvatarWithImagePicker.js b/src/components/AvatarWithImagePicker.js index 4ba82ccea009..5b258d3a6bdb 100644 --- a/src/components/AvatarWithImagePicker.js +++ b/src/components/AvatarWithImagePicker.js @@ -19,7 +19,7 @@ import SpinningIndicatorAnimation from '../styles/animation/SpinningIndicatorAni import Tooltip from './Tooltip'; import stylePropTypes from '../styles/stylePropTypes'; import * as FileUtils from '../libs/fileDownload/FileUtils'; -import getImageResolution from '../libs/fileDownload/FileUtils'; +import getImageResolution from '../libs/fileDownload/getImageResolution'; const propTypes = { /** Avatar URL to display */ From b0a46eae5da0ba03c233e8e534eaccc4d65caeb0 Mon Sep 17 00:00:00 2001 From: azimgd Date: Mon, 2 Jan 2023 17:19:57 +0500 Subject: [PATCH 08/12] fix getImageResolution function comment --- src/libs/fileDownload/getImageResolution.native.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/fileDownload/getImageResolution.native.js b/src/libs/fileDownload/getImageResolution.native.js index 86baaacb55cc..6f6e3cd77248 100644 --- a/src/libs/fileDownload/getImageResolution.native.js +++ b/src/libs/fileDownload/getImageResolution.native.js @@ -1,6 +1,5 @@ /** - * Returns image dimensions for picked File object - * File object is returned as a result of a user selecting files using the element + * Returns image dimensions for image selected from react-native-image-picker * * @param {*} file Picked file blob * @returns {Promise} From a51823ce0e5c338ac07ef6610a336231c00ed2eb Mon Sep 17 00:00:00 2001 From: azimgd Date: Mon, 2 Jan 2023 21:16:51 +0500 Subject: [PATCH 09/12] remove isResolutionWithinRange variable --- src/components/AvatarWithImagePicker.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/AvatarWithImagePicker.js b/src/components/AvatarWithImagePicker.js index 5b258d3a6bdb..7065f23aede3 100644 --- a/src/components/AvatarWithImagePicker.js +++ b/src/components/AvatarWithImagePicker.js @@ -153,12 +153,10 @@ class AvatarWithImagePicker extends React.Component { * @returns {Promise} */ isValidResolution(image) { - const isResolutionWithinRange = resolution => ( + return getImageResolution(image).then(resolution => ( (resolution.height >= CONST.AVATAR_MIN_HEIGHT_PX && resolution.width >= CONST.AVATAR_MIN_WIDTH_PX) && (resolution.height <= CONST.AVATAR_MAX_HEIGHT_PX && resolution.width <= CONST.AVATAR_MAX_WIDTH_PX) - ); - - return getImageResolution(image).then(isResolutionWithinRange); + )); } /** From da169c5d44e22bb75a3e32dcf2a7dca988db27f2 Mon Sep 17 00:00:00 2001 From: azimgd Date: Mon, 2 Jan 2023 21:24:42 +0500 Subject: [PATCH 10/12] fix getImageResolution comments --- src/libs/fileDownload/getImageResolution.js | 9 +++++++-- src/libs/fileDownload/getImageResolution.native.js | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/libs/fileDownload/getImageResolution.js b/src/libs/fileDownload/getImageResolution.js index 32acccb06e06..2f9a6d4fbdb4 100644 --- a/src/libs/fileDownload/getImageResolution.js +++ b/src/libs/fileDownload/getImageResolution.js @@ -1,6 +1,11 @@ /** - * Returns image dimensions for picked File object - * File object is returned as a result of a user selecting files using the element + * Get image resolution + * File object is returned as a result of a user selecting image using the + * We need to create a new Image object and get dimensions from it + * Opposite to native where we already have width and height properties coming from library + * + * new Image() is used specifically for performance reasons, opposed to using FileReader (5ms vs +100ms) + * because FileReader is slow and causes a noticeable delay in the UI when selecting an image. * * @param {*} file Picked file blob * @returns {Promise} diff --git a/src/libs/fileDownload/getImageResolution.native.js b/src/libs/fileDownload/getImageResolution.native.js index 6f6e3cd77248..f291886f4665 100644 --- a/src/libs/fileDownload/getImageResolution.native.js +++ b/src/libs/fileDownload/getImageResolution.native.js @@ -1,5 +1,8 @@ /** - * Returns image dimensions for image selected from react-native-image-picker + * Get image resolution + * Image object is returned as a result of a user selecting image using the react-native-image-picker + * Image already has width and height properties coming from library so we just need to return them on native + * Opposite to web where we need to create a new Image object and get dimensions from it * * @param {*} file Picked file blob * @returns {Promise} From b08f5e205551e3b8f316e550b0368002d412179c Mon Sep 17 00:00:00 2001 From: azimgd Date: Mon, 2 Jan 2023 23:43:56 +0500 Subject: [PATCH 11/12] increase allowed avatar image resolution size --- src/CONST.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index d235e83b4cc1..a671800f5860 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -34,8 +34,8 @@ const CONST = { AVATAR_MIN_HEIGHT_PX: 80, // Maximum width and height size in px for a selected image - AVATAR_MAX_WIDTH_PX: 2048, - AVATAR_MAX_HEIGHT_PX: 2048, + AVATAR_MAX_WIDTH_PX: 4096, + AVATAR_MAX_HEIGHT_PX: 4096, NEW_EXPENSIFY_URL: ACTIVE_EXPENSIFY_URL, APP_DOWNLOAD_LINKS: { From b447cbf6b7b71e8afce59fb47c98e03af5734ae0 Mon Sep 17 00:00:00 2001 From: azimgd Date: Tue, 3 Jan 2023 17:31:29 +0500 Subject: [PATCH 12/12] Update src/languages/es.js Co-authored-by: Rocio Perez-Cano --- src/languages/es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.js b/src/languages/es.js index 23b9c922fcee..3e77b4c059b3 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -286,7 +286,7 @@ export default { sizeExceeded: ({maxUploadSizeInMB}) => `La imagen supera el tamaño máximo de ${maxUploadSizeInMB}MB.`, resolutionConstraints: ({ minHeightInPx, minWidthInPx, maxHeightInPx, maxWidthInPx, - }) => `Por favor elige una imagen mas grande que ${minHeightInPx}x${minWidthInPx} píxeles y mas pequena que ${maxHeightInPx}x${maxWidthInPx} píxeles`, + }) => `Por favor, elige una imagen más grande que ${minHeightInPx}x${minWidthInPx} píxeles y más pequeña que ${maxHeightInPx}x${maxWidthInPx} píxeles`, notAllowedExtension: ({allowedExtensions}) => `La foto de perfil debe ser de uno de los siguientes tipos: ${allowedExtensions.join(', ')}.`, }, profilePage: {