Skip to content

Commit

Permalink
Merge branch 'develop' into chore-rocketchat-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak authored Jan 13, 2025
2 parents 2077817 + 7fa6ddc commit 0dc4981
Show file tree
Hide file tree
Showing 71 changed files with 1,442 additions and 1,432 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 @@ -104,8 +104,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.
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 @@ -9,6 +9,7 @@ import { getAvatarURL } from '../../lib/methods/helpers/getAvatarUrl';
import { SubscriptionType } from '../../definitions';
import { IAvatar } from './interfaces';
import MarkdownContext from '../markdown/contexts/MarkdownContext';
import I18n from '../../i18n';

const Avatar = React.memo(
({
Expand All @@ -32,12 +33,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 @@ -88,11 +91,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;
}
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
6 changes: 5 additions & 1 deletion app/containers/MessageComposer/MessageComposer.tsx
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 0dc4981

Please sign in to comment.