minors fixes

This commit is contained in:
Thomas Demirdjian
2025-12-09 09:47:26 +01:00
parent 9c2087c574
commit 3f799af419
8 changed files with 155 additions and 164 deletions
@@ -14,6 +14,7 @@ import { background } from "../../assets";
import FullscreenIntroVideo from "../../components/FullscreenIntroVideo";
import BorderGradientButton from "../../components/BorderGradientButton";
import MusicLandHeader from "../../components/MusicLandHeader";
import AppCheckbox from "../../components/AppCheckbox";
import firebase, {
projectsRef,
serverTimestamp,
@@ -143,6 +144,7 @@ const PlaybackDownload = ({ route }) => {
project?.playbackUrl || null,
);
const [isPublishing, setIsPublishing] = useState(false);
const [hasAcceptedPublication, setHasAcceptedPublication] = useState(true);
const hasShownAfterPlaybackRef = useRef(false);
const { data: video } = useDataFromRef({
@@ -284,6 +286,13 @@ const PlaybackDownload = ({ route }) => {
const handlePublish = async () => {
if (isPublishing) return;
if (!hasAcceptedPublication) {
setTooltip({
type: "error",
text: "Confirme la diffusion sur Musicland et YouTube avant de publier",
});
return;
}
if (!project?.id) {
if (action === "playback") {
setTooltip({
@@ -429,6 +438,19 @@ const PlaybackDownload = ({ route }) => {
<ClubAdvantagesCard style={styles.clubCardSpacing} />
<View style={styles.publishConsentContainer}>
<AppCheckbox
selected={hasAcceptedPublication}
onPress={() =>
setHasAcceptedPublication((prevState) => !prevState)
}
label="J'accepte la diffusion de mon playback sur Musicland et YouTube."
/>
<Text style={styles.publishConsentDescription}>
Cette confirmation est requise avant de lancer la publication.
</Text>
</View>
<BorderGradientButton
title={continueLabel}
onPress={() => {
@@ -438,6 +460,7 @@ const PlaybackDownload = ({ route }) => {
setShowConfirmModal(true);
}
}}
disabled={isPublishing || !hasAcceptedPublication}
containerStyle={styles.continueButton}
/>
</ScrollView>
@@ -491,6 +514,16 @@ const styles = StyleSheet.create({
clubCardSpacing: {
marginTop: 10,
},
publishConsentContainer: {
gap: 6,
marginTop: 2,
},
publishConsentDescription: {
fontFamily: FONT_FAMILY.InterRegular,
fontSize: 13,
color: Palette.white,
opacity: 0.8,
},
continueButton: {
marginTop: 10,
},