mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-28 05:58:43 -06:00
rollback queuing thing
This commit is contained in:
@@ -2,24 +2,26 @@ import Track from "../../../components/Global/components/track";
|
||||
import { StackParamList } from "../../../components/types";
|
||||
import { usePlayerContext } from "../../../player/provider";
|
||||
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
|
||||
import { FlatList, SectionList } from "react-native";
|
||||
import { FlatList } from "react-native";
|
||||
import { SafeAreaView, useSafeAreaFrame } from "react-native-safe-area-context";
|
||||
|
||||
export default function Queue({ navigation }: { navigation: NativeStackNavigationProp<StackParamList>}): React.JSX.Element {
|
||||
|
||||
const { width } = useSafeAreaFrame();
|
||||
const { getQueueSectionData, queue, useSkip, nowPlaying } = usePlayerContext();
|
||||
const { queue, useSkip, nowPlaying } = usePlayerContext();
|
||||
|
||||
const scrollIndex = queue.findIndex(queueItem => queueItem.item.Id! === nowPlaying!.item.Id!)
|
||||
|
||||
return (
|
||||
<SafeAreaView edges={["right", "left"]}>
|
||||
<SectionList
|
||||
sections={getQueueSectionData()}
|
||||
<FlatList
|
||||
data={queue}
|
||||
extraData={nowPlaying}
|
||||
getItemLayout={(data, index) => (
|
||||
{ length: width / 9, offset: width / 9 * index, index}
|
||||
)}
|
||||
initialScrollIndex={scrollIndex !== -1 ? scrollIndex: 0}
|
||||
numColumns={1}
|
||||
renderItem={({ item: queueItem, index }) => {
|
||||
return (
|
||||
<Track
|
||||
|
||||
Reference in New Issue
Block a user