|
|
@ -7,7 +7,7 @@ import * as AuthSession from 'expo-auth-session';
|
|
|
|
import * as WebBrowser from 'expo-web-browser';
|
|
|
|
import * as WebBrowser from 'expo-web-browser';
|
|
|
|
import { makeRedirectUri, useAuthRequest } from 'expo-auth-session';
|
|
|
|
import { makeRedirectUri, useAuthRequest } from 'expo-auth-session';
|
|
|
|
import { registerUser } from '../redux/thunk/authThunk';
|
|
|
|
import { registerUser } from '../redux/thunk/authThunk';
|
|
|
|
import { useDispatch } from 'react-redux';
|
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
import { Audio } from 'expo-av';
|
|
|
|
import { Audio } from 'expo-av';
|
|
|
|
import { CredentialsRegister } from '../redux/actions/userActions';
|
|
|
|
import { CredentialsRegister } from '../redux/actions/userActions';
|
|
|
|
import { Buffer } from 'buffer';
|
|
|
|
import { Buffer } from 'buffer';
|
|
|
@ -41,6 +41,8 @@ export default function InscriptionPage() {
|
|
|
|
const navigation = useNavigation();
|
|
|
|
const navigation = useNavigation();
|
|
|
|
const [spotifyToken, setSpotifyToken] = useState('');
|
|
|
|
const [spotifyToken, setSpotifyToken] = useState('');
|
|
|
|
const [spotifyID, setSpotifyIds] = useState('')
|
|
|
|
const [spotifyID, setSpotifyIds] = useState('')
|
|
|
|
|
|
|
|
const failedSignup = useSelector(state => state.userReducer.failedSignup);
|
|
|
|
|
|
|
|
|
|
|
|
async function playSound() {
|
|
|
|
async function playSound() {
|
|
|
|
console.log('Loading Sound');
|
|
|
|
console.log('Loading Sound');
|
|
|
|
const { sound } = await Audio.Sound.createAsync(
|
|
|
|
const { sound } = await Audio.Sound.createAsync(
|
|
|
@ -238,20 +240,26 @@ export default function InscriptionPage() {
|
|
|
|
</Text>
|
|
|
|
</Text>
|
|
|
|
<Image source={require("../assets/icons/Logo_White_Flad.png")} style={styles.imageLogo} />
|
|
|
|
<Image source={require("../assets/icons/Logo_White_Flad.png")} style={styles.imageLogo} />
|
|
|
|
<Text style={styles.text}>S'INSCRIRE</Text>
|
|
|
|
<Text style={styles.text}>S'INSCRIRE</Text>
|
|
|
|
<View>
|
|
|
|
{failedSignup && (
|
|
|
|
|
|
|
|
<Text style={styles.textError}>Email ou mot de passe incorrect!</Text>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
<View style={{ marginTop: 7 }}>
|
|
|
|
<TextInput style={[styles.input, styles.shadow]} placeholder="Username"
|
|
|
|
<TextInput style={[styles.input, styles.shadow]} placeholder="Username"
|
|
|
|
|
|
|
|
placeholderTextColor="#B8B4B8"
|
|
|
|
value={username}
|
|
|
|
value={username}
|
|
|
|
onChangeText={setUsername} />
|
|
|
|
onChangeText={setUsername} />
|
|
|
|
<Image source={require('../assets/icons/icons/User.png')} style={styles.iconUser} />
|
|
|
|
<Image source={require('../assets/icons/icons/User.png')} style={styles.iconUser} />
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
<View>
|
|
|
|
<View>
|
|
|
|
<TextInput style={[styles.input, styles.shadow]} placeholder="Email"
|
|
|
|
<TextInput style={[styles.input, styles.shadow]} placeholder="Email"
|
|
|
|
|
|
|
|
placeholderTextColor="#B8B4B8"
|
|
|
|
value={email}
|
|
|
|
value={email}
|
|
|
|
onChangeText={setEmail} />
|
|
|
|
onChangeText={setEmail} />
|
|
|
|
<Image source={require('../assets/icons/icons/lock.png')} style={styles.iconLock} />
|
|
|
|
<Image source={require('../assets/icons/icons/lock.png')} style={styles.iconLock} />
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
<View>
|
|
|
|
<View>
|
|
|
|
<TextInput style={[styles.input, styles.shadow]} placeholder="Password"
|
|
|
|
<TextInput style={[styles.input, styles.shadow]} placeholder="Password"
|
|
|
|
|
|
|
|
placeholderTextColor="#B8B4B8"
|
|
|
|
value={password} secureTextEntry={true}
|
|
|
|
value={password} secureTextEntry={true}
|
|
|
|
onChangeText={setPassword} />
|
|
|
|
onChangeText={setPassword} />
|
|
|
|
<Image source={require('../assets/icons/icons/lock.png')} style={styles.iconLock} />
|
|
|
|
<Image source={require('../assets/icons/icons/lock.png')} style={styles.iconLock} />
|
|
|
@ -307,6 +315,12 @@ const styles = StyleSheet.create({
|
|
|
|
height: normalize(100),
|
|
|
|
height: normalize(100),
|
|
|
|
borderRadius: 21
|
|
|
|
borderRadius: 21
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
textError: {
|
|
|
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
|
|
|
alignSelf: "center",
|
|
|
|
|
|
|
|
color: "red",
|
|
|
|
|
|
|
|
fontWeight: 'bold'
|
|
|
|
|
|
|
|
},
|
|
|
|
buttonImage: {
|
|
|
|
buttonImage: {
|
|
|
|
width: normalize(46),
|
|
|
|
width: normalize(46),
|
|
|
|
height: normalize(46),
|
|
|
|
height: normalize(46),
|
|
|
@ -324,7 +338,7 @@ const styles = StyleSheet.create({
|
|
|
|
fontSize: normalize(29),
|
|
|
|
fontSize: normalize(29),
|
|
|
|
alignSelf: 'center',
|
|
|
|
alignSelf: 'center',
|
|
|
|
color: 'white',
|
|
|
|
color: 'white',
|
|
|
|
marginBottom: 15
|
|
|
|
marginBottom: 8
|
|
|
|
},
|
|
|
|
},
|
|
|
|
textIntoButton: {
|
|
|
|
textIntoButton: {
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontWeight: 'bold',
|
|
|
|