diff options
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/com/pager/PagerWithHeader.tsx | 7 | ||||
-rw-r--r-- | src/view/com/util/Views.web.tsx | 3 | ||||
-rw-r--r-- | src/view/screens/LanguageSettings.tsx | 36 | ||||
-rw-r--r-- | src/view/screens/Search/Search.tsx | 2 |
4 files changed, 26 insertions, 22 deletions
diff --git a/src/view/com/pager/PagerWithHeader.tsx b/src/view/com/pager/PagerWithHeader.tsx index 2d604d104..61e2a4096 100644 --- a/src/view/com/pager/PagerWithHeader.tsx +++ b/src/view/com/pager/PagerWithHeader.tsx @@ -109,7 +109,7 @@ export const PagerWithHeader = React.forwardRef<PagerRef, PagerWithHeaderProps>( ], ) - const scrollRefs = useSharedValue<AnimatedRef<any>[]>([]) + const scrollRefs = useSharedValue<Array<AnimatedRef<any> | null>>([]) const registerRef = React.useCallback( (scrollRef: AnimatedRef<any> | null, atIndex: number) => { scrollRefs.modify(refs => { @@ -130,8 +130,9 @@ export const PagerWithHeader = React.forwardRef<PagerRef, PagerWithHeaderProps>( lastForcedScrollY.value = forcedScrollY const refs = scrollRefs.value for (let i = 0; i < refs.length; i++) { - if (i !== currentPage && refs[i] != null) { - scrollTo(refs[i], 0, forcedScrollY, false) + const scollRef = refs[i] + if (i !== currentPage && scollRef != null) { + scrollTo(scollRef, 0, forcedScrollY, false) } } } diff --git a/src/view/com/util/Views.web.tsx b/src/view/com/util/Views.web.tsx index 04891806c..792ace140 100644 --- a/src/view/com/util/Views.web.tsx +++ b/src/view/com/util/Views.web.tsx @@ -14,6 +14,7 @@ import React from 'react' import { + FlatList, FlatListProps, ScrollViewProps, StyleSheet, @@ -67,7 +68,7 @@ export const FlatList_INTERNAL = React.forwardRef(function FlatListImpl<ItemT>( desktopFixedHeight, ...props }: React.PropsWithChildren<FlatListProps<ItemT> & AddedProps>, - ref: React.Ref<Animated.FlatList<ItemT>>, + ref: React.Ref<FlatList<ItemT>>, ) { const pal = usePalette('default') const {isMobile} = useWebMediaQueries() diff --git a/src/view/screens/LanguageSettings.tsx b/src/view/screens/LanguageSettings.tsx index b86cd46e1..390d2807b 100644 --- a/src/view/screens/LanguageSettings.tsx +++ b/src/view/screens/LanguageSettings.tsx @@ -1,27 +1,28 @@ import React from 'react' import {StyleSheet, View} from 'react-native' -import {Text} from '../com/util/text/Text' -import {s} from 'lib/styles' -import {usePalette} from 'lib/hooks/usePalette' -import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' -import {CommonNavigatorParams, NativeStackScreenProps} from 'lib/routes/types' -import {ViewHeader} from 'view/com/util/ViewHeader' -import {CenteredView} from 'view/com/util/Views' -import {Button} from 'view/com/util/forms/Button' +import RNPickerSelect, {PickerSelectProps} from 'react-native-picker-select' import { FontAwesomeIcon, FontAwesomeIconStyle, } from '@fortawesome/react-native-fontawesome' -import {useAnalytics} from 'lib/analytics/analytics' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' import {useFocusEffect} from '@react-navigation/native' -import {APP_LANGUAGES, LANGUAGES} from 'lib/../locale/languages' -import RNPickerSelect, {PickerSelectProps} from 'react-native-picker-select' -import {useSetMinimalShellMode} from '#/state/shell' + +import {sanitizeAppLanguageSetting} from '#/locale/helpers' import {useModalControls} from '#/state/modals' import {useLanguagePrefs, useLanguagePrefsApi} from '#/state/preferences' -import {Trans, msg} from '@lingui/macro' -import {useLingui} from '@lingui/react' -import {sanitizeAppLanguageSetting} from '#/locale/helpers' +import {useSetMinimalShellMode} from '#/state/shell' +import {APP_LANGUAGES, LANGUAGES} from 'lib/../locale/languages' +import {useAnalytics} from 'lib/analytics/analytics' +import {usePalette} from 'lib/hooks/usePalette' +import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' +import {CommonNavigatorParams, NativeStackScreenProps} from 'lib/routes/types' +import {s} from 'lib/styles' +import {Button} from 'view/com/util/forms/Button' +import {ViewHeader} from 'view/com/util/ViewHeader' +import {CenteredView} from 'view/com/util/Views' +import {Text} from '../com/util/text/Text' type Props = NativeStackScreenProps<CommonNavigatorParams, 'LanguageSettings'> @@ -132,9 +133,10 @@ export function LanguageSettingsScreen(_props: Props) { paddingVertical: 8, borderRadius: 24, }, + inputWeb: { - // @ts-ignore web only cursor: 'pointer', + // @ts-ignore web only '-moz-appearance': 'none', '-webkit-appearance': 'none', appearance: 'none', @@ -224,8 +226,8 @@ export function LanguageSettingsScreen(_props: Props) { borderRadius: 24, }, inputWeb: { - // @ts-ignore web only cursor: 'pointer', + // @ts-ignore web only '-moz-appearance': 'none', '-webkit-appearance': 'none', appearance: 'none', diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index 9dd1c397f..b6680176b 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -739,8 +739,8 @@ let SearchInputBox = ({ style={[ {backgroundColor: pal.colors.backgroundLight}, styles.headerSearchContainer, + // @ts-expect-error web only isWeb && { - // @ts-ignore web only cursor: 'default', }, ]} |