Skip to content

Commit

Permalink
CP-4107: Fix Watchlist Crash (#525)
Browse files Browse the repository at this point in the history
* update flashlist to 1.4.0

* disable layout animation on search bar
  • Loading branch information
atn4z7 authored Dec 12, 2022
1 parent ef24b41 commit cd9b928
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
6 changes: 4 additions & 2 deletions app/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Dimensions,
Keyboard,
LayoutAnimation,
Platform,
StyleSheet,
TextInput,
TextInputProps,
Expand Down Expand Up @@ -114,6 +115,7 @@ const SearchBar: FC<Props> = ({
textInputRef.current?.blur()
}

// eslint-disable-next-line react-hooks/exhaustive-deps
const debounceFn = useCallback(debounce(onTextChanged, debounceMillis), [])

const handleTextChange = (value: string) => {
Expand Down Expand Up @@ -169,11 +171,11 @@ const SearchBar: FC<Props> = ({
value={_searchText}
onChangeText={handleTextChange}
onBlur={() => {
LayoutAnimation.easeInEaseOut()
Platform.OS === 'ios' && LayoutAnimation.easeInEaseOut()
setIsFocused(false)
}}
onFocus={() => {
LayoutAnimation.easeInEaseOut()
Platform.OS === 'ios' && LayoutAnimation.easeInEaseOut()
setIsFocused(true)
}}
underlineColorAndroid="transparent"
Expand Down
8 changes: 6 additions & 2 deletions app/screens/shared/ActivityList/Transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
Animated,
View,
StyleSheet,
ListRenderItemInfo as FlatListRenderItemInfo
ListRenderItemInfo as FlatListRenderItemInfo,
Dimensions
} from 'react-native'
import { ListRenderItemInfo as FlashListRenderItemInfo } from '@shopify/flash-list'
import AvaText from 'components/AvaText'
Expand All @@ -27,6 +28,9 @@ import { UI, useIsUIDisabled } from 'hooks/useIsUIDisabled'
import { RefreshControl } from 'components/RefreshControl'
import AvaFlashList from 'components/AvaFlashList'

const SCREEN_WIDTH = Dimensions.get('window').width
const BOTTOM_PADDING = SCREEN_WIDTH * 0.3

const yesterday = endOfYesterday()
const today = endOfToday()

Expand Down Expand Up @@ -220,7 +224,7 @@ const TransactionsZeroState = () => {

const styles = StyleSheet.create({
container: { flex: 1 },
contentContainer: { paddingBottom: '20%' },
contentContainer: { paddingBottom: BOTTOM_PADDING },
zeroState: { flex: 1, marginTop: '30%' },
headerContainer: {
flex: 1,
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ PODS:
- React-Core
- RNDominantColor (1.7.2):
- React
- RNFlashList (1.2.0):
- RNFlashList (1.4.0):
- React-Core
- RNFS (2.19.0):
- React-Core
Expand Down Expand Up @@ -813,7 +813,7 @@ SPEC CHECKSUMS:
RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140
RNDeviceInfo: 0a7c1d2532aa7691f9b9925a27e43af006db4dae
RNDominantColor: 7c17c31201566a592ba4b2fbe2bb7e00df468753
RNFlashList: adcc3a39aa72012852681bc439ccb4108c8c4448
RNFlashList: 399bf6a0db68f594ad2c86aaff3ea39564f39f8a
RNFS: fc610f78fdf8bfc89a9e5cc2f898519f4dba1002
RNGestureHandler: 7673697e7c0e9391adefae4faa087442bc04af33
RNInAppBrowser: e36d6935517101ccba0e875bac8ad7b0cb655364
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@react-navigation/stack": "6.3.2",
"@reduxjs/toolkit": "1.8.1",
"@sentry/react-native": "4.8.0",
"@shopify/flash-list": "1.2.0",
"@shopify/flash-list": "1.4.0",
"@tradle/react-native-http": "2.0.1",
"@types/bn.js": "5.1.0",
"@types/lodash.capitalize": "4.2.6",
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4890,12 +4890,12 @@
xcode "3.0.1"
yargs "^16.2.0"

"@shopify/flash-list@1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@shopify/flash-list/-/flash-list-1.2.0.tgz#981b1a9fc92b16aeb835fc17423c9e3d5cb36565"
integrity sha512-P5YzT91InI3t+Cw651bFXl1au2FxPuuPPDs1ijaUDUCOCJVliZOLdVD58CXElsNVcLppEqWDah4TB1JyC54Pqg==
"@shopify/flash-list@1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@shopify/flash-list/-/flash-list-1.4.0.tgz#cf299486ec9a7c97b7a8b1e8b6bf144a78141ed6"
integrity sha512-PvPOyk353LuETFnNA038+QaJsAFlCQ2TYC7DHP3YnYqTX72g2BM6qLoLsPaptXKuoXX+dinOo0MbEm7HDjTy1g==
dependencies:
recyclerlistview "4.1.1"
recyclerlistview "4.2.0"
tslib "2.4.0"

"@sideway/address@^4.1.3":
Expand Down Expand Up @@ -18240,10 +18240,10 @@ recursive-readdir@^2.2.2:
dependencies:
minimatch "3.0.4"

recyclerlistview@4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/recyclerlistview/-/recyclerlistview-4.1.1.tgz#b8f5f99a0be4dde7ceb4984f1949105f384d53b8"
integrity sha512-5BaAFSaSXDF9/mjv5WplX9mbZsKgYgn7N10uYjpqjW33UGVPZcz2omUOkXv0Bs6syP4qWVg3vz+NvBTjHwAOyg==
recyclerlistview@4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/recyclerlistview/-/recyclerlistview-4.2.0.tgz#a140149aaa470c9787a1426452651934240d69ef"
integrity sha512-uuBCi0c+ggqHKwrzPX4Z/mJOzsBbjZEAwGGmlwpD/sD7raXixdAbdJ6BTcAmuWG50Cg4ru9p12M94Njwhr/27A==
dependencies:
lodash.debounce "4.0.8"
prop-types "15.8.1"
Expand Down

0 comments on commit cd9b928

Please sign in to comment.