Hack together some types
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import {LayoutChangeEvent, StyleSheet, View} from 'react-native'
|
import {
|
||||||
|
FlatList,
|
||||||
|
LayoutChangeEvent,
|
||||||
|
ScrollView,
|
||||||
|
StyleSheet,
|
||||||
|
View,
|
||||||
|
} from 'react-native'
|
||||||
import Animated, {
|
import Animated, {
|
||||||
useAnimatedReaction,
|
useAnimatedReaction,
|
||||||
useAnimatedScrollHandler,
|
useAnimatedScrollHandler,
|
||||||
@@ -18,7 +24,7 @@ interface PagerWithHeaderChildParams {
|
|||||||
headerHeight: number
|
headerHeight: number
|
||||||
onScroll: OnScrollCb
|
onScroll: OnScrollCb
|
||||||
isScrolledDown: boolean
|
isScrolledDown: boolean
|
||||||
scrollElRef: any /* TODO */
|
scrollElRef: React.MutableRefObject<FlatList<any> | ScrollView | null>
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PagerWithHeaderProps {
|
export interface PagerWithHeaderProps {
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
import React, {useMemo, useCallback} from 'react'
|
import React, {useMemo, useCallback} from 'react'
|
||||||
import {Dimensions, StyleSheet, View, ActivityIndicator} from 'react-native'
|
import {
|
||||||
|
Dimensions,
|
||||||
|
StyleSheet,
|
||||||
|
View,
|
||||||
|
ActivityIndicator,
|
||||||
|
FlatList,
|
||||||
|
} from 'react-native'
|
||||||
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
import {usePalette} from 'lib/hooks/usePalette'
|
||||||
@@ -349,7 +355,9 @@ export const ProfileFeedScreenInner = observer(
|
|||||||
onScroll={onScroll}
|
onScroll={onScroll}
|
||||||
headerHeight={headerHeight}
|
headerHeight={headerHeight}
|
||||||
isScrolledDown={isScrolledDown}
|
isScrolledDown={isScrolledDown}
|
||||||
scrollElRef={scrollElRef}
|
scrollElRef={
|
||||||
|
scrollElRef as React.MutableRefObject<FlatList<any> | null>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{({onScroll, headerHeight, scrollElRef}) => (
|
{({onScroll, headerHeight, scrollElRef}) => (
|
||||||
@@ -360,7 +368,9 @@ export const ProfileFeedScreenInner = observer(
|
|||||||
headerHeight={headerHeight}
|
headerHeight={headerHeight}
|
||||||
onToggleLiked={onToggleLiked}
|
onToggleLiked={onToggleLiked}
|
||||||
onScroll={onScroll}
|
onScroll={onScroll}
|
||||||
scrollElRef={scrollElRef}
|
scrollElRef={
|
||||||
|
scrollElRef as React.MutableRefObject<ScrollView | null>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</PagerWithHeader>
|
</PagerWithHeader>
|
||||||
@@ -388,7 +398,7 @@ interface FeedSectionProps {
|
|||||||
onScroll: OnScrollCb
|
onScroll: OnScrollCb
|
||||||
headerHeight: number
|
headerHeight: number
|
||||||
isScrolledDown: boolean
|
isScrolledDown: boolean
|
||||||
scrollElRef: any /* TODO */
|
scrollElRef: React.MutableRefObject<FlatList<any> | null>
|
||||||
}
|
}
|
||||||
const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
|
const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
|
||||||
function FeedSectionImpl(
|
function FeedSectionImpl(
|
||||||
@@ -447,7 +457,7 @@ const AboutSection = observer(function AboutPageImpl({
|
|||||||
headerHeight: number
|
headerHeight: number
|
||||||
onToggleLiked: () => void
|
onToggleLiked: () => void
|
||||||
onScroll: OnScrollCb
|
onScroll: OnScrollCb
|
||||||
scrollElRef: any /* TODO */
|
scrollElRef: React.MutableRefObject<ScrollView | null>
|
||||||
}) {
|
}) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
import React, {useCallback, useMemo} from 'react'
|
import React, {useCallback, useMemo} from 'react'
|
||||||
import {ActivityIndicator, Pressable, StyleSheet, View} from 'react-native'
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
FlatList,
|
||||||
|
Pressable,
|
||||||
|
StyleSheet,
|
||||||
|
View,
|
||||||
|
} from 'react-native'
|
||||||
import {useFocusEffect} from '@react-navigation/native'
|
import {useFocusEffect} from '@react-navigation/native'
|
||||||
import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types'
|
import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
@@ -172,7 +178,9 @@ export const ProfileListScreenInner = observer(
|
|||||||
{({onScroll, headerHeight, isScrolledDown, scrollElRef}) => (
|
{({onScroll, headerHeight, isScrolledDown, scrollElRef}) => (
|
||||||
<FeedSection
|
<FeedSection
|
||||||
ref={feedSectionRef}
|
ref={feedSectionRef}
|
||||||
scrollElRef={scrollElRef}
|
scrollElRef={
|
||||||
|
scrollElRef as React.MutableRefObject<FlatList<any> | null>
|
||||||
|
}
|
||||||
feed={feed}
|
feed={feed}
|
||||||
onScroll={onScroll}
|
onScroll={onScroll}
|
||||||
headerHeight={headerHeight}
|
headerHeight={headerHeight}
|
||||||
@@ -182,7 +190,9 @@ export const ProfileListScreenInner = observer(
|
|||||||
{({onScroll, headerHeight, isScrolledDown, scrollElRef}) => (
|
{({onScroll, headerHeight, isScrolledDown, scrollElRef}) => (
|
||||||
<AboutSection
|
<AboutSection
|
||||||
ref={aboutSectionRef}
|
ref={aboutSectionRef}
|
||||||
scrollElRef={scrollElRef}
|
scrollElRef={
|
||||||
|
scrollElRef as React.MutableRefObject<FlatList<any> | null>
|
||||||
|
}
|
||||||
list={list}
|
list={list}
|
||||||
descriptionRT={list.descriptionRT}
|
descriptionRT={list.descriptionRT}
|
||||||
creator={list.data ? list.data.creator : undefined}
|
creator={list.data ? list.data.creator : undefined}
|
||||||
@@ -222,7 +232,9 @@ export const ProfileListScreenInner = observer(
|
|||||||
{({onScroll, headerHeight, isScrolledDown, scrollElRef}) => (
|
{({onScroll, headerHeight, isScrolledDown, scrollElRef}) => (
|
||||||
<AboutSection
|
<AboutSection
|
||||||
list={list}
|
list={list}
|
||||||
scrollElRef={scrollElRef}
|
scrollElRef={
|
||||||
|
scrollElRef as React.MutableRefObject<FlatList<any> | null>
|
||||||
|
}
|
||||||
descriptionRT={list.descriptionRT}
|
descriptionRT={list.descriptionRT}
|
||||||
creator={list.data ? list.data.creator : undefined}
|
creator={list.data ? list.data.creator : undefined}
|
||||||
isCurateList={list.isCuratelist}
|
isCurateList={list.isCuratelist}
|
||||||
@@ -554,7 +566,7 @@ interface FeedSectionProps {
|
|||||||
onScroll: OnScrollCb
|
onScroll: OnScrollCb
|
||||||
headerHeight: number
|
headerHeight: number
|
||||||
isScrolledDown: boolean
|
isScrolledDown: boolean
|
||||||
scrollElRef: any /* TODO */
|
scrollElRef: React.MutableRefObject<FlatList<any> | null>
|
||||||
}
|
}
|
||||||
const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
|
const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
|
||||||
function FeedSectionImpl(
|
function FeedSectionImpl(
|
||||||
@@ -608,7 +620,7 @@ interface AboutSectionProps {
|
|||||||
onScroll: OnScrollCb
|
onScroll: OnScrollCb
|
||||||
headerHeight: number
|
headerHeight: number
|
||||||
isScrolledDown: boolean
|
isScrolledDown: boolean
|
||||||
scrollElRef: any /* TODO */
|
scrollElRef: React.MutableRefObject<FlatList<any> | null>
|
||||||
}
|
}
|
||||||
const AboutSection = React.forwardRef<SectionRef, AboutSectionProps>(
|
const AboutSection = React.forwardRef<SectionRef, AboutSectionProps>(
|
||||||
function AboutSectionImpl(
|
function AboutSectionImpl(
|
||||||
|
|||||||
Reference in New Issue
Block a user