From a010060ac290a31a5c5a6bc569d8f1b63acc73e8 Mon Sep 17 00:00:00 2001 From: Johan-dutoit Date: Sun, 10 Apr 2022 09:05:02 +0100 Subject: [PATCH] =?UTF-8?q?chore(publishing):=20=F0=9F=94=A7=20fixed=20lin?= =?UTF-8?q?ting=20and=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- src/Bubble.tsx | 2 +- src/GiftedAvatar.tsx | 6 +++--- src/InputToolbar.tsx | 9 ++++----- src/LoadEarlier.tsx | 2 +- src/MessageText.tsx | 2 +- src/Send.tsx | 2 +- src/__tests__/__snapshots__/Bubble.test.tsx.snap | 1 + src/__tests__/__snapshots__/GiftedAvatar.test.tsx.snap | 2 +- src/__tests__/__snapshots__/LoadEarlier.test.tsx.snap | 1 + src/__tests__/__snapshots__/Message.test.tsx.snap | 5 ++++- src/hooks/useUpdateLayoutEffect.ts | 6 +++--- yarn.lock | 8 ++++---- 13 files changed, 27 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 62aa58e29..2725a0984 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-gifted-chat", - "version": "0.16.3", + "version": "1.0.0-beta-1", "description": "The most complete chat UI for React Native", "main": "node_modules/expo/AppEntry.js", "types": "lib/index.d.ts", @@ -80,6 +80,7 @@ "babel-jest": "25.5.1", "babel-preset-expo": "8.3.0", "expo": "^41.0.0", + "expo-app-loading": "1.0.3", "expo-constants": "~10.1.3", "expo-image-picker": "~10.1.4", "expo-location": "~12.0.4", @@ -104,7 +105,6 @@ "dependencies": { "@expo/react-native-action-sheet": "^3.6.0", "dayjs": "^1.8.26", - "expo-app-loading": "^1.0.3", "prop-types": "^15.7.2", "react-native-communications": "^2.2.1", "react-native-iphone-x-helper": "^1.3.1", diff --git a/src/Bubble.tsx b/src/Bubble.tsx index 055c96fe2..a4068728f 100644 --- a/src/Bubble.tsx +++ b/src/Bubble.tsx @@ -525,7 +525,7 @@ export default class Bubble< diff --git a/src/GiftedAvatar.tsx b/src/GiftedAvatar.tsx index 0534a4f96..1688b6310 100644 --- a/src/GiftedAvatar.tsx +++ b/src/GiftedAvatar.tsx @@ -159,7 +159,7 @@ export default class GiftedAvatar extends React.Component { styles.avatarTransparent, this.props.avatarStyle, ]} - accessibilityTraits='image' + accessibilityRole='image' /> ) } @@ -169,7 +169,7 @@ export default class GiftedAvatar extends React.Component { disabled={!this.props.onPress} onPress={this.props.onPress} onLongPress={this.props.onLongPress} - accessibilityTraits='image' + accessibilityRole='image' > {this.renderAvatar()} @@ -188,7 +188,7 @@ export default class GiftedAvatar extends React.Component { { backgroundColor: this.avatarColor }, this.props.avatarStyle, ]} - accessibilityTraits='image' + accessibilityRole='image' > {this.renderInitials()} diff --git a/src/InputToolbar.tsx b/src/InputToolbar.tsx index 3ac89c15b..aa777b4d7 100644 --- a/src/InputToolbar.tsx +++ b/src/InputToolbar.tsx @@ -49,15 +49,14 @@ export function InputToolbar( 'keyboardWillShow', () => setPosition('relative'), ) - return () => keyboardWillShowListener?.remove() - }, []) - - useEffect(() => { const keyboardWillHideListener = Keyboard.addListener( 'keyboardWillHide', () => setPosition('absolute'), ) - return () => keyboardWillHideListener?.remove() + return () => { + keyboardWillShowListener?.remove() + keyboardWillHideListener?.remove() + } }, []) const { containerStyle, ...rest } = props diff --git a/src/LoadEarlier.tsx b/src/LoadEarlier.tsx index 78d249d85..24a0f9b2c 100644 --- a/src/LoadEarlier.tsx +++ b/src/LoadEarlier.tsx @@ -63,7 +63,7 @@ export function LoadEarlier(props: LoadEarlierProps): React.ReactElement { style={[styles.container, props.containerStyle]} onPress={onLoadEarlier} disabled={isLoadingEarlier} - accessibilityTraits='button' + accessibilityRole='button' > {isLoadingEarlier ? ( diff --git a/src/MessageText.tsx b/src/MessageText.tsx index 454a5d3b4..f5ae2abf5 100644 --- a/src/MessageText.tsx +++ b/src/MessageText.tsx @@ -95,7 +95,7 @@ export const MessageText = ({ // When someone sends a message that includes a website address beginning with "www." (omitting the scheme), // react-native-parsed-text recognizes it as a valid url, but Linking fails to open due to the missing scheme. if (WWW_URL_PATTERN.test(url)) { - onUrlPress(`http://${url}`) + onUrlPress(`https://${url}`) } else { Linking.canOpenURL(url).then(supported => { if (!supported) { diff --git a/src/Send.tsx b/src/Send.tsx index 838900b88..fdaeb3f55 100644 --- a/src/Send.tsx +++ b/src/Send.tsx @@ -77,7 +77,7 @@ export const Send = ({ accessibilityLabel='send' style={[styles.container, containerStyle]} onPress={handleOnPress} - accessibilityTraits='button' + accessibilityRole='button' disabled={disabled} {...sendButtonProps} > diff --git a/src/__tests__/__snapshots__/Bubble.test.tsx.snap b/src/__tests__/__snapshots__/Bubble.test.tsx.snap index 48c2dde23..546dcece5 100644 --- a/src/__tests__/__snapshots__/Bubble.test.tsx.snap +++ b/src/__tests__/__snapshots__/Bubble.test.tsx.snap @@ -29,6 +29,7 @@ exports[`should render and compare with snapshot 1`] = ` } > and compare with snapshot 1`] = ` and compare with snapshot 1`] = ` and compare with snapshot 1 } > with Avatar 1`] = ` } > with Avatar 1`] = ` } > void} effect the function to call - * @param {Array} dependencies the state(s) that fires the update + * @param {DependencyList} dependencies the state(s) that fires the update */ export function useUpdateLayoutEffect( effect: () => void, - dependencies: any[] = [], + dependencies: DependencyList = [], ) { const isInitialMount = useRef(true) diff --git a/yarn.lock b/yarn.lock index 8ea5274c6..37d9c9e85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4312,7 +4312,7 @@ expect@^25.5.0: jest-message-util "^25.5.0" jest-regex-util "^25.2.6" -expo-app-loading@^1.0.3: +expo-app-loading@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/expo-app-loading/-/expo-app-loading-1.0.3.tgz#35c2dfd71aacd9f5c53777e3ff2ac07549e766df" integrity sha512-zLheUgBCQoyybJrGxw81MWfxvlnHb7zatjLbmkNosqMwqq3MOPC/P4HwF6qYsrVUFO6PIzb4yq3lFO3RkCCfhw== @@ -4392,9 +4392,9 @@ expo-permissions@~12.0.1: integrity sha512-TtypNPPLG4SdVEKBlrArLLZIyhlhE+3B4dhz2HaY1Mve2rcvKE0C7z/e1WoUVU8+LgcdKoNGwg/wRVeCkxeEhg== expo-splash-screen@~0.10.2: - version "0.10.2" - resolved "https://registry.yarnpkg.com/expo-splash-screen/-/expo-splash-screen-0.10.2.tgz#3e3d7c24c4ed180a60ce3ec64a77eefd04dd0d97" - integrity sha512-ngelW7g5yFqk3LWbyLDDxi3LYXEfgGFCJddL/Q8S/C1pMUc5foW2j9i/q+akK8i5mjYtSx3+Bk/qbyX92QIF/w== + version "0.10.3" + resolved "https://registry.yarnpkg.com/expo-splash-screen/-/expo-splash-screen-0.10.3.tgz#a4fae07fc0e0c9e997d88c1174ebaa66d02c370c" + integrity sha512-/9YPJodKjA5/Lq/YZf2aOeIaEjwkd5UW+7mr01CwvMJnZaNCIpt7d0xglxkdhCDQooQFihI/UrUoSDRDegmyjA== dependencies: "@expo/configure-splash-screen" "0.3.4"