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 = () =>
|
const protectedRoutes = () =>
|
||||||
({
|
({
|
||||||
Home: {
|
Home: {
|
||||||
component: HomeView,
|
component: DiscoveryView,
|
||||||
options: { headerShown: false },
|
options: { headerShown: false },
|
||||||
link: '/',
|
link: '/',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -151,11 +151,7 @@ const PartitionMagic = ({ songID, onEndReached, onError, onReady }: ParitionMagi
|
|||||||
{!isLoading && !isError && (
|
{!isLoading && !isError && (
|
||||||
<SvgContainer
|
<SvgContainer
|
||||||
url={getSVGURL(songID)}
|
url={getSVGURL(songID)}
|
||||||
onReady={() => {
|
onReady={onReady}
|
||||||
console.log('ready');
|
|
||||||
console.log(partitionDims);
|
|
||||||
onReady();
|
|
||||||
}}
|
|
||||||
style={{
|
style={{
|
||||||
aspectRatio: partitionDims[0] / partitionDims[1],
|
aspectRatio: partitionDims[0] / partitionDims[1],
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
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';
|
import { SvgCssUri } from 'react-native-svg/css';
|
||||||
|
|
||||||
type SvgContainerProps = {
|
type SvgContainerProps = {
|
||||||
@@ -10,7 +10,9 @@ type SvgContainerProps = {
|
|||||||
|
|
||||||
export const SvgContainer = ({ url, onReady, style }: SvgContainerProps) => {
|
export const SvgContainer = ({ url, onReady, style }: SvgContainerProps) => {
|
||||||
if (Platform.OS === 'web') {
|
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 (
|
return (
|
||||||
<SvgCssUri
|
<SvgCssUri
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ export const PianoCC = createContext<PianoCanvasContext>({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
|
const PlayView = ({ songId, route }: RouteProps<PlayViewProps>) => {
|
||||||
songId = 4;
|
|
||||||
const [type, setType] = useState<'practice' | 'normal'>();
|
const [type, setType] = useState<'practice' | 'normal'>();
|
||||||
const accessToken = useSelector((state: RootState) => state.user.accessToken);
|
const accessToken = useSelector((state: RootState) => state.user.accessToken);
|
||||||
const navigation = useNavigation();
|
const navigation = useNavigation();
|
||||||
|
|||||||
Reference in New Issue
Block a user