fixes
This commit is contained in:
@@ -354,11 +354,7 @@ const ShareModal = ({ payload }) => {
|
|||||||
return (
|
return (
|
||||||
<AppActionSheet id="Share" webModal={isWeb} onClose={closeSheet}>
|
<AppActionSheet id="Share" webModal={isWeb} onClose={closeSheet}>
|
||||||
{isWeb ? (
|
{isWeb ? (
|
||||||
<View
|
<View ref={modalRef} collapsable={false} style={styles.webContainer}>
|
||||||
ref={modalRef}
|
|
||||||
collapsable={false}
|
|
||||||
style={styles.webContainer}
|
|
||||||
>
|
|
||||||
<View style={styles.webHeader}>
|
<View style={styles.webHeader}>
|
||||||
<Text style={styles.webHeading}>{heading}</Text>
|
<Text style={styles.webHeading}>{heading}</Text>
|
||||||
<Pressable
|
<Pressable
|
||||||
@@ -394,13 +390,13 @@ const ShareModal = ({ payload }) => {
|
|||||||
</Text>
|
</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|
||||||
<Pressable
|
{/* <Pressable
|
||||||
onPress={onSystemShare}
|
onPress={onSystemShare}
|
||||||
style={[styles.webActionButton, styles.webSecondaryButton]}
|
style={[styles.webActionButton, styles.webSecondaryButton]}
|
||||||
>
|
>
|
||||||
<Feather name="share-2" size={16} color={Palette.white} />
|
<Feather name="share-2" size={16} color={Palette.white} />
|
||||||
<Text style={styles.webActionLabel}>Partager</Text>
|
<Text style={styles.webActionLabel}>Partager</Text>
|
||||||
</Pressable>
|
</Pressable> */}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|||||||
@@ -2,28 +2,51 @@ import { useCallback } from "react";
|
|||||||
import { useGlobal } from "reactn";
|
import { useGlobal } from "reactn";
|
||||||
import { Routes } from "../navigation";
|
import { Routes } from "../navigation";
|
||||||
import { navigate } from "../navigation/NavigationService";
|
import { navigate } from "../navigation/NavigationService";
|
||||||
|
import { useUser } from "../providers/UserDataProvider";
|
||||||
|
import { getStageAction } from "../utils/projectStages";
|
||||||
|
|
||||||
const useNavigateToMusicDetails = () => {
|
const useNavigateToMusicDetails = () => {
|
||||||
const [, setTooltip] = useGlobal("_tooltip");
|
const [, setTooltip] = useGlobal("_tooltip");
|
||||||
|
const { selectProject, userProjects = [], currentUID } = useUser();
|
||||||
|
|
||||||
return useCallback(
|
return useCallback(
|
||||||
({ projectId, songUrl }) => {
|
({ projectId, songUrl, project = null }) => {
|
||||||
if (!projectId) {
|
if (!projectId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resolvedProject =
|
||||||
|
project?.id === projectId
|
||||||
|
? project
|
||||||
|
: userProjects.find((p) => p?.id === projectId) || project || null;
|
||||||
|
const isOwner =
|
||||||
|
resolvedProject?.userId && currentUID
|
||||||
|
? resolvedProject.userId === currentUID
|
||||||
|
: false;
|
||||||
|
|
||||||
if (songUrl != null && songUrl !== "") {
|
if (songUrl != null && songUrl !== "") {
|
||||||
|
if (isOwner) {
|
||||||
|
selectProject?.(projectId);
|
||||||
|
}
|
||||||
navigate(Routes.MusicDetails, { projectId });
|
navigate(Routes.MusicDetails, { projectId });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (resolvedProject && isOwner) {
|
||||||
|
selectProject?.(projectId);
|
||||||
|
const stageAction = getStageAction("beatmaker", resolvedProject);
|
||||||
|
const targetRoute = stageAction?.route || Routes.Compose;
|
||||||
|
navigate(targetRoute, stageAction?.params);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
setTooltip({
|
setTooltip({
|
||||||
type: "error",
|
type: "error",
|
||||||
text: "Les paroles pour cette musique n'ont pas été générées",
|
text: "Cette musique n'est pas encore disponible",
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
[setTooltip]
|
[currentUID, selectProject, setTooltip, userProjects]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ const HitParade = () => {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: item.id,
|
projectId: item.id,
|
||||||
songUrl: item?.songUrl,
|
songUrl: item?.songUrl,
|
||||||
|
project: item,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -118,6 +119,7 @@ const HitParade = () => {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: item.id,
|
projectId: item.id,
|
||||||
songUrl: item?.songUrl,
|
songUrl: item?.songUrl,
|
||||||
|
project: item,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -138,6 +140,7 @@ const HitParade = () => {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: item.id,
|
projectId: item.id,
|
||||||
songUrl: item?.songUrl,
|
songUrl: item?.songUrl,
|
||||||
|
project: item,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -205,6 +208,7 @@ const HitParade = () => {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: randomSong.id,
|
projectId: randomSong.id,
|
||||||
songUrl: randomSong?.songUrl,
|
songUrl: randomSong?.songUrl,
|
||||||
|
project: randomSong,
|
||||||
});
|
});
|
||||||
}, [navigateToMusicDetails, topSongs]);
|
}, [navigateToMusicDetails, topSongs]);
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ export default function AllMyList() {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: item.id,
|
projectId: item.id,
|
||||||
songUrl: item?.songUrl,
|
songUrl: item?.songUrl,
|
||||||
|
project: item,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ const AllMyPlaylist = ({ route }) => {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: p.id,
|
projectId: p.id,
|
||||||
songUrl: p?.songUrl,
|
songUrl: p?.songUrl,
|
||||||
|
project: p,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onPressMore={(posTop) => {
|
onPressMore={(posTop) => {
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ const PlaylistDetails = () => {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: p.id,
|
projectId: p.id,
|
||||||
songUrl: p?.songUrl,
|
songUrl: p?.songUrl,
|
||||||
|
project: p,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onPressMore={(posTop) => {
|
onPressMore={(posTop) => {
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ const LikedMusic = () => {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: item.id,
|
projectId: item.id,
|
||||||
songUrl: item?.songUrl,
|
songUrl: item?.songUrl,
|
||||||
|
project: item,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const MyMusic = () => {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: p.id,
|
projectId: p.id,
|
||||||
songUrl: p?.songUrl,
|
songUrl: p?.songUrl,
|
||||||
|
project: p,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onPressMore={(posTop) => {
|
onPressMore={(posTop) => {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ const SearchResultsList = ({
|
|||||||
const didNavigate = navigateToMusicDetails({
|
const didNavigate = navigateToMusicDetails({
|
||||||
projectId: project?.id,
|
projectId: project?.id,
|
||||||
songUrl: project?.songUrl,
|
songUrl: project?.songUrl,
|
||||||
|
project,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (didNavigate) {
|
if (didNavigate) {
|
||||||
|
|||||||
@@ -702,7 +702,7 @@ const RecordPlayback = ({ route }) => {
|
|||||||
<Page
|
<Page
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
width={"100%"}
|
width={"100%"}
|
||||||
maxWidth={2000}
|
maxWidth={800}
|
||||||
containerStyle={{ margin: 0, padding: 0, backgroundColor: Palette.black }}
|
containerStyle={{ margin: 0, padding: 0, backgroundColor: Palette.black }}
|
||||||
headerType="NONE"
|
headerType="NONE"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ const Profile = () => {
|
|||||||
navigateToMusicDetails({
|
navigateToMusicDetails({
|
||||||
projectId: item.id,
|
projectId: item.id,
|
||||||
songUrl: item?.songUrl,
|
songUrl: item?.songUrl,
|
||||||
|
project: item,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onPressMore={(posTop) => {
|
onPressMore={(posTop) => {
|
||||||
|
|||||||
@@ -58,17 +58,17 @@ const WritingLyrics = () => {
|
|||||||
gap: 12,
|
gap: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<BorderGradientButton
|
|
||||||
maxWidth={500}
|
|
||||||
onPress={() => createAndNavigate({ hasLyrics: true })}
|
|
||||||
containerStyle={{ alignSelf: "center", width: "100%" }}
|
|
||||||
/>
|
|
||||||
<GradientButton
|
<GradientButton
|
||||||
maxWidth={500}
|
maxWidth={500}
|
||||||
containerStyle={{ alignSelf: "center", width: "100%" }}
|
containerStyle={{ alignSelf: "center", width: "100%" }}
|
||||||
title="Écrire des paroles avec une IA"
|
title="Écrire des paroles avec une IA"
|
||||||
onPress={() => createAndNavigate({ hasLyrics: false })}
|
onPress={() => createAndNavigate({ hasLyrics: false })}
|
||||||
/>
|
/>
|
||||||
|
<BorderGradientButton
|
||||||
|
maxWidth={500}
|
||||||
|
onPress={() => createAndNavigate({ hasLyrics: true })}
|
||||||
|
containerStyle={{ alignSelf: "center", width: "100%" }}
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
Reference in New Issue
Block a user