Merge remote-tracking branch 'origin/jacques'
# Conflicts: # functions/helpers/gemini.js # functions/src/heygen.js # functions/src/lyrics.js # functions/src/music.js # src/screens/CreatePassword.js # src/screens/Home/Home.js # src/screens/Playback/PlaybackAi.js # src/screens/Production/PlaybackDownload.js
This commit is contained in:
@@ -3,7 +3,7 @@ import { VideoView, useVideoPlayer } from 'expo-video'
|
||||
import React, { useEffect, useMemo, useState } from 'react'
|
||||
import { Pressable, StyleSheet, Text, View } from 'react-native'
|
||||
|
||||
const BackgroundVideo = ({ source }) => {
|
||||
const BackgroundVideo = ({ source, silent = false }) => {
|
||||
const [muted, setMuted] = useState(false)
|
||||
const resolvedSource = useMemo(
|
||||
() => (source ? (typeof source === 'string' ? { uri: source } : source) : null),
|
||||
@@ -20,9 +20,9 @@ const BackgroundVideo = ({ source }) => {
|
||||
return
|
||||
}
|
||||
|
||||
player.muted = muted
|
||||
player.muted = silent || muted
|
||||
player.play()
|
||||
}, [muted, player, source])
|
||||
}, [muted, player, silent, source])
|
||||
|
||||
if (!source) {
|
||||
return null
|
||||
@@ -37,19 +37,23 @@ const BackgroundVideo = ({ source }) => {
|
||||
style={StyleSheet.absoluteFill}
|
||||
/>
|
||||
<View pointerEvents="none" style={styles.scrim} />
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={muted ? 'Activer le son' : 'Couper le son'}
|
||||
onPress={() => setMuted((currentMuted) => !currentMuted)}
|
||||
style={({ pressed }) => [styles.soundButton, pressed && styles.soundButtonPressed]}
|
||||
>
|
||||
<MaterialIcons
|
||||
name={muted ? 'volume-off' : 'volume-up'}
|
||||
size={20}
|
||||
color="#FFFFFF"
|
||||
/>
|
||||
<Text style={styles.soundButtonText}>{muted ? 'Activer le son' : 'Couper le son'}</Text>
|
||||
</Pressable>
|
||||
{!silent ? (
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={muted ? 'Activer le son' : 'Couper le son'}
|
||||
onPress={() => setMuted((currentMuted) => !currentMuted)}
|
||||
style={({ pressed }) => [styles.soundButton, pressed && styles.soundButtonPressed]}
|
||||
>
|
||||
<MaterialIcons
|
||||
name={muted ? 'volume-off' : 'volume-up'}
|
||||
size={20}
|
||||
color="#FFFFFF"
|
||||
/>
|
||||
<Text style={styles.soundButtonText}>
|
||||
{muted ? 'Activer le son' : 'Couper le son'}
|
||||
</Text>
|
||||
</Pressable>
|
||||
) : null}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Pressable, StyleSheet, Text, View } from 'react-native'
|
||||
|
||||
import { resolveMediaUri } from '../utils/resolveMediaUri'
|
||||
|
||||
const BackgroundVideo = ({ source, soundButtonStyle = null }) => {
|
||||
const BackgroundVideo = ({ source, soundButtonStyle = null, silent = false }) => {
|
||||
const videoRef = useRef(null)
|
||||
const [uri, setUri] = useState(null)
|
||||
const [muted, setMuted] = useState(false)
|
||||
@@ -63,11 +63,11 @@ const BackgroundVideo = ({ source, soundButtonStyle = null }) => {
|
||||
return
|
||||
}
|
||||
|
||||
video.muted = muted
|
||||
video.muted = silent || muted
|
||||
if (video.paused) {
|
||||
video.play()?.catch?.(() => {})
|
||||
}
|
||||
}, [muted])
|
||||
}, [muted, silent])
|
||||
|
||||
if (!uri) {
|
||||
return null
|
||||
@@ -82,28 +82,32 @@ const BackgroundVideo = ({ source, soundButtonStyle = null }) => {
|
||||
playsInline
|
||||
autoPlay
|
||||
loop
|
||||
muted={muted}
|
||||
muted={silent || muted}
|
||||
controls={false}
|
||||
/>
|
||||
<View pointerEvents="none" style={styles.scrim} />
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={muted ? 'Activer le son' : 'Couper le son'}
|
||||
onPress={() => setMuted((currentMuted) => !currentMuted)}
|
||||
style={({ hovered, pressed }) => [
|
||||
styles.soundButton,
|
||||
soundButtonStyle,
|
||||
hovered && styles.soundButtonHovered,
|
||||
pressed && styles.soundButtonPressed,
|
||||
]}
|
||||
>
|
||||
<MaterialIcons
|
||||
name={muted ? 'volume-off' : 'volume-up'}
|
||||
size={20}
|
||||
color="#FFFFFF"
|
||||
/>
|
||||
<Text style={styles.soundButtonText}>{muted ? 'Activer le son' : 'Couper le son'}</Text>
|
||||
</Pressable>
|
||||
{!silent ? (
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={muted ? 'Activer le son' : 'Couper le son'}
|
||||
onPress={() => setMuted((currentMuted) => !currentMuted)}
|
||||
style={({ hovered, pressed }) => [
|
||||
styles.soundButton,
|
||||
soundButtonStyle,
|
||||
hovered && styles.soundButtonHovered,
|
||||
pressed && styles.soundButtonPressed,
|
||||
]}
|
||||
>
|
||||
<MaterialIcons
|
||||
name={muted ? 'volume-off' : 'volume-up'}
|
||||
size={20}
|
||||
color="#FFFFFF"
|
||||
/>
|
||||
<Text style={styles.soundButtonText}>
|
||||
{muted ? 'Activer le son' : 'Couper le son'}
|
||||
</Text>
|
||||
</Pressable>
|
||||
) : null}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useCallback, useEffect, useRef } from 'react'
|
||||
import { View, Pressable, Text } from 'react-native'
|
||||
import { Pressable, StyleSheet, Text, View } from 'react-native'
|
||||
import { VideoView, useVideoPlayer } from 'expo-video'
|
||||
import { videos } from '../assets'
|
||||
import { Portal } from '@gorhom/portal'
|
||||
@@ -96,7 +96,6 @@ const FullscreenIntroVideo = ({
|
||||
pointerEvents="box-none"
|
||||
style={{
|
||||
position: 'absolute',
|
||||
paddingHorizontal: 10,
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
@@ -111,15 +110,7 @@ const FullscreenIntroVideo = ({
|
||||
player={player}
|
||||
nativeControls={false}
|
||||
contentFit={contentFit}
|
||||
height="100%"
|
||||
width="100%"
|
||||
// style={{
|
||||
// position: "absolute",
|
||||
// top: 0,
|
||||
// bottom: 0,
|
||||
// left: 24,
|
||||
// right: 24,
|
||||
// }}
|
||||
style={StyleSheet.absoluteFill}
|
||||
/>
|
||||
{allowSkip ? (
|
||||
<Pressable
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import React, { memo } from 'react'
|
||||
import { Image, StyleSheet, View } from 'react-native'
|
||||
|
||||
const SpaceLogoCard = ({ source, accessibilityLabel, imageStyle = null }) => (
|
||||
<View style={styles.card}>
|
||||
<Image
|
||||
source={source}
|
||||
accessibilityLabel={accessibilityLabel}
|
||||
resizeMode="contain"
|
||||
style={[styles.image, imageStyle]}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
card: {
|
||||
width: '100%',
|
||||
maxWidth: 280,
|
||||
aspectRatio: 16 / 9,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 20,
|
||||
overflow: 'hidden',
|
||||
},
|
||||
image: {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
},
|
||||
})
|
||||
|
||||
export default memo(SpaceLogoCard)
|
||||
@@ -0,0 +1,169 @@
|
||||
import DateTimePicker from '@react-native-community/datetimepicker'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { Modal, Platform, Pressable, StyleSheet, Text, View } from 'react-native'
|
||||
import { Palette } from '../../styles'
|
||||
import { FONT_FAMILY } from '../../styles/Fonts'
|
||||
|
||||
const getDefaultBirthDate = () => {
|
||||
const date = new Date()
|
||||
date.setFullYear(date.getFullYear() - 18)
|
||||
return date
|
||||
}
|
||||
|
||||
const NativeDateModal = ({ visible, onClose, onValidate, initialDate, language = 'fr' }) => {
|
||||
const [selectedDate, setSelectedDate] = useState(initialDate || getDefaultBirthDate())
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
setSelectedDate(initialDate || getDefaultBirthDate())
|
||||
}
|
||||
}, [initialDate, visible])
|
||||
|
||||
const handleChange = (event, date) => {
|
||||
if (Platform.OS === 'android') {
|
||||
if (event.type === 'dismissed') {
|
||||
onClose()
|
||||
return
|
||||
}
|
||||
|
||||
if (date) {
|
||||
onValidate(date)
|
||||
}
|
||||
onClose()
|
||||
return
|
||||
}
|
||||
|
||||
if (date) {
|
||||
setSelectedDate(date)
|
||||
}
|
||||
}
|
||||
|
||||
if (Platform.OS === 'android') {
|
||||
return visible ? (
|
||||
<DateTimePicker
|
||||
testID="dateTimePicker"
|
||||
value={initialDate || getDefaultBirthDate()}
|
||||
mode="date"
|
||||
display="default"
|
||||
onChange={handleChange}
|
||||
maximumDate={new Date()}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
visible={visible}
|
||||
transparent
|
||||
animationType="fade"
|
||||
presentationStyle="overFullScreen"
|
||||
onRequestClose={onClose}
|
||||
>
|
||||
<View style={styles.overlay}>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Fermer le sélecteur de date"
|
||||
style={StyleSheet.absoluteFill}
|
||||
onPress={onClose}
|
||||
/>
|
||||
<View style={styles.card}>
|
||||
<Text style={styles.title}>Date de naissance</Text>
|
||||
<DateTimePicker
|
||||
testID="dateTimePicker"
|
||||
value={selectedDate}
|
||||
mode="date"
|
||||
display="spinner"
|
||||
locale={language === 'en' ? 'en-GB' : 'fr-FR'}
|
||||
maximumDate={new Date()}
|
||||
themeVariant="dark"
|
||||
onChange={handleChange}
|
||||
style={styles.picker}
|
||||
/>
|
||||
<View style={styles.actions}>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
onPress={onClose}
|
||||
style={({ pressed }) => [styles.button, styles.cancelButton, pressed && styles.pressed]}
|
||||
>
|
||||
<Text style={styles.cancelText}>Annuler</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
onPress={() => {
|
||||
onValidate(selectedDate)
|
||||
onClose()
|
||||
}}
|
||||
style={({ pressed }) => [styles.button, styles.validateButton, pressed && styles.pressed]}
|
||||
>
|
||||
<Text style={styles.validateText}>Valider</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
overlay: {
|
||||
flex: 1,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
paddingHorizontal: 24,
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.72)',
|
||||
},
|
||||
card: {
|
||||
width: '100%',
|
||||
maxWidth: 360,
|
||||
padding: 20,
|
||||
borderRadius: 20,
|
||||
backgroundColor: Palette.lightPurple,
|
||||
borderWidth: 1,
|
||||
borderColor: 'rgba(255, 255, 255, 0.14)',
|
||||
},
|
||||
title: {
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterSemiBold,
|
||||
fontSize: 18,
|
||||
textAlign: 'center',
|
||||
marginBottom: 6,
|
||||
},
|
||||
picker: {
|
||||
width: '100%',
|
||||
height: 180,
|
||||
},
|
||||
actions: {
|
||||
flexDirection: 'row',
|
||||
gap: 12,
|
||||
marginTop: 8,
|
||||
},
|
||||
button: {
|
||||
flex: 1,
|
||||
minHeight: 46,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
borderRadius: 12,
|
||||
},
|
||||
cancelButton: {
|
||||
borderWidth: 1,
|
||||
borderColor: 'rgba(255, 255, 255, 0.28)',
|
||||
},
|
||||
validateButton: {
|
||||
backgroundColor: Palette.white,
|
||||
},
|
||||
cancelText: {
|
||||
color: Palette.white,
|
||||
fontFamily: FONT_FAMILY.InterSemiBold,
|
||||
fontSize: 15,
|
||||
},
|
||||
validateText: {
|
||||
color: Palette.darkPurple,
|
||||
fontFamily: FONT_FAMILY.InterSemiBold,
|
||||
fontSize: 15,
|
||||
},
|
||||
pressed: {
|
||||
opacity: 0.72,
|
||||
},
|
||||
})
|
||||
|
||||
export default NativeDateModal
|
||||
Reference in New Issue
Block a user