Partitionvisual (#122)

* first tries with transition entry from native base

* setup moti for mobile and web use

* added Easing linear for consistant scroll scpeed

* pause works !

* added startAt, rewind and fast forward

* created temporary view for partition viewer

* Cleanup for PR

* fix little bug in rewind
This commit is contained in:
Clément Le Bihan
2023-01-25 16:44:00 +09:00
committed by GitHub
parent e971073ac4
commit 2f5c9481aa
12 changed files with 2099 additions and 90 deletions
@@ -0,0 +1,29 @@
import { useTheme, Box, Center } from "native-base";
import React from "react";
import { useQuery } from "react-query";
import LoadingComponent from "../Loading";
import SlideView from "./SlideView";
import API from "../../API";
type PartitionVisualizerProps = {
songId: number;
};
const PartitionVisualizer = ({ songId }: PartitionVisualizerProps) => {
const partitionRessources = useQuery(["partition"], () =>
API.getPartitionRessources(songId)
);
if (!partitionRessources.data) {
return (
<Center style={{ flexGrow: 1 }}>
<LoadingComponent />
</Center>
);
}
return (
<SlideView sources={partitionRessources.data} speed={200} startAt={0} />
);
};
export default PartitionVisualizer;