Skip to content

Commit

Permalink
Merge branch 'develop' into fix-navigation-bar-color-error-possible-s…
Browse files Browse the repository at this point in the history
…olution
  • Loading branch information
OtavioStasiak authored Jan 13, 2025
2 parents d20e206 + 7fa6ddc commit d45ba48
Show file tree
Hide file tree
Showing 143 changed files with 2,891 additions and 2,127 deletions.
10 changes: 4 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Great to have you here! Here are a few ways you can help make this project bette

## Setting up a development environment

Refer to [React Native environment setup](https://reactnative.dev/docs/environment-setup) to make sure everything is up and running.
Follow the `React Native CLI Quickstart` section as we don't support Expo managed flow.
Refer to [React Native environment setup](https://reactnative.dev/docs/set-up-your-environment) to make sure everything is up and running.

*Note: you'll need a MacOS to run iOS apps*
*Note: We don't support Expo managed flow*

### How to run

Expand Down Expand Up @@ -103,8 +103,6 @@ We use [Detox](https://github.com/wix/Detox) framework to end-to-end test our ap

As soon as your changes are ready, you can open a Pull Request.

The title of your PR should be descriptive, including either [NEW], [IMPROVEMENT] or [FIX] at the beginning, e.g. [FIX] App crashing on startup.
Refer to [Pull request's tags](https://developer.rocket.chat/docs/pull-requests-tags) to write a good PR title.

You may share working results prior to finishing, please include [WIP] in the title. This way anyone can look at your code: you can ask for help within the PR if you don't know how to solve a problem.

Your PR is automatically inspected by various tools, check their response and try to improve your code accordingly. Requests that fail to build or have wrong coding style won't be merged.
Open your PR as draft before asking for review. Your PR is automatically inspected by various tools, check their response and try to improve your code accordingly. Requests that fail to build or have wrong coding style won't be merged.
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.55.0"
versionName "4.57.0"
vectorDrawables.useSupportLibrary = true
if (!isFoss) {
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
Expand Down
Binary file modified android/app/src/main/assets/fonts/custom.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,25 @@ import { useActionSheet } from '../Provider';

const styles = StyleSheet.create({
subtitleText: {
fontSize: 14,
...sharedStyles.textRegular,
marginBottom: 10
fontSize: 16,
lineHeight: 24
},
buttonSeparator: {
marginRight: 8
marginRight: 12
},
footerButtonsContainer: {
flexDirection: 'row',
paddingTop: 16
},
titleContainerText: {
...sharedStyles.textBold,
fontSize: 16,
...sharedStyles.textSemibold
lineHeight: 24
},
titleContainer: {
paddingRight: 80,
marginBottom: 16,
marginBottom: 12,
flexDirection: 'row',
alignItems: 'center'
}
Expand All @@ -53,8 +54,8 @@ const FooterButtons = ({
styles.buttonSeparator,
{ flex: 1, backgroundColor: cancelBackgroundColor || colors.buttonBackgroundSecondaryDefault }
]}
color={colors.backdropColor}
title={cancelTitle}
color={colors.buttonFontSecondary}
onPress={cancelAction}
testID={`${testID}-cancel`}
/>
Expand Down Expand Up @@ -120,7 +121,6 @@ const ActionSheetContentWithInputAndSubmit = ({
<FormTextInput
key={inputConfig.key}
value={inputValues[index]}
placeholder={inputConfig.placeholder}
onChangeText={value => handleInputChange(value, index)}
onSubmitEditing={() => {
if (index < inputs.length - 1) {
Expand All @@ -143,17 +143,18 @@ const ActionSheetContentWithInputAndSubmit = ({
return (
<FormTextInput
value={inputValues[0]}
placeholder={placeholder}
onChangeText={value => handleInputChange(value, 0)}
onSubmitEditing={() => {
setTimeout(() => {
hideActionSheet();
}, 100);
if (inputValues[0]) onSubmit(inputValues[0]);
}}
accessibilityLabel={placeholder}
testID={`${testID}-input`}
secureTextEntry={secureTextEntry}
bottomSheet={isIOS}
containerStyle={{ marginTop: 12, marginBottom: 36 }}
/>
);
};
Expand All @@ -164,9 +165,9 @@ const ActionSheetContentWithInputAndSubmit = ({
return (
<View style={sharedStyles.containerScrollView} testID='action-sheet-content-with-input-and-submit'>
<>
<View style={styles.titleContainer}>
<View accessible accessibilityLabel={title} style={styles.titleContainer}>
{iconName ? <CustomIcon name={iconName} size={32} color={iconColor || colors.buttonBackgroundDangerDefault} /> : null}
<Text style={[styles.titleContainerText, { color: colors.fontDefault, paddingLeft: iconName ? 16 : 0 }]}>{title}</Text>
<Text style={[styles.titleContainerText, { color: colors.fontDefault, paddingLeft: iconName ? 12 : 0 }]}>{title}</Text>
</View>
{description ? <Text style={[styles.subtitleText, { color: colors.fontTitlesLabels }]}>{description}</Text> : null}
{customText}
Expand Down
17 changes: 14 additions & 3 deletions app/containers/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getAvatarURL } from '../../lib/methods/helpers/getAvatarUrl';
import { SubscriptionType } from '../../definitions';
import Emoji from '../markdown/Emoji';
import { IAvatar } from './interfaces';
import I18n from '../../i18n';

const Avatar = React.memo(
({
Expand All @@ -31,12 +32,14 @@ const Avatar = React.memo(
type = SubscriptionType.DIRECT,
avatarExternalProviderUrl,
roomAvatarExternalProviderUrl,
cdnPrefix
cdnPrefix,
accessibilityLabel
}: IAvatar) => {
if ((!text && !avatar && !emoji && !rid) || !server) {
return null;
}

const avatarAccessibilityLabel = accessibilityLabel ?? I18n.t('Avatar_Photo', { username: text });
const avatarStyle = {
width: size,
height: size,
Expand Down Expand Up @@ -80,11 +83,19 @@ const Avatar = React.memo(
}

if (onPress) {
image = <Touchable onPress={onPress}>{image}</Touchable>;
image = (
<Touchable accessibilityLabel={avatarAccessibilityLabel} onPress={onPress}>
{image}
</Touchable>
);
}

return (
<View style={[avatarStyle, style]} testID='avatar'>
<View
accessible
accessibilityLabel={!onPress ? avatarAccessibilityLabel : undefined}
style={[avatarStyle, style]}
testID='avatar'>
{image}
{children}
</View>
Expand Down
4 changes: 3 additions & 1 deletion app/containers/Avatar/AvatarContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const AvatarContainer = ({
onPress,
getCustomEmoji,
isStatic,
rid
rid,
accessibilityLabel
}: IAvatar): React.ReactElement => {
const server = useSelector((state: IApplicationState) => state.server.server);
const serverVersion = useSelector((state: IApplicationState) => state.server.version);
Expand Down Expand Up @@ -66,6 +67,7 @@ const AvatarContainer = ({
avatarETag={avatarETag}
serverVersion={serverVersion}
cdnPrefix={cdnPrefix}
accessibilityLabel={accessibilityLabel}
/>
);
};
Expand Down
3 changes: 2 additions & 1 deletion app/containers/Avatar/AvatarWithEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import sharedStyles from '../../views/Styles';

const styles = StyleSheet.create({
editAvatarButton: {
marginTop: 8,
marginTop: 16,
paddingVertical: 8,
paddingHorizontal: 12,
marginBottom: 0,
Expand Down Expand Up @@ -67,6 +67,7 @@ const AvatarWithEdit = ({
/>
{handleEdit && serverVersion && compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '3.6.0') ? (
<Button
accessibilityLabel={I18n.t('Edit_Room_Photo')}
title={I18n.t('Edit')}
type='secondary'
onPress={handleEdit}
Expand Down
1 change: 1 addition & 0 deletions app/containers/Avatar/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ export interface IAvatar {
avatarExternalProviderUrl?: string;
roomAvatarExternalProviderUrl?: string;
cdnPrefix?: string;
accessibilityLabel?: string;
}
11 changes: 10 additions & 1 deletion app/containers/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ const styles = StyleSheet.create({
...sharedStyles.textMedium,
...sharedStyles.textAlignCenter
},
smallText: {
...sharedStyles.textBold,
fontSize: 12,
lineHeight: 18
},
disabled: {
opacity: 0.3
}
Expand Down Expand Up @@ -75,7 +80,11 @@ const Button: React.FC<IButtonProps> = ({
style
];

const textStyle = [styles.text, { color: isDisabled ? colors.buttonPrimaryDisabled : resolvedTextColor, fontSize }, styleText];
const textStyle = [
{ color: isDisabled ? colors.buttonPrimaryDisabled : resolvedTextColor, fontSize },
small ? styles.smallText : styles.text,
styleText
];

return (
<Touchable
Expand Down
3 changes: 1 addition & 2 deletions app/containers/Check.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { useTheme } from '../theme';
const styles = StyleSheet.create({
icon: {
width: 22,
height: 22,
marginHorizontal: 15
height: 22
}
});

Expand Down
7 changes: 4 additions & 3 deletions app/containers/CustomIcon/mappedIcons.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
export const mappedIcons = {
'play-shape-filled': 59842,
'pause-shape-filled': 59843,
'loading': 59844,
'add': 59872,
'administration': 59662,
'adobe-reader-monochromatic': 59663,
Expand Down Expand Up @@ -126,6 +123,7 @@ export const mappedIcons = {
'live': 59774,
'live-streaming': 59773,
'livechat-monochromatic': 59775,
'loading': 59844,
'lock-filled': 59748,
'locker': 59749,
'log-view': 59778,
Expand Down Expand Up @@ -153,6 +151,7 @@ export const mappedIcons = {
'ordering-descending': 59800,
'pause': 59803,
'pause-filled': 59802,
'pause-shape-filled': 59843,
'percentage': 59777,
'phone': 59806,
'phone-disabled': 59804,
Expand All @@ -163,6 +162,7 @@ export const mappedIcons = {
'pin-map': 59807,
'play': 59811,
'play-filled': 59810,
'play-shape-filled': 59842,
'prune': 59817,
'queue': 59818,
'quote': 59819,
Expand All @@ -184,6 +184,7 @@ export const mappedIcons = {
'sort-az': 59831,
'star': 59834,
'star-filled': 59833,
'stars': 59845,
'status-away': 59741,
'status-busy': 59742,
'status-disabled': 59837,
Expand Down
2 changes: 1 addition & 1 deletion app/containers/CustomIcon/selection.json

Large diffs are not rendered by default.

23 changes: 15 additions & 8 deletions app/containers/FormContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import SafeAreaView from './SafeAreaView';
interface IFormContainer extends ScrollViewProps {
testID: string;
children: React.ReactElement | React.ReactElement[] | null;
showAppVersion?: boolean;
}

const styles = StyleSheet.create({
Expand All @@ -22,29 +23,35 @@ const styles = StyleSheet.create({
}
});

export const FormContainerInner = ({ children }: { children: (React.ReactElement | null)[] }) => (
<View style={[sharedStyles.container, isTablet && sharedStyles.tabletScreenContent]}>{children}</View>
export const FormContainerInner = ({
children,
accessibilityLabel
}: {
children: (React.ReactElement | null)[];
accessibilityLabel?: string;
}) => (
<View accessibilityLabel={accessibilityLabel} style={[sharedStyles.container, isTablet && sharedStyles.tabletScreenContent]}>
{children}
</View>
);

const FormContainer = ({ children, testID, ...props }: IFormContainer) => {
const FormContainer = ({ children, testID, showAppVersion = true, ...props }: IFormContainer) => {
const { theme } = useTheme();

return (
<KeyboardView
style={{ backgroundColor: themes[theme].surfaceRoom }}
contentContainerStyle={sharedStyles.container}
keyboardVerticalOffset={128}
>
keyboardVerticalOffset={128}>
<StatusBar />
<ScrollView
style={sharedStyles.container}
contentContainerStyle={[sharedStyles.containerScrollView, styles.scrollView]}
{...scrollPersistTaps}
{...props}
>
{...props}>
<SafeAreaView testID={testID} style={{ backgroundColor: themes[theme].surfaceRoom }}>
{children}
<AppVersion theme={theme} />
<>{showAppVersion && <AppVersion theme={theme} />}</>
</SafeAreaView>
</ScrollView>
</KeyboardView>
Expand Down
1 change: 1 addition & 0 deletions app/containers/List/ListInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const styles = StyleSheet.create({
},
text: {
fontSize: 14,
lineHeight: 20,
...sharedStyles.textRegular
}
});
Expand Down
13 changes: 8 additions & 5 deletions app/containers/MessageComposer/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { sanitizeLikeString } from '../../lib/database/utils';
import { generateTriggerId } from '../../lib/methods';
import { Services } from '../../lib/services';
import log from '../../lib/methods/helpers/log';
import { prepareQuoteMessage } from './helpers';
import { prepareQuoteMessage, insertEmojiAtCursor } from './helpers';
import { RecordAudio } from './components/RecordAudio';
import { useKeyboardListener } from './hooks';
import { emitter } from '../../lib/methods/helpers/emitter';
Expand Down Expand Up @@ -71,7 +71,8 @@ export const MessageComposer = ({
closeEmojiKeyboard,
closeSearchEmojiKeyboard,
setTrackingViewHeight,
setAlsoSendThreadToChannel
setAlsoSendThreadToChannel,
setAutocompleteParams
} = useMessageComposerApi();
const recordingAudio = useRecordingAudio();
useKeyboardListener(trackingViewRef);
Expand Down Expand Up @@ -147,6 +148,9 @@ export const MessageComposer = ({
}
}

// Hide autocomplete
setAutocompleteParams({ text: '', type: null, params: '' });

// Text message
onSendMessage?.(textFromInput, alsoSendThreadToChannel);
};
Expand Down Expand Up @@ -179,9 +183,8 @@ export const MessageComposer = ({
} else {
emojiText = `:${emoji.name}:`;
}
newText = `${text.substr(0, cursor)}${emojiText}${text.substr(cursor)}`;
newCursor = cursor + emojiText.length;
composerInputComponentRef.current.setInput(newText, { start: newCursor, end: newCursor });
const { updatedCursor, updatedText } = insertEmojiAtCursor(text, emojiText, cursor);
composerInputComponentRef.current.setInput(updatedText, { start: updatedCursor, end: updatedCursor });
break;
case EventTypes.SEARCH_PRESSED:
openSearchEmojiKeyboard();
Expand Down
Loading

0 comments on commit d45ba48

Please sign in to comment.