Skip to content

Commit

Permalink
Merge branch 'main' into fix/scroll-to-picker-regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Pader committed Jan 19, 2023
2 parents 65d5e9c + b197f26 commit 7ba22bd
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 63 deletions.
6 changes: 3 additions & 3 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default {
attachmentTooLarge: 'Attachment too large',
sizeExceeded: 'Attachment size is larger than 24 MB limit.',
attachmentTooSmall: 'Attachment too small',
sizeNotMet: 'Attachment size must be greater than 240 bytes',
sizeNotMet: 'Attachment size must be greater than 240 bytes.',
wrongFileType: 'Attachment is the wrong type',
notAllowedExtension: 'Attachments must be one of the following types: ',
},
Expand Down Expand Up @@ -293,7 +293,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} pixels 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: {
Expand Down Expand Up @@ -1037,7 +1037,7 @@ export default {
createRoom: 'Create room',
roomAlreadyExistsError: 'A room with this name already exists',
roomNameReservedError: 'A room on this workspace already uses this name',
roomNameInvalidError: 'Room names can only contain letters, numbers and hyphens',
roomNameInvalidError: 'Room names can only include lowercase letters, numbers and hyphens',
pleaseEnterRoomName: 'Please enter a room name',
pleaseSelectWorkspace: 'Please select a workspace',
renamedRoomAction: ({oldName, newName}) => ` renamed this room from ${oldName} to ${newName}`,
Expand Down
6 changes: 3 additions & 3 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default {
attachmentTooLarge: 'Archivo adjunto demasiado grande',
sizeExceeded: 'El archivo adjunto supera el límite de 24 MB.',
attachmentTooSmall: 'Archivo adjunto demasiado pequeño',
sizeNotMet: 'El archivo adjunto debe ser mas grande que 240 bytes',
sizeNotMet: 'El archivo adjunto debe ser mas grande que 240 bytes.',
wrongFileType: 'El tipo del archivo adjunto es incorrecto',
notAllowedExtension: 'Los archivos adjuntos deben ser de uno de los siguientes tipos: ',
},
Expand Down Expand Up @@ -293,7 +293,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 más grande que ${minHeightInPx}x${minWidthInPx} píxeles y más pequeña 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: {
Expand Down Expand Up @@ -1039,7 +1039,7 @@ export default {
createRoom: 'Crea una sala de chat',
roomAlreadyExistsError: 'Ya existe una sala con este nombre',
roomNameReservedError: 'Una sala en este espacio de trabajo ya usa este nombre',
roomNameInvalidError: 'Los nombres de las salas solo pueden contener letras, números y guiones',
roomNameInvalidError: 'Los nombres de las salas solo pueden contener minúsculas, números y guiones',
pleaseEnterRoomName: 'Por favor, escribe el nombre de una sala',
pleaseSelectWorkspace: 'Por favor, selecciona un espacio de trabajo',
renamedRoomAction: ({oldName, newName}) => ` cambió el nombre de la sala de ${oldName} a ${newName}`,
Expand Down
7 changes: 2 additions & 5 deletions src/libs/RoomNameInputUtils.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import CONST from '../CONST';

/**
* Modifies the room name in the following ways:
* - Replaces spaces with dashes
* - Makes all letters lowercase
* Replaces spaces with dashes
*
* @param {String} roomName
* @returns {String}
*/
function modifyRoomName(roomName) {
const modifiedRoomNameWithoutHash = roomName
.replace(/ /g, '-')
.toLowerCase();
.replace(/ /g, '-');

return `${CONST.POLICY.ROOM_PREFIX}${modifiedRoomNameWithoutHash}`;
}
Expand Down
102 changes: 54 additions & 48 deletions src/pages/ErrorPage/GenericErrorPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import styles from '../../styles/styles';
import ErrorBodyText from './ErrorBodyText';
import TextLink from '../../components/TextLink';
import CONST from '../../CONST';
import SafeAreaConsumer from '../../components/SafeAreaConsumer';
import * as StyleUtils from '../../styles/StyleUtils';

const propTypes = {
...withLocalizePropTypes,
Expand All @@ -23,58 +25,62 @@ const propTypes = {
};

const GenericErrorPage = props => (
<View style={[styles.flex1, styles.pv10, styles.ph5, styles.errorPageContainer]}>
<View style={[styles.flex1, styles.alignItemsCenter, styles.justifyContentCenter]}>
<View>
<View style={styles.mb5}>
<Icon
src={Expensicons.Bug}
height={variables.componentSizeNormal}
width={variables.componentSizeNormal}
fill={defaultTheme.iconSuccessFill}
/>
</View>
<View style={styles.mb5}>
<Text style={[styles.textHeadline]}>
{props.translate('genericErrorPage.title')}
</Text>
</View>
<View style={styles.mb5}>
<ErrorBodyText />
<Text>
{`${props.translate('genericErrorPage.body.helpTextConcierge')} `}
<TextLink href={`mailto:${CONST.EMAIL.CONCIERGE}`} style={[styles.link]}>
{CONST.EMAIL.CONCIERGE}
</TextLink>
</Text>
<SafeAreaConsumer>
{({paddingBottom}) => (
<View style={[styles.flex1, styles.pt10, styles.ph5, StyleUtils.getErrorPageContainerStyle(paddingBottom)]}>
<View style={[styles.flex1, styles.alignItemsCenter, styles.justifyContentCenter]}>
<View>
<View style={styles.mb5}>
<Icon
src={Expensicons.Bug}
height={variables.componentSizeNormal}
width={variables.componentSizeNormal}
fill={defaultTheme.iconSuccessFill}
/>
</View>
<View style={styles.mb5}>
<Text style={[styles.textHeadline]}>
{props.translate('genericErrorPage.title')}
</Text>
</View>
<View style={styles.mb5}>
<ErrorBodyText />
<Text>
{`${props.translate('genericErrorPage.body.helpTextConcierge')} `}
<TextLink href={`mailto:${CONST.EMAIL.CONCIERGE}`} style={[styles.link]}>
{CONST.EMAIL.CONCIERGE}
</TextLink>
</Text>
</View>
<View style={[styles.flexRow]}>
<View style={[styles.flex1, styles.flexRow]}>
<Button
success
medium
onPress={props.onRefresh}
text={props.translate('genericErrorPage.refresh')}
style={styles.mr3}
/>
<Button
medium
onPress={() => {
Session.signOutAndRedirectToSignIn();
props.onRefresh();
}}
text={props.translate('initialSettingsPage.signOut')}
/>
</View>
</View>
</View>
</View>
<View style={[styles.flexRow]}>
<View style={[styles.flex1, styles.flexRow]}>
<Button
success
medium
onPress={props.onRefresh}
text={props.translate('genericErrorPage.refresh')}
style={styles.mr3}
/>
<Button
medium
onPress={() => {
Session.signOutAndRedirectToSignIn();
props.onRefresh();
}}
text={props.translate('initialSettingsPage.signOut')}
/>
<View styles={styles.alignSelfEnd}>
<View style={[styles.flex1, styles.flexRow, styles.justifyContentCenter]}>
<LogoWordmark height={30} width={80} fill={defaultTheme.textLight} />
</View>
</View>
</View>
</View>
<View styles={styles.alignSelfEnd}>
<View style={[styles.flex1, styles.flexRow, styles.justifyContentCenter]}>
<LogoWordmark height={30} width={80} fill={defaultTheme.textLight} />
</View>
</View>
</View>
)}
</SafeAreaConsumer>
);

GenericErrorPage.propTypes = propTypes;
Expand Down
12 changes: 12 additions & 0 deletions src/styles/StyleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,21 @@ function getHorizontalStackedAvatarBorderStyle(isHovered, isPressed) {
};
}

/**
* @param {Number} safeAreaPaddingBottom
* @returns {Object}
*/
function getErrorPageContainerStyle(safeAreaPaddingBottom = 0) {
return {
backgroundColor: themeColors.componentBG,
paddingBottom: 40 + safeAreaPaddingBottom,
};
}

export {
getAvatarSize,
getAvatarStyle,
getErrorPageContainerStyle,
getSafeAreaPadding,
getSafeAreaMargins,
getNavigationDrawerStyle,
Expand Down
4 changes: 0 additions & 4 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2702,10 +2702,6 @@ const styles = {
flex: 1,
},

errorPageContainer: {
backgroundColor: themeColors.componentBG,
},

transferBalancePayment: {
borderWidth: 1,
borderRadius: variables.componentBorderRadiusNormal,
Expand Down
4 changes: 4 additions & 0 deletions src/styles/utilities/spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ export default {
paddingTop: 20,
},

pt10: {
paddingTop: 40,
},

pb1: {
paddingBottom: 4,
},
Expand Down

0 comments on commit 7ba22bd

Please sign in to comment.