feat: fixes

This commit is contained in:
2025-12-10 11:52:25 +01:00
parent d92303dd8a
commit bff35bb118
7 changed files with 348 additions and 15 deletions
+41 -1
View File
@@ -8,9 +8,12 @@ import {
StyleSheet,
Text,
View,
Alert,
} from "react-native";
import useMinuit from "react-native-minuit/src/hooks/useMinuit.js";
import * as FileSystem from "expo-file-system";
import * as Sharing from "expo-sharing";
import AppCheckbox from "../../components/AppCheckbox";
import BorderGradientButton from "../../components/BorderGradientButton";
import MusicLandHeader from "../../components/MusicLandHeader";
import Page from "../../layouts/Page";
@@ -38,9 +41,11 @@ const SongDownload = ({ route }) => {
} = route?.params || {};
const { selectedProject, updateProjectData, hasActiveSubscription } =
useUser();
const { setTooltip } = useMinuit();
const { setLoading } = useGlobalLoading();
const [isDownloading, setIsDownloading] = useState(false);
const [showConfirmModal, setShowConfirmModal] = useState(false);
const [hasAcceptedPublication, setHasAcceptedPublication] = useState(true);
const projectForStage = useMemo(
() => routeProject || selectedProject || null,
@@ -130,12 +135,26 @@ const SongDownload = ({ route }) => {
]);
const handleContinue = useCallback(() => {
if (!hasAcceptedPublication) {
if (setTooltip) {
setTooltip({
type: "error",
text: "Confirme la diffusion sur Musicland et YouTube avant de continuer",
});
} else {
Alert.alert(
"Confirmation requise",
"Confirme la diffusion sur Musicland et YouTube avant de continuer"
);
}
return;
}
if (hasActiveSubscription) {
continueFlow();
return;
}
setShowConfirmModal(true);
}, [continueFlow, hasActiveSubscription]);
}, [continueFlow, hasAcceptedPublication, hasActiveSubscription, setTooltip]);
const handleDownload = useCallback(async () => {
const downloadUrl =
@@ -401,6 +420,17 @@ const SongDownload = ({ route }) => {
<ClubAdvantagesCard style={styles.clubCardSpacing} />
<View style={styles.consentContainer}>
<AppCheckbox
selected={hasAcceptedPublication}
onPress={() => setHasAcceptedPublication((prev) => !prev)}
label="J'accepte la diffusion de mon contenu sur Musicland et YouTube."
/>
<Text style={styles.consentDescription}>
Cette confirmation est requise pour continuer.
</Text>
</View>
<BorderGradientButton
title={
hasActiveSubscription
@@ -438,6 +468,16 @@ const styles = StyleSheet.create({
scrollContent: {
paddingBottom: gutters * 2.6,
},
consentContainer: {
gap: 6,
marginTop: 10,
},
consentDescription: {
fontSize: 13,
fontFamily: FONT_FAMILY.InterRegular,
color: Palette.white,
opacity: 0.8,
},
coverRow: {
flexDirection: isWeb ? "row" : "column",
alignItems: "center",