Chore: Upgrade @types/react-native to 0.64.2 (#4026)

* Chore: Upgrade @types/react-native to 0.64.2

* minor tweak in comment

* minor tweak

* Chore: Upgrade @types/react-native to 0.64.2

* minor tweak in comment

* minor tweak

* fix accessibility within bordelessbutton
This commit is contained in:
Reinaldo Neto 2022-04-08 11:27:10 -03:00 committed by GitHub
parent 8043ca2cf9
commit ec952b058a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 42 additions and 62 deletions

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Animated, Easing, Linking, StyleSheet, Text, View } from 'react-native'; import { Animated, Easing, Linking, StyleSheet, Text, View, ViewStyle } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import * as AppleAuthentication from 'expo-apple-authentication'; import * as AppleAuthentication from 'expo-apple-authentication';
@ -410,7 +410,7 @@ class LoginServices extends React.PureComponent<ILoginServicesProps, ILoginServi
const { servicesHeight } = this.state; const { servicesHeight } = this.state;
const { services, separator } = this.props; const { services, separator } = this.props;
const { length } = Object.values(services); const { length } = Object.values(services);
const style = { const style: Animated.AnimatedProps<ViewStyle> = {
overflow: 'hidden', overflow: 'hidden',
height: servicesHeight height: servicesHeight
}; };

View File

@ -194,14 +194,10 @@ export default class RecordAudio extends React.PureComponent<IMessageBoxRecordAu
} }
if (!isRecording && !isRecorderActive) { if (!isRecording && !isRecorderActive) {
return ( return (
<BorderlessButton <BorderlessButton onPress={this.startRecordingAudio} style={styles.actionButton} testID='messagebox-send-audio'>
onPress={this.startRecordingAudio} <View accessible accessibilityLabel={I18n.t('Send_audio_message')} accessibilityRole='button'>
style={styles.actionButton} <CustomIcon name='microphone' size={24} color={themes[theme].auxiliaryTintColor} />
testID='messagebox-send-audio' </View>
// @ts-ignore
accessibilityLabel={I18n.t('Send_audio_message')}
accessibilityTraits='button'>
<CustomIcon name='microphone' size={24} color={themes[theme].auxiliaryTintColor} />
</BorderlessButton> </BorderlessButton>
); );
} }
@ -210,23 +206,17 @@ export default class RecordAudio extends React.PureComponent<IMessageBoxRecordAu
return ( return (
<View style={styles.recordingContent}> <View style={styles.recordingContent}>
<View style={styles.textArea}> <View style={styles.textArea}>
<BorderlessButton <BorderlessButton onPress={this.cancelRecordingAudio} style={styles.actionButton}>
onPress={this.cancelRecordingAudio} <View accessible accessibilityLabel={I18n.t('Cancel_recording')} accessibilityRole='button'>
// @ts-ignore <CustomIcon size={24} color={themes[theme].dangerColor} name='delete' />
accessibilityLabel={I18n.t('Cancel_recording')} </View>
accessibilityTraits='button'
style={styles.actionButton}>
<CustomIcon size={24} color={themes[theme].dangerColor} name='delete' />
</BorderlessButton> </BorderlessButton>
<Text style={[styles.recordingDurationText, { color: themes[theme].titleText }]}>{this.GetLastDuration}</Text> <Text style={[styles.recordingDurationText, { color: themes[theme].titleText }]}>{this.GetLastDuration}</Text>
</View> </View>
<BorderlessButton <BorderlessButton onPress={this.finishRecordingAudio} style={styles.actionButton}>
onPress={this.finishRecordingAudio} <View accessible accessibilityLabel={I18n.t('Finish_recording')} accessibilityRole='button'>
// @ts-ignore <CustomIcon size={24} color={themes[theme].tintColor} name='send-filled' />
accessibilityLabel={I18n.t('Finish_recording')} </View>
accessibilityTraits='button'
style={styles.actionButton}>
<CustomIcon size={24} color={themes[theme].tintColor} name='send-filled' />
</BorderlessButton> </BorderlessButton>
</View> </View>
); );
@ -235,24 +225,18 @@ export default class RecordAudio extends React.PureComponent<IMessageBoxRecordAu
return ( return (
<View style={styles.recordingContent}> <View style={styles.recordingContent}>
<View style={styles.textArea}> <View style={styles.textArea}>
<BorderlessButton <BorderlessButton onPress={this.cancelRecordingAudio} style={styles.actionButton}>
onPress={this.cancelRecordingAudio} <View accessible accessibilityLabel={I18n.t('Cancel_recording')} accessibilityRole='button'>
// @ts-ignore <CustomIcon size={24} color={themes[theme].dangerColor} name='delete' />
accessibilityLabel={I18n.t('Cancel_recording')} </View>
accessibilityTraits='button'
style={styles.actionButton}>
<CustomIcon size={24} color={themes[theme].dangerColor} name='delete' />
</BorderlessButton> </BorderlessButton>
<Text style={[styles.recordingDurationText, { color: themes[theme].titleText }]}>{this.duration}</Text> <Text style={[styles.recordingDurationText, { color: themes[theme].titleText }]}>{this.duration}</Text>
<CustomIcon size={24} color={themes[theme].dangerColor} name='record' /> <CustomIcon size={24} color={themes[theme].dangerColor} name='record' />
</View> </View>
<BorderlessButton <BorderlessButton onPress={this.finishRecordingAudio} style={styles.actionButton}>
onPress={this.finishRecordingAudio} <View accessible accessibilityLabel={I18n.t('Finish_recording')} accessibilityRole='button'>
// @ts-ignore <CustomIcon size={24} color={themes[theme].tintColor} name='send-filled' />
accessibilityLabel={I18n.t('Finish_recording')} </View>
accessibilityTraits='button'
style={styles.actionButton}>
<CustomIcon size={24} color={themes[theme].tintColor} name='send-filled' />
</BorderlessButton> </BorderlessButton>
</View> </View>
); );

