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

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
alantoa committed Nov 3, 2023
1 parent cf01c0e commit 24e5b1b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 59 deletions.
77 changes: 24 additions & 53 deletions packages/app/components/creator-token/top-creator-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,12 @@ import {
CreatorTokenUser,
useCreatorTokenCollectors,
} from "app/hooks/creator-token/use-creator-tokens";
import { useHeaderHeight } from "app/lib/react-navigation/elements";

import { breakpoints } from "design-system/theme";

import {
TopCreatorTokenItem,
TopCreatorTokenSkeleton,
} from "./creator-token-users";

const Header = () => {
const headerHeight = useHeaderHeight();
return (
<>
<View
style={{
height: Platform.select({
ios: headerHeight + 8,
default: 8,
}),
}}
/>
<View tw="hidden flex-row justify-between bg-white pb-4 pt-6 dark:bg-black md:flex">
<Text tw="font-bold text-gray-900 dark:text-white md:text-xl">
Top Creator Tokens
</Text>
</View>
</>
);
};

const keyExtractor = (item: CreatorTokenUser) => `${item.profile_id}`;
export const TopCreatorTokens = () => {
const { height: screenHeight } = useWindowDimensions();
Expand Down Expand Up @@ -87,34 +63,29 @@ export const TopCreatorTokens = () => {
}, [isLoading]);

return (
<View tw="min-h-screen w-full bg-white dark:bg-black">
<View tw="md:max-w-screen-content mx-auto w-full">
<ErrorBoundary>
<InfiniteScrollList
useWindowScroll
data={list || []}
preserveScrollPosition
keyExtractor={keyExtractor}
numColumns={numColumns}
renderItem={renderItem}
drawDistance={500}
style={{
height: Platform.select({
web: undefined,
default: screenHeight,
}),
}}
contentContainerStyle={{
paddingHorizontal: 12,
}}
overscan={12}
containerTw="px-4 md:px-0"
ListEmptyComponent={ListEmptyComponent}
ListHeaderComponent={Header}
estimatedItemSize={46}
/>
</ErrorBoundary>
</View>
</View>
<ErrorBoundary>
<InfiniteScrollList
useWindowScroll
data={list || []}
preserveScrollPosition
keyExtractor={keyExtractor}
numColumns={numColumns}
renderItem={renderItem}
drawDistance={500}
style={{
height: Platform.select({
web: undefined,
default: screenHeight,
}),
}}
contentContainerStyle={{
paddingHorizontal: 12,
}}
overscan={12}
containerTw="px-4"
ListEmptyComponent={ListEmptyComponent}
estimatedItemSize={46}
/>
</ErrorBoundary>
);
};
13 changes: 7 additions & 6 deletions packages/app/components/profile/profile.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ import { Text } from "@showtime-xyz/universal.text";
import { View } from "@showtime-xyz/universal.view";

import { Card } from "app/components/card";
import { EmptyPlaceholder } from "app/components/empty-placeholder";
import { ButtonGoldLinearGradient } from "app/components/gold-gradient";
import { HeaderLeft } from "app/components/header";
import { HeaderRightSm } from "app/components/header/header-right.sm";
import { CreatorTokensBanner } from "app/components/home/header";
import { TopPartCreatorTokens } from "app/components/home/top-part-creator-tokens";
import { DESKTOP_PROFILE_WIDTH } from "app/constants/layout";
import { ProfileTabsNFTProvider } from "app/context/profile-tabs-nft-context";
import {
Expand Down Expand Up @@ -54,12 +60,6 @@ import {

import { Spinner } from "design-system/spinner";

import { MessageItem } from "../creator-channels/components/message-item";
import { EmptyPlaceholder } from "../empty-placeholder";
import { ButtonGoldLinearGradient } from "../gold-gradient";
import { HeaderLeft } from "../header";
import { HeaderRightSm } from "../header/header-right.sm";
import { CreatorTokensBanner } from "../home/header";
import { CreatorTokensPanel } from "./creator-tokens-panel";
import { MyCollection } from "./my-collection";
import { ProfileError } from "./profile-error";
Expand Down Expand Up @@ -367,6 +367,7 @@ const Profile = ({ username }: ProfileScreenProps) => {
<Sticky enabled>
<CreatorTokensPanel username={username} isSelf={isSelf} />
{isSelf && <MyCollection />}
<TopPartCreatorTokens />
</Sticky>
</View>
) : null}
Expand Down

0 comments on commit 24e5b1b

Please sign in to comment.