Skip to content

Commit

Permalink
chore: Merge 4.51.0 into master (#5860)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello authored Sep 9, 2024
1 parent deb8ea4 commit 92ebf5e
Show file tree
Hide file tree
Showing 158 changed files with 1,978 additions and 2,783 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "4.50.1"
versionName "4.51.0"
vectorDrawables.useSupportLibrary = true
if (!isFoss) {
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,4 @@ class MainActivity : ReactActivity() {
override fun invokeDefaultOnBackPressed() {
moveTaskToBack(true)
}

// from react-native-orientation
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
val intent = Intent("onConfigurationChanged")
intent.putExtra("newConfig", newConfig)
sendBroadcast(intent)
}
}
2 changes: 0 additions & 2 deletions app/actions/actionsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export const ROOMS = createRequestTypes('ROOMS', [
...defaultTypes,
'REFRESH',
'SET_SEARCH',
'CLOSE_SERVER_DROPDOWN',
'TOGGLE_SERVER_DROPDOWN',
'OPEN_SEARCH_HEADER',
'CLOSE_SEARCH_HEADER'
]);
Expand Down
12 changes: 0 additions & 12 deletions app/actions/rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,6 @@ export function setSearch(searchText: string): ISetSearch {
};
}

export function closeServerDropdown(): Action {
return {
type: ROOMS.CLOSE_SERVER_DROPDOWN
};
}

export function toggleServerDropdown(): Action {
return {
type: ROOMS.TOGGLE_SERVER_DROPDOWN
};
}