View File

@ -1,5 +1,6 @@
import { BorderlessButton } from 'react-native-gesture-handler'; import { BorderlessButton } from 'react-native-gesture-handler';
import React from 'react'; import React from 'react';
import { View } from 'react-native';
import styles from '../styles'; import styles from '../styles';
import i18n from '../../../i18n'; import i18n from '../../../i18n';
@ -18,13 +19,10 @@ interface IBaseButton {
const BaseButton = ({ accessibilityLabel, icon, color, ...props }: Partial<IBaseButton>) => { const BaseButton = ({ accessibilityLabel, icon, color, ...props }: Partial<IBaseButton>) => {
const { theme } = useTheme(); const { theme } = useTheme();
return ( return (
<BorderlessButton <BorderlessButton {...props} style={styles.actionButton}>
{...props} <View accessible accessibilityLabel={i18n.t(accessibilityLabel)} accessibilityRole='button'>
style={styles.actionButton} <CustomIcon name={icon} size={24} color={color || themes[theme].auxiliaryTintColor} />
// @ts-ignore </View>
accessibilityLabel={i18n.t(accessibilityLabel)}
accessibilityTraits='button'>
<CustomIcon name={icon} size={24} color={color || themes[theme].auxiliaryTintColor} />
</BorderlessButton> </BorderlessButton>
); );
}; };

View File

@ -77,8 +77,6 @@ const styles = StyleSheet.create({
marginBottom: 4 marginBottom: 4
}, },
image: { image: {
// @ts-ignore TODO - check with the team, change this to undefined
width: null,
height: 200, height: 200,
flex: 1, flex: 1,
borderTopLeftRadius: 4, borderTopLeftRadius: 4,

View File

@ -276,8 +276,8 @@ const CannedResponsesListView = ({ navigation, route }: ICannedResponsesListView
headerTitleAlign: 'center', headerTitleAlign: 'center',
headerTitle: I18n.t('Canned_Responses'), headerTitle: I18n.t('Canned_Responses'),
headerTitleContainerStyle: { headerTitleContainerStyle: {
left: null, left: 0,
right: null right: 0
} }
}; };

View File

@ -131,8 +131,8 @@ const DiscussionsView = ({ navigation, route }: IDiscussionsViewProps): JSX.Elem
headerTitleAlign: 'center', headerTitleAlign: 'center',
headerTitle: I18n.t('Discussions'), headerTitle: I18n.t('Discussions'),
headerTitleContainerStyle: { headerTitleContainerStyle: {
left: null, left: 0,
right: null right: 0
}, },
headerRight: () => ( headerRight: () => (
<HeaderButton.Container> <HeaderButton.Container>

View File

@ -738,7 +738,7 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
onPress={this.submit} onPress={this.submit}
disabled={!this.formIsChanged()} disabled={!this.formIsChanged()}
testID='room-info-edit-view-submit'> testID='room-info-edit-view-submit'>
<Text style={[styles.button, { color: themes[theme].buttonText }]} accessibilityTraits='button'> <Text style={[styles.button, { color: themes[theme].buttonText }]} accessibilityRole='button'>
{I18n.t('SAVE')} {I18n.t('SAVE')}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
@ -755,7 +755,7 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
testID='room-info-edit-view-reset'> testID='room-info-edit-view-reset'>
<Text <Text
style={[styles.button, styles.button_inverted, { color: themes[theme].bodyText }]} style={[styles.button, styles.button_inverted, { color: themes[theme].bodyText }]}
accessibilityTraits='button'> accessibilityRole='button'>
{I18n.t('RESET')} {I18n.t('RESET')}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
@ -788,7 +788,7 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
onPress={room.teamMain ? this.deleteTeam : this.delete} onPress={room.teamMain ? this.deleteTeam : this.delete}
disabled={!this.hasDeletePermission()} disabled={!this.hasDeletePermission()}
testID='room-info-edit-view-delete'> testID='room-info-edit-view-delete'>
<Text style={[styles.button, styles.button_inverted, { color: dangerColor }]} accessibilityTraits='button'> <Text style={[styles.button, styles.button_inverted, { color: dangerColor }]} accessibilityRole='button'>
{I18n.t('DELETE')} {I18n.t('DELETE')}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>

View File

@ -159,8 +159,8 @@ class ThreadMessagesView extends React.Component<IThreadMessagesViewProps, IThre
headerTitleAlign: 'center', headerTitleAlign: 'center',
headerTitle: I18n.t('Threads'), headerTitle: I18n.t('Threads'),
headerTitleContainerStyle: { headerTitleContainerStyle: {
left: null, left: 0,
right: null right: 0
} }
}; };

View File

@ -151,7 +151,7 @@
"@types/jest": "^26.0.24", "@types/jest": "^26.0.24",
"@types/lodash": "^4.14.171", "@types/lodash": "^4.14.171",
"@types/react": "^17.0.14", "@types/react": "^17.0.14",
"@types/react-native": "^0.62.7", "@types/react-native": "0.64.2",
"@types/react-native-background-timer": "^2.0.0", "@types/react-native-background-timer": "^2.0.0",
"@types/react-native-config-reader": "^4.1.0", "@types/react-native-config-reader": "^4.1.0",
"@types/react-native-platform-touchable": "^1.1.2", "@types/react-native-platform-touchable": "^1.1.2",

File diff suppressed because one or more lines are too long

View File

@ -4682,10 +4682,10 @@
dependencies: dependencies:
"@types/react" "*" "@types/react" "*"
"@types/react-native@^0.62.7": "@types/react-native@0.64.2":
version "0.62.10" version "0.64.2"
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.62.10.tgz#82c481df21db4e7460755dc3fc7091e333a1d2bd" resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.64.2.tgz#2e344aeec0b4eb21fb9eaa0ed8973245c5601d56"
integrity sha512-QR4PGrzZ3IvRIHlScyIPuv2GV8tD/BMICZz514KGvn3KHbh0mLphHHemtHZC1o8u4xM5LxwVpMpMYHQ+ncSfag== integrity sha512-w2y04h+GVLY+OMlFSmq4adPuS51XtEp1yUr83OvXf+moMQ4zDG1Q07HhyvYDXdc+BSS9ANHySBqVCz0hFxli9Q==
dependencies: dependencies:
"@types/react" "*" "@types/react" "*"