work on PlayView is almost done everything works fine the gameplay makes the mobile crash but it will be fixed later

This commit is contained in:
Clément Le Bihan
2023-11-28 00:00:05 +01:00
parent 36041369db
commit 4de420e4dc
4 changed files with 6 additions and 9 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ const removeMe = () => '';
const protectedRoutes = () =>
({
Home: {
component: HomeView,
component: DiscoveryView,
options: { headerShown: false },
link: '/',
},
+1 -5
View File
@@ -151,11 +151,7 @@ const PartitionMagic = ({ songID, onEndReached, onError, onReady }: ParitionMagi
{!isLoading && !isError && (
<SvgContainer
url={getSVGURL(songID)}
onReady={() => {
console.log('ready');
console.log(partitionDims);
onReady();
}}
onReady={onReady}
style={{
aspectRatio: partitionDims[0] / partitionDims[1],
}}
+4 -2
View File
@@ -1,5 +1,5 @@
import React from 'react';
import { ViewStyle, ImageBackground, Platform } from 'react-native';
import { ViewStyle, Image, Platform, StyleProp, ImageStyle } from 'react-native';
import { SvgCssUri } from 'react-native-svg/css';
type SvgContainerProps = {
@@ -10,7 +10,9 @@ type SvgContainerProps = {
export const SvgContainer = ({ url, onReady, style }: SvgContainerProps) => {
if (Platform.OS === 'web') {
return <ImageBackground source={{ uri: url }} onLoad={onReady} style={style} />;
return (
<Image source={{ uri: url }} onLoad={onReady} style={style as StyleProp<ImageStyle>} />
);
}
return (
<SvgCssUri
-1
View File
@@ -79,7 +79,6 @@ export const PianoCC = createContext<PianoCanvasContext>({
});
const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
songId = 4;
const [type, setType] = useState<'practice' | 'normal'>();
const accessToken = useSelector((state: RootState) => state.user.accessToken);
const navigation = useNavigation();