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:
@@ -41,7 +41,7 @@ const removeMe = () => '';
|
||||
const protectedRoutes = () =>
|
||||
({
|
||||
Home: {
|
||||
component: HomeView,
|
||||
component: DiscoveryView,
|
||||
options: { headerShown: false },
|
||||
link: '/',
|
||||
},
|
||||
|
||||
@@ -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],
|
||||
}}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user