mirror of
https://github.com/Jellify-Music/App.git
synced 2026-05-03 17:19:42 -05:00
fix home screen spacing
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
import { StackParamList } from "../types";
|
||||
import { ScrollView, RefreshControl } from "react-native";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { YStack, XStack, Separator } from "tamagui";
|
||||
import Playlists from "./helpers/playlists";
|
||||
import RecentArtists from "./helpers/recent-artists";
|
||||
import RecentlyPlayed from "./helpers/recently-played";
|
||||
import { useHomeContext } from "./provider";
|
||||
import { H3 } from "../Global/helpers/text";
|
||||
import Avatar from "../Global/components/avatar";
|
||||
import Client from "../../api/client";
|
||||
import { usePlayerContext } from "../../player/provider";
|
||||
import { useEffect } from "react";
|
||||
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
|
||||
|
||||
export function ProvidedHome({
|
||||
navigation
|
||||
} : {
|
||||
navigation: NativeStackNavigationProp<StackParamList>
|
||||
}): React.JSX.Element {
|
||||
|
||||
const { refreshing: refetching, onRefresh: onRefetch } = useHomeContext()
|
||||
|
||||
const { nowPlayingIsFavorite } = usePlayerContext();
|
||||
|
||||
useEffect(() => {
|
||||
onRefetch()
|
||||
}, [
|
||||
nowPlayingIsFavorite
|
||||
])
|
||||
|
||||
return (
|
||||
<SafeAreaView edges={["top", "right", "left"]}>
|
||||
<ScrollView
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
refreshControl={
|
||||
<RefreshControl
|
||||
refreshing={refetching}
|
||||
onRefresh={onRefetch}
|
||||
/>
|
||||
}>
|
||||
<YStack alignContent='flex-start'>
|
||||
<XStack margin={"$2"}>
|
||||
<H3>{`Hi, ${Client.user!.name}`}</H3>
|
||||
</XStack>
|
||||
|
||||
<Separator marginVertical={"$2"} />
|
||||
|
||||
<RecentArtists navigation={navigation} />
|
||||
|
||||
<Separator marginVertical={"$3"} />
|
||||
|
||||
<RecentlyPlayed navigation={navigation} />
|
||||
|
||||
<Separator marginVertical={"$3"} />
|
||||
|
||||
<Playlists navigation={navigation}/>
|
||||
</YStack>
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user