mirror of
https://github.com/Jellify-Music/App.git
synced 2025-12-30 15:29:49 -06:00
cleaning up stuff
trying to fix localhost connection issues
This commit is contained in:
@@ -5,9 +5,7 @@ import { fetchFavoriteAlbums, fetchFavoriteArtists, fetchFavoriteTracks, fetchUs
|
||||
|
||||
export const useFavoriteArtists = (api: Api, libraryId: string) => useQuery({
|
||||
queryKey: [QueryKeys.FavoriteArtists, api, libraryId],
|
||||
queryFn: ({ queryKey }) => {
|
||||
const api: Api = queryKey[1] as Api;
|
||||
const libraryId : string = queryKey[2] as string;
|
||||
queryFn: () => {
|
||||
|
||||
return fetchFavoriteArtists(api, libraryId)
|
||||
}
|
||||
@@ -16,8 +14,6 @@ export const useFavoriteArtists = (api: Api, libraryId: string) => useQuery({
|
||||
export const useFavoriteAlbums = (api: Api, libraryId: string) => useQuery({
|
||||
queryKey: [QueryKeys.FavoriteAlbums, api, libraryId],
|
||||
queryFn: ({ queryKey }) => {
|
||||
const api: Api = queryKey[1] as Api;
|
||||
const libraryId : string = queryKey[2] as string;
|
||||
|
||||
return fetchFavoriteAlbums(api, libraryId)
|
||||
}
|
||||
@@ -26,8 +22,6 @@ export const useFavoriteAlbums = (api: Api, libraryId: string) => useQuery({
|
||||
export const useFavoriteTracks = (api: Api, libraryId: string) => useQuery({
|
||||
queryKey: [QueryKeys.FavoriteTracks, api, libraryId],
|
||||
queryFn: ({ queryKey }) => {
|
||||
const api: Api = queryKey[1] as Api;
|
||||
const libraryId : string = queryKey[2] as string;
|
||||
|
||||
return fetchFavoriteTracks(api, libraryId)
|
||||
}
|
||||
@@ -36,8 +30,6 @@ export const useFavoriteTracks = (api: Api, libraryId: string) => useQuery({
|
||||
export const useUserData = (api: Api, itemId: string) => useQuery({
|
||||
queryKey: [QueryKeys.UserData, api, itemId],
|
||||
queryFn: ({ queryKey }) => {
|
||||
const api: Api = queryKey[1] as Api;
|
||||
const itemId: string = queryKey[2] as string;
|
||||
|
||||
return fetchUserData(api, itemId)
|
||||
}
|
||||
|
||||
@@ -8,9 +8,6 @@ export const useRecentlyPlayed = (api: Api, libraryId: string) => useQuery({
|
||||
queryKey: [QueryKeys.RecentlyPlayed, api, libraryId],
|
||||
queryFn: ({ queryKey }) => {
|
||||
|
||||
const api : Api = queryKey[1] as Api;
|
||||
const libraryId : string = queryKey[2] as string;
|
||||
|
||||
return fetchRecentlyPlayed(api, libraryId)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,7 +11,6 @@ import { useApiClientContext } from "@/components/jellyfin-api-provider";
|
||||
import { queryConfig } from "@/api/queries/query.config";
|
||||
import { useSafeAreaFrame } from "react-native-safe-area-context";
|
||||
import Icon from "../helpers/icon";
|
||||
import Popover from "../helpers/popover";
|
||||
|
||||
interface TrackProps {
|
||||
track: BaseItemDto;
|
||||
@@ -118,6 +117,7 @@ export default function Track({
|
||||
<YStack
|
||||
alignContent="center"
|
||||
justifyContent="center"
|
||||
minWidth={24}
|
||||
>
|
||||
{ track.UserData?.IsFavorite ? (
|
||||
<Icon small name="heart" color={Colors.Primary} />
|
||||
@@ -128,7 +128,7 @@ export default function Track({
|
||||
|
||||
<YStack
|
||||
alignContent="center"
|
||||
justifyContent="flex-end"
|
||||
justifyContent="space-around"
|
||||
>
|
||||
<RunTimeTicks>{ track.RunTimeTicks }</RunTimeTicks>
|
||||
</YStack>
|
||||
@@ -137,16 +137,7 @@ export default function Track({
|
||||
alignContent="center"
|
||||
justifyContent="center"
|
||||
>
|
||||
<Popover
|
||||
trigger={(
|
||||
<Icon small name="dots-vertical" />
|
||||
)}>
|
||||
<XStack justifyContent="space-between">
|
||||
<YStack alignContent="flex-start">
|
||||
<H5>{ track.Name ?? "Untitled Track" }</H5>
|
||||
</YStack>
|
||||
</XStack>
|
||||
</Popover>
|
||||
<Icon small name="dots-vertical" />
|
||||
|
||||
</YStack>
|
||||
</XStack>
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
import { Colors } from "@/enums/colors";
|
||||
import React from "react"
|
||||
import { trigger } from "react-native-haptic-feedback";
|
||||
import { Adapt, Popover as TamaguiPopover, View } from "tamagui"
|
||||
|
||||
interface PopoverProps {
|
||||
children: React.ReactNode;
|
||||
trigger: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function Popover(props: PopoverProps) : React.JSX.Element {
|
||||
return (
|
||||
<TamaguiPopover
|
||||
size="$5"
|
||||
stayInFrame
|
||||
offset={1}
|
||||
>
|
||||
<TamaguiPopover.Trigger asChild>
|
||||
{ props.trigger }
|
||||
</TamaguiPopover.Trigger>
|
||||
|
||||
{ /* Tamagui doesn't support Popovers on Native, so we adapt it to a sheet */ }
|
||||
<Adapt when="sm" platform="touch">
|
||||
<TamaguiPopover.Sheet modal dismissOnSnapToBottom>
|
||||
<TamaguiPopover.Sheet.Frame>
|
||||
<Adapt.Contents />
|
||||
</TamaguiPopover.Sheet.Frame>
|
||||
|
||||
<TamaguiPopover.Sheet.Overlay
|
||||
animation="lazy"
|
||||
/>
|
||||
</TamaguiPopover.Sheet>
|
||||
</Adapt>
|
||||
<TamaguiPopover.Content>
|
||||
<TamaguiPopover.Arrow />
|
||||
<TamaguiPopover.Close />
|
||||
{ props.children }
|
||||
</TamaguiPopover.Content>
|
||||
</TamaguiPopover>
|
||||
)
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
import _ from "lodash";
|
||||
import { useApiClientContext } from "../jellyfin-api-provider";
|
||||
import { HomeProvider } from "./provider";
|
||||
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
||||
import { StackParamList, ProvidedHomeProps } from "../types";
|
||||
import { StackParamList } from "../types";
|
||||
import { ArtistScreen } from "../Artist/screens";
|
||||
import { AlbumScreen } from "../Album/screens";
|
||||
import { PlaylistScreen } from "../Playlist/screens";
|
||||
@@ -12,8 +11,6 @@ const HomeStack = createNativeStackNavigator<StackParamList>();
|
||||
|
||||
export default function Home(): React.JSX.Element {
|
||||
|
||||
const { user } = useApiClientContext();
|
||||
|
||||
return (
|
||||
<HomeProvider>
|
||||
<HomeStack.Navigator
|
||||
|
||||
@@ -24,6 +24,9 @@ export type StackParamList = {
|
||||
};
|
||||
Playlist: {
|
||||
playlist: BaseItemDto
|
||||
};
|
||||
Details: {
|
||||
item: BaseItemDto
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,4 +54,6 @@ export type AlbumsProps = NativeStackScreenProps<StackParamList, "Albums">;
|
||||
|
||||
export type TracksProps = NativeStackScreenProps<StackParamList, "Tracks">;
|
||||
|
||||
export type GenresProps = NativeStackScreenProps<StackParamList, "Genres">;
|
||||
export type GenresProps = NativeStackScreenProps<StackParamList, "Genres">;
|
||||
|
||||
export type DetailsProps = NativeStackScreenProps<StackParamList, "Details">;
|
||||
Reference in New Issue
Block a user