Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
list improvements (#671)
Browse files Browse the repository at this point in the history
* list improvements

* list improvements

* list improvements

* list improvements

* list improvements

* list improvements

* list improvements
  • Loading branch information
intergalacticspacehighway authored Jan 10, 2022
1 parent 7a674ce commit 6ae0fc2
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 328 deletions.
26 changes: 0 additions & 26 deletions packages/app/components/feed.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useCallback, useRef, useState } from "react";
import { Platform } from "react-native";
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs";
import { useScrollToTop } from "@react-navigation/native";
import { useActivity } from "app/hooks/api-hooks";

import { View, Spinner, Text } from "design-system";
Expand Down Expand Up @@ -101,10 +100,6 @@ const CreationList = () => {
[]
);

const listRef = useRef(null);

useScrollToTop(listRef);

const ListFooterComponent = useCallback(
() => <Footer isLoading={isLoadingMore} />,
[isLoadingMore]
Expand All @@ -126,7 +121,6 @@ const CreationList = () => {
refreshing={isRefreshing}
onRefresh={refresh}
onEndReached={fetchMore}
ref={listRef}
onEndReachedThreshold={0.6}
removeClippedSubviews={Platform.OS !== "web"}
numColumns={1}
Expand All @@ -149,10 +143,6 @@ const LikesList = () => {
[]
);

const listRef = useRef(null);

useScrollToTop(listRef);

const ListFooterComponent = useCallback(
() => <Footer isLoading={isLoadingMore} />,
[isLoadingMore]
Expand All @@ -174,7 +164,6 @@ const LikesList = () => {
refreshing={isRefreshing}
onRefresh={refresh}
onEndReached={fetchMore}
ref={listRef}
onEndReachedThreshold={0.6}
removeClippedSubviews={Platform.OS !== "web"}
numColumns={1}
Expand All @@ -197,10 +186,6 @@ const CommentsList = () => {
[]
);

const listRef = useRef(null);

useScrollToTop(listRef);

const ListFooterComponent = useCallback(
() => <Footer isLoading={isLoadingMore} />,
[isLoadingMore]
Expand All @@ -222,7 +207,6 @@ const CommentsList = () => {
refreshing={isRefreshing}
onRefresh={refresh}
onEndReached={fetchMore}
ref={listRef}
onEndReachedThreshold={0.6}
removeClippedSubviews={Platform.OS !== "web"}
numColumns={1}
Expand All @@ -245,10 +229,6 @@ const FollowsList = () => {
[]
);

const listRef = useRef(null);

useScrollToTop(listRef);

const ListFooterComponent = useCallback(
() => <Footer isLoading={isLoadingMore} />,
[isLoadingMore]
Expand All @@ -270,7 +250,6 @@ const FollowsList = () => {
refreshing={isRefreshing}
onRefresh={refresh}
onEndReached={fetchMore}
ref={listRef}
onEndReachedThreshold={0.6}
removeClippedSubviews={Platform.OS !== "web"}
numColumns={1}
Expand All @@ -293,10 +272,6 @@ const AllActivityList = () => {
[]
);

const listRef = useRef(null);

useScrollToTop(listRef);

const ListFooterComponent = useCallback(
() => <Footer isLoading={isLoadingMore} />,
[isLoadingMore]
Expand All @@ -318,7 +293,6 @@ const AllActivityList = () => {
refreshing={isRefreshing}
onRefresh={refresh}
onEndReached={fetchMore}
ref={listRef}
onEndReachedThreshold={0.6}
removeClippedSubviews={Platform.OS !== "web"}
numColumns={1}
Expand Down
13 changes: 1 addition & 12 deletions packages/app/components/trending.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useMemo, useRef, useState } from "react";
import { useCallback, useMemo, useState } from "react";
import {
View,
Spinner,
Expand All @@ -11,7 +11,6 @@ import {
} from "design-system";
import { tw } from "design-system/tailwind";
import { useTrendingCreators, useTrendingNFTS } from "../hooks/api-hooks";
import { useScrollToTop } from "@react-navigation/native";
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs";
import { Dimensions, Platform } from "react-native";
import { Video } from "expo-av";
Expand Down Expand Up @@ -130,10 +129,6 @@ const CreatorsList = ({
return <CreatorPreview creator={item} />;
}, []);

const listRef = useRef(null);

useScrollToTop(listRef);

const ListFooterComponent = useCallback(
() => <Footer isLoading={isLoadingMore} />,
[isLoadingMore]
Expand Down Expand Up @@ -166,7 +161,6 @@ const CreatorsList = ({
refreshing={isRefreshing}
onRefresh={refresh}
onEndReached={fetchMore}
ref={listRef}
onEndReachedThreshold={0.6}
removeClippedSubviews={Platform.OS !== "web"}
ListHeaderComponent={ListHeaderComponent}
Expand Down Expand Up @@ -201,10 +195,6 @@ const NFTSList = ({

const renderItem = useCallback(({ item }) => <Media item={item} />, []);

const listRef = useRef(null);

useScrollToTop(listRef);

const ListFooterComponent = useCallback(
() => <Footer isLoading={isLoadingMore} />,
[isLoadingMore]
Expand Down Expand Up @@ -241,7 +231,6 @@ const NFTSList = ({
refreshing={isRefreshing}
onRefresh={refresh}
onEndReached={fetchMore}
ref={listRef}
onEndReachedThreshold={0.6}
removeClippedSubviews={Platform.OS !== "web"}
ListHeaderComponent={ListHeaderComponent}
Expand Down
6 changes: 1 addition & 5 deletions packages/design-system/tabs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
export { Tabs, useTabsContext, useTabIndexContext } from "./tablib";
export {
TabItem,
PullToRefresh,
SelectedTabIndicator,
} from "./tablib/components";
export { TabItem, SelectedTabIndicator } from "./tablib/components";
Loading

0 comments on commit 6ae0fc2

Please sign in to comment.