monthly money

This commit is contained in:
Thomas Demirdjian
2025-10-31 17:31:10 +01:00
parent 6f330c1df8
commit 0dd0fa5ab7
10 changed files with 299 additions and 1 deletions
+22
View File
@@ -38,6 +38,10 @@ import {
getSegmentMeta,
normalizeStructureType,
} from "../../utils/songStructure";
import {
createMusicSharePayload,
openShareSheet,
} from "../../utils/shareSheet";
// 20 secondes
const timeBeforeIncrement = 20000;
@@ -108,6 +112,19 @@ const MusicDetails = ({ route }) => {
};
}, [trackId, songUrl, title, artist, coverUrl, projectId]);
const sharePayload = useMemo(() => {
return createMusicSharePayload({
projectId,
title,
artist,
});
}, [artist, projectId, title]);
const handleShare = useCallback(() => {
if (!sharePayload) return;
openShareSheet(sharePayload);
}, [sharePayload]);
const handleReport = useCallback(() => {
if (!projectId) return;
SheetManager.show("Report", {
@@ -147,15 +164,20 @@ const MusicDetails = ({ route }) => {
onAddToPlaylist: handleAddToPlaylist,
onDownload: handleDownload,
downloadDisabled: !songUrl,
onShare: sharePayload ? handleShare : null,
sharePayload,
shareDisabled: !sharePayload,
},
});
}, [
handleAddToPlaylist,
handleDownload,
handleReport,
handleShare,
owner?.id,
project?.userId,
projectId,
sharePayload,
songUrl,
title,
]);
+5
View File
@@ -243,16 +243,21 @@ const MusicDetails = ({ route }) => {
onAddToPlaylist: handleAddToPlaylist,
onDownload: handleDownload,
downloadDisabled: isDownloading || !songUrl,
onShare: sharePayload ? handleShare : null,
sharePayload,
shareDisabled: !sharePayload,
},
});
}, [
handleAddToPlaylist,
handleDownload,
handleReport,
handleShare,
isDownloading,
owner?.id,
project?.userId,
projectId,
sharePayload,
songUrl,
title,
]);