8e393b16f5
* simplify list logic further more simplification simplify by removing `isEmpty` use `isFetchingNextPage` everywhere for clarity change `isFetching` to `isFetchingNextPage` for clarity remove some useless `useMemo`s move `renderItem` and `keyExtractor` out of component * clean bundle size check * update deploy * adjust * adjust * one test * try now * test it * done
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import React from 'react'
|
|
import {View} from 'react-native'
|
|
import {msg} from '@lingui/macro'
|
|
import {useLingui} from '@lingui/react'
|
|
import {useFocusEffect} from '@react-navigation/native'
|
|
|
|
import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types'
|
|
import {makeRecordUri} from '#/lib/strings/url-helpers'
|
|
import {useSetMinimalShellMode} from '#/state/shell'
|
|
import {ViewHeader} from '#/view/com/util/ViewHeader'
|
|
import {LikedByList} from '#/components/LikedByList'
|
|
|
|
export function ProfileLabelerLikedByScreen({
|
|
route,
|
|
}: NativeStackScreenProps<CommonNavigatorParams, 'ProfileLabelerLikedBy'>) {
|
|
const setMinimalShellMode = useSetMinimalShellMode()
|
|
const {name: handleOrDid} = route.params
|
|
const uri = makeRecordUri(handleOrDid, 'app.bsky.labeler.service', 'self')
|
|
const {_} = useLingui()
|
|
|
|
useFocusEffect(
|
|
React.useCallback(() => {
|
|
setMinimalShellMode(false)
|
|
}, [setMinimalShellMode]),
|
|
)
|
|
|
|
return (
|
|
<View style={{flex: 1}}>
|
|
<ViewHeader title={_(msg`Liked By`)} />
|
|
<LikedByList uri={uri} />
|
|
</View>
|
|
)
|
|
}
|