export function openSearchHeader(): Action {
return {
type: ROOMS.OPEN_SEARCH_HEADER
Expand Down
2 changes: 1 addition & 1 deletion app/containers/ActionSheet/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Item = React.memo(({ item, hide }: IActionSheetItem) => {
return (
<View accessible accessibilityLabel={item.title}>
<Touch onPress={onPress} style={[styles.item, { backgroundColor: colors.surfaceLight }]} testID={item.testID}>
{item.icon ? <CustomIcon name={item.icon} size={20} color={color} /> : null}
{item.icon ? <CustomIcon name={item.icon} size={24} color={color} /> : null}
<View style={styles.titleContainer}>
<Text numberOfLines={1} style={[styles.title, { color, marginLeft: item.icon ? 16 : 0 }]}>
{item.title}
Expand Down
2 changes: 1 addition & 1 deletion app/containers/ActionSheet/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default StyleSheet.create({
},
title: {
fontSize: 16,
...sharedStyles.textRegular
...sharedStyles.textMedium
},
handle: {
justifyContent: 'center',
Expand Down
8 changes: 7 additions & 1 deletion app/containers/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ const Button: React.FC<IButtonProps> = ({
const textStyle = [styles.text, { color: isDisabled ? colors.fontDisabled : resolvedTextColor, fontSize }, styleText];

return (
<Touchable onPress={onPress} disabled={isDisabled} style={containerStyle} accessibilityLabel={title} {...otherProps}>
<Touchable
onPress={onPress}
disabled={isDisabled}
style={containerStyle}
accessibilityLabel={title}
accessibilityRole='button'
{...otherProps}>
{loading ? <ActivityIndicator color={resolvedTextColor} /> : <Text style={textStyle}>{title}</Text>}
</Touchable>
);
Expand Down
40 changes: 21 additions & 19 deletions app/containers/DirectoryItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,29 @@ const DirectoryItem = ({
}: IDirectoryItem): React.ReactElement => {
const { theme } = useTheme();
return (
<Touch onPress={onPress} style={{ backgroundColor: themes[theme].surfaceRoom }} testID={testID}>
<View style={[styles.directoryItemContainer, styles.directoryItemButton, style]}>
<Avatar text={avatar} size={30} type={type} rid={rid} style={styles.directoryItemAvatar} />
<View style={styles.directoryItemTextContainer}>
<View style={styles.directoryItemTextTitle}>
{type !== 'd' ? <RoomTypeIcon type={type} teamMain={teamMain} /> : null}
<Text style={[styles.directoryItemName, { color: themes[theme].fontTitlesLabels }]} numberOfLines={1}>
{title}
</Text>
<View accessible accessibilityLabel={`${title} ${rightLabel}`}>
<Touch onPress={onPress} style={{ backgroundColor: themes[theme].surfaceRoom }} testID={testID}>
<View style={[styles.directoryItemContainer, styles.directoryItemButton, style]}>
<Avatar text={avatar} size={30} type={type} rid={rid} style={styles.directoryItemAvatar} />
<View style={styles.directoryItemTextContainer}>
<View style={styles.directoryItemTextTitle}>
{type !== 'd' ? <RoomTypeIcon type={type} teamMain={teamMain} /> : null}
<Text style={[styles.directoryItemName, { color: themes[theme].fontTitlesLabels }]} numberOfLines={1}>
{title}
</Text>
</View>
{description ? (
<MarkdownPreview
msg={description}
style={[styles.directoryItemUsername, { color: themes[theme].fontSecondaryInfo }]}
numberOfLines={1}
/>
) : null}
</View>
{description ? (
<MarkdownPreview
msg={description}
style={[styles.directoryItemUsername, { color: themes[theme].fontSecondaryInfo }]}
numberOfLines={1}
/>
) : null}
<DirectoryItemLabel text={rightLabel} theme={theme} />
</View>
<DirectoryItemLabel text={rightLabel} theme={theme} />
</View>
</Touch>
</Touch>
</View>
);
};

Expand Down
16 changes: 14 additions & 2 deletions app/containers/HeaderButton/HeaderButtonItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface IHeaderButtonItem {
badge?(): void;
color?: string;
disabled?: boolean;
accessibilityLabel?: string;
}

export const BUTTON_HIT_SLOP = {
Expand All @@ -40,7 +41,17 @@ const styles = StyleSheet.create({
}
});

const Item = ({ title, iconName, onPress, testID, badge, color, disabled, ...props }: IHeaderButtonItem): React.ReactElement => {
const Item = ({
title,
iconName,
onPress,
testID,
badge,
color,
disabled,
accessibilityLabel,
...props
}: IHeaderButtonItem): React.ReactElement => {
const { colors } = useTheme();
return (
<PlatformPressable
Expand All @@ -53,7 +64,8 @@ const Item = ({ title, iconName, onPress, testID, badge, color, disabled, ...pro
{
opacity: disabled ? 0.5 : 1
}
]}>
]}
accessibilityLabel={accessibilityLabel}>
<>
{iconName ? (
<CustomIcon name={iconName} size={24} color={color} {...props} />
Expand Down
5 changes: 3 additions & 2 deletions app/containers/List/ListHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ const styles = StyleSheet.create({
interface IListHeader {
title: string;
translateTitle?: boolean;
numberOfLines?: number;
}

const ListHeader = React.memo(({ title, translateTitle = true }: IListHeader) => {
const ListHeader = React.memo(({ title, translateTitle = true, numberOfLines = 1 }: IListHeader) => {
const { theme } = useTheme();

return (
<View style={styles.container}>
<Text style={[styles.title, { color: themes[theme].fontHint }]} numberOfLines={1}>
<Text style={[styles.title, { color: themes[theme].fontHint }]} numberOfLines={numberOfLines}>
{translateTitle ? I18n.t(title) : title}
</Text>
</View>
Expand Down
14 changes: 9 additions & 5 deletions app/containers/List/ListIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';

import { CustomIcon, TIconsName } from '../CustomIcon';
import { ICON_SIZE } from './constants';
import { useTheme } from '../../theme';

interface IListIcon {
name: TIconsName;
Expand All @@ -19,11 +20,14 @@ const styles = StyleSheet.create({
}
});

const ListIcon = ({ name, color, style, testID, size }: IListIcon): React.ReactElement => (
<View style={[styles.icon, style]}>
<CustomIcon name={name} color={color} size={size ?? ICON_SIZE} testID={testID} />
</View>
);
const ListIcon = ({ name, color, style, testID, size }: IListIcon): React.ReactElement => {
const { colors } = useTheme();
return (
<View style={[styles.icon, style]}>
<CustomIcon name={name} color={color || colors.fontDefault} size={size ?? ICON_SIZE} testID={testID} />
</View>
);
};

ListIcon.displayName = 'List.Icon';

Expand Down
38 changes: 33 additions & 5 deletions app/containers/List/ListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useMemo } from 'react';
import { I18nManager, StyleProp, StyleSheet, Text, TextStyle, View } from 'react-native';

import Touch from '../Touch';
Expand Down Expand Up @@ -42,7 +42,7 @@ const styles = StyleSheet.create({
title: {
flexShrink: 1,
fontSize: 16,
...sharedStyles.textRegular
...sharedStyles.textMedium
},
subtitle: {
fontSize: 14,
Expand All @@ -68,6 +68,8 @@ interface IListItemContent {
alert?: boolean;
heightContainer?: number;
styleTitle?: StyleProp<TextStyle>;
additionalAcessibilityLabel?: string | boolean;
additionalAcessibilityLabelCheck?: boolean;
}

const Content = React.memo(
Expand All @@ -85,18 +87,44 @@ const Content = React.memo(
showActionIndicator = false,
theme,
heightContainer,
styleTitle
styleTitle,
additionalAcessibilityLabel,
additionalAcessibilityLabelCheck
}: IListItemContent) => {
const { fontScale } = useDimensions();

const handleAcessibilityLabel = useMemo(() => {
let label = '';
if (title) {
label = translateTitle ? I18n.t(title) : title;
}
if (subtitle) {
label = translateSubtitle ? `${label} ${I18n.t(subtitle)}` : `${label} ${subtitle}`;
}
if (typeof additionalAcessibilityLabel === 'string') {
label = `${label} ${additionalAcessibilityLabel}`;
}
if (typeof additionalAcessibilityLabel === 'boolean') {
if (additionalAcessibilityLabelCheck) {
label = `${label} ${additionalAcessibilityLabel ? I18n.t('Checked') : I18n.t('Unchecked')}`;
} else {
label = `${label} ${additionalAcessibilityLabel ? I18n.t('Enabled') : I18n.t('Disabled')}`;
}
}
return label;
}, [title, subtitle, translateTitle, translateSubtitle, additionalAcessibilityLabel, additionalAcessibilityLabelCheck]);

return (
<View
style={[styles.container, disabled && styles.disabled, { height: (heightContainer || BASE_HEIGHT) * fontScale }]}
testID={testID}>
testID={testID}
accessible
accessibilityLabel={handleAcessibilityLabel}
accessibilityRole='button'>
{left ? <View style={styles.leftContainer}>{left()}</View> : null}
<View style={styles.textContainer}>
<View style={styles.textAlertContainer}>
<Text style={[styles.title, styleTitle, { color: color || themes[theme].fontTitlesLabels }]} numberOfLines={1}>
<Text style={[styles.title, styleTitle, { color: color || themes[theme].fontDefault }]} numberOfLines={1}>
{translateTitle && title ? I18n.t(title) : title}
</Text>
{alert ? (
Expand Down
2 changes: 1 addition & 1 deletion app/containers/List/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const PADDING_HORIZONTAL = 12;
export const BASE_HEIGHT = 46;
export const ICON_SIZE = 20;
export const ICON_SIZE = 24;
4 changes: 3 additions & 1 deletion app/containers/LoginServices/ButtonService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CustomIcon } from '../CustomIcon';
import { IButtonService } from './interfaces';
import styles from './styles';

const ButtonService = ({ name, authType, onPress, backgroundColor, buttonText, icon }: IButtonService) => {
const ButtonService = ({ name, authType, onPress, backgroundColor, buttonText, icon, accessibilityLabel }: IButtonService) => {
const { colors } = useTheme();

return (
Expand All @@ -17,6 +17,8 @@ const ButtonService = ({ name, authType, onPress, backgroundColor, buttonText, i
style={[styles.serviceButton, { backgroundColor }]}
activeOpacity={0.5}
underlayColor={colors.fontWhite}
accessible
accessibilityLabel={accessibilityLabel}
>
<View style={styles.serviceButtonContainer}>
{authType === 'oauth' || authType === 'apple' ? <CustomIcon name={icon} size={24} style={styles.serviceIcon} /> : null}
Expand Down
1 change: 1 addition & 0 deletions app/containers/LoginServices/Service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const Service = React.memo(
icon={icon}
name={service.name}
authType={service.authType}
accessibilityLabel={`${I18n.t('Continue_with')} ${modifiedName.current}`}
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions app/containers/LoginServices/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ export interface IButtonService {
backgroundColor: string;
buttonText: ReactElement;
icon: TIconsName;
accessibilityLabel?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,12 @@ exports[`MessageComposer Quote Add quote \`abc\` 1`] = `
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "400",
"lineHeight": 22,
"textAlign": "left",
},
{
"color": "#2F343D",
"lineHeight": undefined,
},
{
"backgroundColor": "transparent",
Expand Down Expand Up @@ -1044,10 +1046,12 @@ exports[`MessageComposer Quote Add quote \`def\` 1`] = `
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "400",
"lineHeight": 22,
"textAlign": "left",
},
{
"color": "#2F343D",
"lineHeight": undefined,
},
{
"backgroundColor": "transparent",
Expand Down Expand Up @@ -1219,10 +1223,12 @@ exports[`MessageComposer Quote Add quote \`def\` 1`] = `
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "400",
"lineHeight": 22,
"textAlign": "left",
},
{
"color": "#2F343D",
"lineHeight": undefined,
},
{
"backgroundColor": "transparent",
Expand Down Expand Up @@ -1637,10 +1643,12 @@ exports[`MessageComposer Quote Remove a quote 1`] = `
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "400",
"lineHeight": 22,
"textAlign": "left",
},
{
"color": "#2F343D",
"lineHeight": undefined,
},
{
"backgroundColor": "transparent",
Expand Down Expand Up @@ -1812,10 +1820,12 @@ exports[`MessageComposer Quote Remove a quote 1`] = `
"fontFamily": "Inter",
"fontSize": 16,
"fontWeight": "400",
"lineHeight": 22,
"textAlign": "left",
},
{
"color": "#2F343D",
"lineHeight": undefined,
},
{
"backgroundColor": "transparent",
Expand Down
Loading

0 comments on commit 92ebf5e

Please sign in to comment.