This commit is contained in:
2025-10-24 11:12:19 +02:00
parent 2839aa3ae8
commit 702e989128
12 changed files with 46 additions and 16 deletions
+3 -7
View File
@@ -354,11 +354,7 @@ const ShareModal = ({ payload }) => {
return (
<AppActionSheet id="Share" webModal={isWeb} onClose={closeSheet}>
{isWeb ? (
<View
ref={modalRef}
collapsable={false}
style={styles.webContainer}
>
<View ref={modalRef} collapsable={false} style={styles.webContainer}>
<View style={styles.webHeader}>
<Text style={styles.webHeading}>{heading}</Text>
<Pressable
@@ -394,13 +390,13 @@ const ShareModal = ({ payload }) => {
</Text>
</Pressable>
<Pressable
{/* <Pressable
onPress={onSystemShare}
style={[styles.webActionButton, styles.webSecondaryButton]}
>
<Feather name="share-2" size={16} color={Palette.white} />
<Text style={styles.webActionLabel}>Partager</Text>
</Pressable>
</Pressable> */}
</View>
</View>
+26 -3
View File
@@ -2,28 +2,51 @@ import { useCallback } from "react";
import { useGlobal } from "reactn";
import { Routes } from "../navigation";
import { navigate } from "../navigation/NavigationService";
import { useUser } from "../providers/UserDataProvider";
import { getStageAction } from "../utils/projectStages";
const useNavigateToMusicDetails = () => {
const [, setTooltip] = useGlobal("_tooltip");
const { selectProject, userProjects = [], currentUID } = useUser();
return useCallback(
({ projectId, songUrl }) => {
({ projectId, songUrl, project = null }) => {
if (!projectId) {
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 (isOwner) {
selectProject?.(projectId);
}
navigate(Routes.MusicDetails, { projectId });
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({
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;
},
[setTooltip]
[currentUID, selectProject, setTooltip, userProjects]
);
};
+4
View File
@@ -70,6 +70,7 @@ const HitParade = () => {
navigateToMusicDetails({
projectId: item.id,
songUrl: item?.songUrl,
project: item,
})
}
/>
@@ -118,6 +119,7 @@ const HitParade = () => {
navigateToMusicDetails({
projectId: item.id,
songUrl: item?.songUrl,
project: item,
})
}
/>
@@ -138,6 +140,7 @@ const HitParade = () => {
navigateToMusicDetails({
projectId: item.id,
songUrl: item?.songUrl,
project: item,
})
}
/>
@@ -205,6 +208,7 @@ const HitParade = () => {
navigateToMusicDetails({
projectId: randomSong.id,
songUrl: randomSong?.songUrl,
project: randomSong,
});
}, [navigateToMusicDetails, topSongs]);
+1
View File
@@ -152,6 +152,7 @@ export default function AllMyList() {
navigateToMusicDetails({
projectId: item.id,
songUrl: item?.songUrl,
project: item,
});
}
};
+1
View File
@@ -208,6 +208,7 @@ const AllMyPlaylist = ({ route }) => {
navigateToMusicDetails({
projectId: p.id,
songUrl: p?.songUrl,
project: p,
})
}
onPressMore={(posTop) => {
+1
View File
@@ -92,6 +92,7 @@ const PlaylistDetails = () => {
navigateToMusicDetails({
projectId: p.id,
songUrl: p?.songUrl,
project: p,
})
}
onPressMore={(posTop) => {
@@ -62,6 +62,7 @@ const LikedMusic = () => {
navigateToMusicDetails({
projectId: item.id,
songUrl: item?.songUrl,
project: item,
})
}
>
@@ -46,6 +46,7 @@ const MyMusic = () => {
navigateToMusicDetails({
projectId: p.id,
songUrl: p?.songUrl,
project: p,
})
}
onPressMore={(posTop) => {
@@ -48,6 +48,7 @@ const SearchResultsList = ({
const didNavigate = navigateToMusicDetails({
projectId: project?.id,
songUrl: project?.songUrl,
project,
});
if (didNavigate) {
+1 -1
View File
@@ -702,7 +702,7 @@ const RecordPlayback = ({ route }) => {
<Page
style={{ flex: 1 }}
width={"100%"}
maxWidth={2000}
maxWidth={800}
containerStyle={{ margin: 0, padding: 0, backgroundColor: Palette.black }}
headerType="NONE"
>
+1
View File
@@ -212,6 +212,7 @@ const Profile = () => {
navigateToMusicDetails({
projectId: item.id,
songUrl: item?.songUrl,
project: item,
})
}
onPressMore={(posTop) => {
+5 -5
View File
@@ -58,17 +58,17 @@ const WritingLyrics = () => {
gap: 12,
}}
>
<BorderGradientButton
maxWidth={500}
onPress={() => createAndNavigate({ hasLyrics: true })}
containerStyle={{ alignSelf: "center", width: "100%" }}
/>
<GradientButton
maxWidth={500}
containerStyle={{ alignSelf: "center", width: "100%" }}
title="Écrire des paroles avec une IA"
onPress={() => createAndNavigate({ hasLyrics: false })}
/>
<BorderGradientButton
maxWidth={500}
onPress={() => createAndNavigate({ hasLyrics: true })}
containerStyle={{ alignSelf: "center", width: "100%" }}
/>
</View>
</View>
</Page>