mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-22 09:58:46 -05:00
swipeable now in the queue
This commit is contained in:
@@ -6,6 +6,4 @@ import { ImageType } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
export const useItemImage = (itemId: string, imageType?: ImageType, width?: number, height?: number) => useQuery({
|
||||
queryKey: [QueryKeys.ItemImage, itemId, imageType, width, height],
|
||||
queryFn: () => fetchItemImage(itemId, imageType, width, height),
|
||||
retry: 3,
|
||||
staleTime: 1000
|
||||
});
|
||||
@@ -5,6 +5,7 @@ import { usePlayerContext } from "../../../player/provider";
|
||||
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
|
||||
import { useSafeAreaFrame } from "react-native-safe-area-context";
|
||||
import DraggableFlatList from "react-native-draggable-flatlist";
|
||||
import SwipeableItem from "react-native-swipeable-item";
|
||||
|
||||
export default function Queue({ navigation }: { navigation: NativeStackNavigationProp<StackParamList>}): React.JSX.Element {
|
||||
|
||||
@@ -44,19 +45,30 @@ export default function Queue({ navigation }: { navigation: NativeStackNavigatio
|
||||
const index = getIndex();
|
||||
|
||||
return (
|
||||
<Track
|
||||
navigation={navigation}
|
||||
track={queueItem.item}
|
||||
tracklist={queue.map((track) => track.item)}
|
||||
index={getIndex()}
|
||||
showArtwork
|
||||
onPress={() => {
|
||||
console.debug(`Skipping to index ${index}`)
|
||||
useSkip.mutate(index);
|
||||
}}
|
||||
onLongPress={drag}
|
||||
isNested
|
||||
/>
|
||||
<SwipeableItem
|
||||
key={index}
|
||||
item={queueItem}
|
||||
renderUnderlayLeft={() => (
|
||||
<Icon name="close" onPress={() => {
|
||||
|
||||
}} />
|
||||
)}
|
||||
>
|
||||
|
||||
<Track
|
||||
navigation={navigation}
|
||||
track={queueItem.item}
|
||||
tracklist={queue.map((track) => track.item)}
|
||||
index={getIndex()}
|
||||
showArtwork
|
||||
onPress={() => {
|
||||
console.debug(`Skipping to index ${index}`)
|
||||
useSkip.mutate(index);
|
||||
}}
|
||||
onLongPress={drag}
|
||||
isNested
|
||||
/>
|
||||
</SwipeableItem>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
Generated
+15
@@ -41,6 +41,7 @@
|
||||
"react-native-reanimated": "^3.16.3",
|
||||
"react-native-safe-area-context": "^4.11.1",
|
||||
"react-native-screens": "^3.34.0",
|
||||
"react-native-swipeable-item": "^2.0.9",
|
||||
"react-native-text-ticker": "^1.14.0",
|
||||
"react-native-track-player": "^4.1.1",
|
||||
"react-native-url-polyfill": "^2.0.0",
|
||||
@@ -15793,6 +15794,20 @@
|
||||
"react-native": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/react-native-swipeable-item": {
|
||||
"version": "2.0.9",
|
||||
"resolved": "https://registry.npmjs.org/react-native-swipeable-item/-/react-native-swipeable-item-2.0.9.tgz",
|
||||
"integrity": "sha512-NUBX5Xs8cYCU7lWj5O/NtY7kq8I9dIo3eQVtnSbfYU39RXi/n0TpRqpmaQTPM6sE5EQR/BcygD4jwDcrE5h/sQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/preset-typescript": "^7.17.12"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react-native": ">=0.64.0",
|
||||
"react-native-gesture-handler": ">=2.0.0",
|
||||
"react-native-reanimated": ">=2.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-native-text-ticker": {
|
||||
"version": "1.14.0",
|
||||
"resolved": "https://registry.npmjs.org/react-native-text-ticker/-/react-native-text-ticker-1.14.0.tgz",
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
"react-native-reanimated": "^3.16.3",
|
||||
"react-native-safe-area-context": "^4.11.1",
|
||||
"react-native-screens": "^3.34.0",
|
||||
"react-native-swipeable-item": "^2.0.9",
|
||||
"react-native-text-ticker": "^1.14.0",
|
||||
"react-native-track-player": "^4.1.1",
|
||||
"react-native-url-polyfill": "^2.0.0",
|
||||
|
||||
Reference in New Issue
Block a user