import {
View,
TouchableOpacity,
Image as NativeImage,
Animated,
useWindowDimensions,
} from "react-native";
import React, { useState, useCallback } from "react";
import { useTailwind } from "tailwind-rn";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import FeedStream from "./FeedStream";
import FollowStream from "./FollowStream";
import { TabView, SceneMap, TabBar } from "react-native-tab-view";
export default function Stream({ navigation }) {
const tailwind = useTailwind();
const insets = useSafeAreaInsets();
//tab组件相关
const layout = useWindowDimensions();
const [index, setIndex] = useState(0);
const [routes] = useState([
{ key: "feed", title: "推荐" },
{ key: "follow", title: "关注" },
]);
const renderScene = useCallback(
SceneMap({
feed: () => ,
follow: () => ,
}),
[]
);
const renderIndicator = useCallback((props) => {
const { position, navigationState, getTabWidth } = props;
const inputRange = [0, 1];
const translateX = position.interpolate({
inputRange: inputRange,
outputRange: inputRange.map((x) => {
return x * getTabWidth(navigationState.index);
}),
});
return (
);
}, []);
const renderTabBar = useCallback(
(props) => (
navigation.navigate("Search")}
>
),
[]
);
return (
);
}