monthly money
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user