Merge pull request 'Login_Connection_View' (#5) from Login_Connection_View into master
Reviewed-on: #5pull/9/head
@ -1,27 +1,24 @@
|
|||||||
import { LinearGradient } from 'expo-linear-gradient';
|
|
||||||
import { StatusBar } from 'expo-status-bar';
|
|
||||||
import { useState, useTransition } from 'react';
|
|
||||||
import FavoritePage from './screens/favoritePage';
|
|
||||||
import { cards as cardArray } from './data/data'
|
|
||||||
import Navigation from './navigation/Navigation';
|
import Navigation from './navigation/Navigation';
|
||||||
import { NavigationContainer } from '@react-navigation/native';
|
import { StyleSheet,SafeAreaView } from 'react-native';
|
||||||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||||
import { Animated, Dimensions, ImageBackground, StyleSheet, Text, View } from 'react-native';
|
import StartNavigation from './navigation/StartNavigation';
|
||||||
import Card from './components/Card';
|
|
||||||
import Login from './pages/login';
|
|
||||||
import Spot from './pages/spot';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
|
|
||||||
const Stack = createBottomTabNavigator();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<SafeAreaProvider>
|
||||||
<Navigation/>
|
<StartNavigation/>
|
||||||
|
</SafeAreaProvider>
|
||||||
|
// <SafeAreaView style={styles.mainSafeArea}>
|
||||||
|
// {/* <Navigation/> */}
|
||||||
|
// </SafeAreaView>
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
mainSafeArea: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: "#141414",
|
||||||
|
}
|
||||||
|
});
|
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 963 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 322 KiB |
After Width: | Height: | Size: 298 KiB |
After Width: | Height: | Size: 569 KiB |
After Width: | Height: | Size: 489 KiB |
After Width: | Height: | Size: 22 KiB |
@ -0,0 +1,89 @@
|
|||||||
|
import React, { useState, useRef, useEffect } from 'react';
|
||||||
|
import { View, StyleSheet, TouchableOpacity , Animated } from 'react-native';
|
||||||
|
import Svg, { G, Circle } from 'react-native-svg';
|
||||||
|
import { AntDesign } from '@expo/vector-icons';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
export default function NextButton({ percentage, scrollTo }) {
|
||||||
|
const size = 128;
|
||||||
|
const strokeWidth = 2;
|
||||||
|
const center = size / 2;
|
||||||
|
const radius = size / 2 - strokeWidth / 2;
|
||||||
|
const circumFerence = 2 * Math.PI * radius;
|
||||||
|
|
||||||
|
const progressAnimation = useRef(new Animated.Value(0)).current;
|
||||||
|
const progressRef = useRef(null);
|
||||||
|
// @ts-ignore
|
||||||
|
const animation = (toValue) => {
|
||||||
|
return Animated.timing(progressAnimation, {
|
||||||
|
toValue,
|
||||||
|
duration: 250,
|
||||||
|
useNativeDriver: true
|
||||||
|
}).start()
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
animation(percentage);
|
||||||
|
}, [percentage]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
progressAnimation.addListener(
|
||||||
|
(value) => {
|
||||||
|
const strokeDashoffset = circumFerence - (circumFerence * value.value) / 100;
|
||||||
|
|
||||||
|
if (progressRef?.current) {
|
||||||
|
// @ts-ignore
|
||||||
|
progressRef.current.setNativeProps({
|
||||||
|
strokeDashoffset,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
// @ts-ignore
|
||||||
|
[percentage]
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
progressAnimation.removeAllListeners();
|
||||||
|
};
|
||||||
|
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Svg width={size} height={size}>
|
||||||
|
<G rotation="-90" origin={center}>
|
||||||
|
<Circle stroke="#E6E7E8" fill="#141414" cx={center} cy={center} r={radius} strokeWidth={strokeWidth}/>
|
||||||
|
<Circle
|
||||||
|
ref={progressRef}
|
||||||
|
stroke="#b50909"
|
||||||
|
fill="#141414"
|
||||||
|
cx={center}
|
||||||
|
cy={center}
|
||||||
|
r={radius}
|
||||||
|
strokeWidth={strokeWidth}
|
||||||
|
strokeDasharray={circumFerence}
|
||||||
|
/>
|
||||||
|
</G>
|
||||||
|
</Svg>
|
||||||
|
<TouchableOpacity onPress={scrollTo} style={styles.button} activeOpacity={0.6}>
|
||||||
|
<AntDesign name="arrowright" size={32} color="#fff" />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center'
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
position: 'absolute',
|
||||||
|
backgroundColor: '#b50909',
|
||||||
|
borderRadius: 100,
|
||||||
|
padding: 20
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,18 @@
|
|||||||
|
import { Dimensions, Platform, PixelRatio } from 'react-native';
|
||||||
|
|
||||||
|
const {
|
||||||
|
width: SCREEN_WIDTH,
|
||||||
|
height: SCREEN_HEIGHT,
|
||||||
|
} = Dimensions.get('window');
|
||||||
|
|
||||||
|
const scale = SCREEN_WIDTH / 480;
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
export default function normalize(size) {
|
||||||
|
const newSize = size * scale
|
||||||
|
if (Platform.OS === 'ios') {
|
||||||
|
return Math.round(PixelRatio.roundToNearestPixel(newSize))
|
||||||
|
} else {
|
||||||
|
return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 3
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { View, StyleSheet, Text, Image, useWindowDimensions } from 'react-native';
|
||||||
|
import normalize from '../components/Normalize';
|
||||||
|
|
||||||
|
import slides from '../data/slides';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
export default function Onboarding({ item }) {
|
||||||
|
const { width } = useWindowDimensions();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={[styles.container, { width }]}>
|
||||||
|
<Image source={item.image} style={[styles.image, { width, resizeMode: 'contain'}]} />
|
||||||
|
<Text style={styles.title}>{item.title}</Text>
|
||||||
|
<Text style={styles.description}>{item.description}</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
marginTop: -60
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
justifyContent: 'center'
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
fontWeight: '800',
|
||||||
|
fontSize: normalize(32),
|
||||||
|
marginBottom: 10,
|
||||||
|
color: 'white',
|
||||||
|
textAlign: 'left',
|
||||||
|
paddingRight: 30,
|
||||||
|
paddingLeft: 20,
|
||||||
|
marginTop: -80
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
fontWeight: '300',
|
||||||
|
color: 'white',
|
||||||
|
fontSize: normalize(16),
|
||||||
|
textAlign: 'left',
|
||||||
|
paddingRight: 30,
|
||||||
|
paddingLeft: 20
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,47 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { View, StyleSheet, Animated, useWindowDimensions } from 'react-native';
|
||||||
|
|
||||||
|
|
||||||
|
export default function Paginator({ data, scrollX }) {
|
||||||
|
const { width } = useWindowDimensions();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={{flexDirection: 'row', height: 64}}>
|
||||||
|
{data.map((_, i) => {
|
||||||
|
const inputRange = [(i - 1) * width, i * width, (i + 1) * width];
|
||||||
|
|
||||||
|
const dotWidth = scrollX.interpolate({
|
||||||
|
inputRange,
|
||||||
|
outputRange: [10, 20, 10],
|
||||||
|
extrapolate: 'clamp',
|
||||||
|
})
|
||||||
|
|
||||||
|
const opacity = scrollX.interpolate({
|
||||||
|
inputRange,
|
||||||
|
outputRange: [0.3, 1, 0.3],
|
||||||
|
extrapolate: 'clamp'
|
||||||
|
})
|
||||||
|
|
||||||
|
return <Animated.View
|
||||||
|
style={[
|
||||||
|
styles.dot,
|
||||||
|
{
|
||||||
|
width: dotWidth,
|
||||||
|
opacity,
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
key={i.toString()}
|
||||||
|
/>
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
dot: {
|
||||||
|
height: 10,
|
||||||
|
borderRadius: 5,
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
marginHorizontal: 8
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,20 @@
|
|||||||
|
export default [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
title: 'Bienvenue sur Flad',
|
||||||
|
description: 'L\'application pour découvrir de nouvelles musiques et vous faire de nouveaux amis',
|
||||||
|
image: require('../assets/images/Board_Image.png')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
title: 'Tous les jours de nouvelles musiques qui peuvent vous plaire',
|
||||||
|
description: 'L\'application apprends de vous et de vos amis pour vous suggérer des albums et des musics',
|
||||||
|
image: require('../assets/images/Board_Image2.png')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
title: 'La musique ça se partage',
|
||||||
|
description: 'Faites connaissances avec de nouvelles personnes et partagez vos critiques',
|
||||||
|
image: require('../assets/images/Board_Image3.png')
|
||||||
|
}
|
||||||
|
]
|
@ -0,0 +1,16 @@
|
|||||||
|
import React, {Component} from 'react';
|
||||||
|
import FavoritePage from '../screens/favoritePage';
|
||||||
|
import { createStackNavigator } from '@react-navigation/stack';
|
||||||
|
|
||||||
|
export default function MusicNavigation() {
|
||||||
|
const Stack = createStackNavigator();
|
||||||
|
return (
|
||||||
|
<Stack.Navigator initialRouteName="FavoritePage">
|
||||||
|
<Stack.Screen
|
||||||
|
name="FavoritePage"
|
||||||
|
component={FavoritePage}
|
||||||
|
options={{ headerShown: false }}
|
||||||
|
/>
|
||||||
|
</Stack.Navigator>
|
||||||
|
)
|
||||||
|
}
|
@ -1,35 +1,60 @@
|
|||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import { NavigationContainer } from '@react-navigation/native';
|
|
||||||
import Home from '../screens/spot';
|
|
||||||
import FavoritePage from '../screens/favoritePage';
|
|
||||||
import { createStackNavigator } from '@react-navigation/stack';
|
|
||||||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
||||||
|
import { NavigationContainer } from '@react-navigation/native';
|
||||||
|
import FavoriteNavigation from './FavoriteNavigation';
|
||||||
|
// @ts-ignore
|
||||||
|
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
||||||
|
|
||||||
export default function StackNavigation() {
|
export default function Navigation() {
|
||||||
const Stack = createBottomTabNavigator();
|
const BottomTabNavigator = createBottomTabNavigator();
|
||||||
return (
|
const MyTheme = {
|
||||||
<NavigationContainer>
|
dark: false,
|
||||||
<Stack.Navigator initialRouteName="Home"
|
colors: {
|
||||||
screenOptions={{
|
primary: 'rgb(255, 45, 85)',
|
||||||
|
card: 'rgb(35, 33, 35)',
|
||||||
|
border: 'rgb(35, 33, 35)',
|
||||||
|
text: 'rgb(138, 138, 138)',
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
// @ts-ignore
|
||||||
|
<NavigationContainer theme={MyTheme}>
|
||||||
|
<BottomTabNavigator.Navigator
|
||||||
|
initialRouteName="Spots"
|
||||||
|
screenOptions={{
|
||||||
|
//tabBarShowLabel: false, //to remove the titles under the icons
|
||||||
|
tabBarStyle: {height: 60, position: 'absolute', bottom: 20, borderRadius: 90, marginHorizontal: 25},
|
||||||
|
tabBarLabelStyle: { bottom: 5 }
|
||||||
|
|
||||||
}}>
|
}}>
|
||||||
<Stack.Screen
|
<BottomTabNavigator.Screen name="Spots" component={FavoriteNavigation}
|
||||||
name="Home"
|
options={{
|
||||||
component={FavoritePage}
|
headerShown: false,
|
||||||
options={{ headerShown: false }}
|
tabBarIcon: ({color}) => <TabBarIcon name="music" color={color}/>,
|
||||||
/>
|
}}/>
|
||||||
<Stack.Screen
|
<BottomTabNavigator.Screen name="Favories" component={FavoriteNavigation}
|
||||||
name="Favoris"
|
options={{
|
||||||
component={FavoritePage}
|
headerShown: false,
|
||||||
options={{ headerShown: false }}
|
tabBarIcon: ({color}) => <TabBarIcon name="heart" color={color}/>,
|
||||||
/>
|
}}/>
|
||||||
<Stack.Screen
|
<BottomTabNavigator.Screen name="Messages" component={FavoriteNavigation}
|
||||||
name="Settings"
|
options={{
|
||||||
component={FavoritePage}
|
headerShown: false,
|
||||||
options={{ headerShown: false }}
|
tabBarIcon: ({color}) => <TabBarIcon name="comment" color={color}/>,
|
||||||
/>
|
}}/>
|
||||||
</Stack.Navigator>
|
<BottomTabNavigator.Screen name="Paramètres" component={FavoriteNavigation}
|
||||||
|
options={{
|
||||||
|
headerShown: false,
|
||||||
|
tabBarIcon: ({color}) => <TabBarIcon name="cog" color={color}/>,
|
||||||
|
}}/>
|
||||||
|
</BottomTabNavigator.Navigator>
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function TabBarIcon(props: {
|
||||||
|
name: React.ComponentProps<typeof FontAwesome>['name'];
|
||||||
|
color: string;
|
||||||
|
}) {
|
||||||
|
return <FontAwesome size={30} {...props} />;
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
import React, {Component} from 'react';
|
||||||
|
import LoginPage from '../screens/loginPage';
|
||||||
|
import InscriptionPage from '../screens/InscriptionPage';
|
||||||
|
import Onboarding from '../components/Onboarding';
|
||||||
|
import { createStackNavigator } from '@react-navigation/stack';
|
||||||
|
import { NavigationContainer } from '@react-navigation/native';
|
||||||
|
|
||||||
|
export default function StartNavigation() {
|
||||||
|
const Stack = createStackNavigator();
|
||||||
|
return (
|
||||||
|
<NavigationContainer>
|
||||||
|
<Stack.Navigator initialRouteName="Home">
|
||||||
|
<Stack.Screen
|
||||||
|
name="Home"
|
||||||
|
component={Onboarding}
|
||||||
|
options={{ headerShown: false }}
|
||||||
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="Login"
|
||||||
|
component={LoginPage}
|
||||||
|
options={{ headerShown: false }}
|
||||||
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="Inscription"
|
||||||
|
component={InscriptionPage}
|
||||||
|
options={{ headerShown: false }}
|
||||||
|
/>
|
||||||
|
</Stack.Navigator>
|
||||||
|
</NavigationContainer>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,164 @@
|
|||||||
|
import React, {Component, useState } from 'react';
|
||||||
|
import { View, Image, StyleSheet, Text, ImageBackground, Button, TextInput, TouchableWithoutFeedback, Keyboard, TouchableOpacity } from 'react-native';
|
||||||
|
import {useNavigation} from "@react-navigation/native";
|
||||||
|
import normalize from '../components/Normalize';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
const DismissKeyboard = ({ children }) => (
|
||||||
|
<TouchableWithoutFeedback onPress={() => Keyboard.dismiss()}>
|
||||||
|
{children}
|
||||||
|
</TouchableWithoutFeedback>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default function InscriptionPage() {
|
||||||
|
const [rememberMe, setRememberMe] = useState(false);
|
||||||
|
const navigation = useNavigation();
|
||||||
|
|
||||||
|
const toggleRememberMe = () => {
|
||||||
|
setRememberMe(!rememberMe);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<DismissKeyboard>
|
||||||
|
<View style={styles.container}>
|
||||||
|
<ImageBackground source={require("../assets/images/Background.png")} resizeMode="cover" style={styles.image}>
|
||||||
|
<Text style={styles.versionText}>
|
||||||
|
v2.0
|
||||||
|
</Text>
|
||||||
|
<Image source={require("../assets/icons/Logo_White_Flad.png")} style={styles.imageLogo}/>
|
||||||
|
<Text style={styles.text}>S'INSCRIRE</Text>
|
||||||
|
<View>
|
||||||
|
<TextInput style={[styles.input, styles.shadow]}/>
|
||||||
|
<Image source={require('../assets/icons/icons/User.png')} style={styles.iconUser} />
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<TextInput style={[styles.input, styles.shadow]}/>
|
||||||
|
<Image source={require('../assets/icons/icons/lock.png')} style={styles.iconLock} />
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<TextInput style={[styles.input, styles.shadow]}/>
|
||||||
|
<Image source={require('../assets/icons/icons/lock.png')} style={styles.iconLock} />
|
||||||
|
</View>
|
||||||
|
<TouchableOpacity style={[styles.buttonSpotify, styles.shadow]}>
|
||||||
|
<Text style={styles.textIntoButton}>Lier compte</Text>
|
||||||
|
<Image source={require("../assets/icons/icons/Spotify.png")} style={{width: 30, height: 30}}/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity style={[styles.button, styles.shadow]} onPress={() => console.log("Oui")}>
|
||||||
|
<Image source={require("../assets/icons/icons/next.png")} style={styles.buttonImage}/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<View style={styles.connectionText}>
|
||||||
|
<Text style={{fontSize: normalize(18), color: 'white'}}>Tu as déjà un compte? </Text>
|
||||||
|
<TouchableOpacity
|
||||||
|
// @ts-ignore
|
||||||
|
onPress={() => navigation.navigate('Login')}
|
||||||
|
>
|
||||||
|
<Text style={{fontSize: normalize(18), color: '#406DE1', textDecorationLine: 'underline'}}>Se connecter</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</ImageBackground>
|
||||||
|
</View>
|
||||||
|
</DismissKeyboard>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create ({
|
||||||
|
container: {
|
||||||
|
flex: 1
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
flex: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
imageLogo: {
|
||||||
|
width: normalize(324),
|
||||||
|
height: normalize(162),
|
||||||
|
alignSelf: 'center',
|
||||||
|
marginBottom: 50,
|
||||||
|
marginTop: -20
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
marginTop: '10%',
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignSelf: 'center',
|
||||||
|
backgroundColor: 'white',
|
||||||
|
width: normalize(100),
|
||||||
|
height: normalize(100),
|
||||||
|
borderRadius: 21
|
||||||
|
},
|
||||||
|
buttonImage: {
|
||||||
|
width: normalize(46),
|
||||||
|
height: normalize(46),
|
||||||
|
},
|
||||||
|
versionText: {
|
||||||
|
position: 'absolute',
|
||||||
|
top: 40,
|
||||||
|
right: 20,
|
||||||
|
color: 'gray',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontSize: normalize(17)
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontSize: normalize(29),
|
||||||
|
alignSelf: 'center',
|
||||||
|
color: 'white',
|
||||||
|
marginBottom: 15
|
||||||
|
},
|
||||||
|
textIntoButton: {
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontSize: 15,
|
||||||
|
color: 'white',
|
||||||
|
marginRight: 10
|
||||||
|
},
|
||||||
|
shadow: {
|
||||||
|
shadowColor: '#000',
|
||||||
|
shadowOffset: {
|
||||||
|
width: 2,
|
||||||
|
height: 3,
|
||||||
|
},
|
||||||
|
shadowOpacity: 0.50,
|
||||||
|
shadowRadius: 3.84,
|
||||||
|
},
|
||||||
|
input: {
|
||||||
|
width: normalize(350),
|
||||||
|
height: normalize(50),
|
||||||
|
borderRadius: 30,
|
||||||
|
color: 'black',
|
||||||
|
backgroundColor: 'white',
|
||||||
|
alignSelf: 'center',
|
||||||
|
marginBottom: 20,
|
||||||
|
paddingLeft: 50,
|
||||||
|
paddingRight: 20
|
||||||
|
},
|
||||||
|
iconUser : {
|
||||||
|
position: 'absolute',
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
left: normalize(80),
|
||||||
|
bottom: '50%'
|
||||||
|
},
|
||||||
|
iconLock : {
|
||||||
|
position: 'absolute',
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
left: normalize(80),
|
||||||
|
bottom: '50%'
|
||||||
|
},
|
||||||
|
connectionText: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignSelf: 'center',
|
||||||
|
bottom: '-20%'
|
||||||
|
},
|
||||||
|
buttonSpotify: {
|
||||||
|
width: normalize(350),
|
||||||
|
height: normalize(50),
|
||||||
|
backgroundColor: '#24CF5F',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
alignSelf: 'center',
|
||||||
|
borderRadius: 30,
|
||||||
|
flexDirection: 'row'
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,168 @@
|
|||||||
|
import React, {Component, useState } from 'react';
|
||||||
|
import { View, Image, StyleSheet, Text, ImageBackground, Button, TextInput, TouchableWithoutFeedback, Keyboard, TouchableOpacity } from 'react-native';
|
||||||
|
import {useNavigation} from "@react-navigation/native";
|
||||||
|
import normalize from '../components/Normalize';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
const DismissKeyboard = ({ children }) => (
|
||||||
|
<TouchableWithoutFeedback onPress={() => Keyboard.dismiss()}>
|
||||||
|
{children}
|
||||||
|
</TouchableWithoutFeedback>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default function loginPage() {
|
||||||
|
const [rememberMe, setRememberMe] = useState(false);
|
||||||
|
const navigation = useNavigation();
|
||||||
|
|
||||||
|
const toggleRememberMe = () => {
|
||||||
|
setRememberMe(!rememberMe);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<DismissKeyboard>
|
||||||
|
<View style={styles.container}>
|
||||||
|
<ImageBackground source={require("../assets/images/Background.png")} resizeMode="cover" style={styles.image}>
|
||||||
|
<Text style={styles.versionText}>
|
||||||
|
v2.0
|
||||||
|
</Text>
|
||||||
|
<Image source={require("../assets/icons/Logo_White_Flad.png")} style={styles.imageLogo}/>
|
||||||
|
<Text style={styles.text}>SE CONNECTER</Text>
|
||||||
|
<View>
|
||||||
|
<TextInput style={[styles.input, styles.shadow]}/>
|
||||||
|
<Image source={require('../assets/icons/icons/User.png')} style={styles.iconUser} />
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<TextInput style={[styles.input, styles.shadow]}/>
|
||||||
|
<Image source={require('../assets/icons/icons/lock.png')} style={styles.iconLock} />
|
||||||
|
</View>
|
||||||
|
<View style={styles.rememberMeContainer}>
|
||||||
|
<TouchableOpacity style={[styles.checkbox, rememberMe ? styles.checkboxChecked : null]} onPress={toggleRememberMe}></TouchableOpacity>
|
||||||
|
<Text style={styles.rememberMeText}>SE SOUVENIR DE MOI</Text>
|
||||||
|
</View>
|
||||||
|
<TouchableOpacity style={[styles.button, styles.shadow]} onPress={() => console.log("Oui")}>
|
||||||
|
<Image source={require("../assets/icons/Check.png")} style={styles.buttonImage}/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<View style={styles.inscriptionText}>
|
||||||
|
<Text style={{fontSize: normalize(18), color: 'white'}}>Tu n'as pas de compte? </Text>
|
||||||
|
<TouchableOpacity
|
||||||
|
// @ts-ignore
|
||||||
|
onPress={() => navigation.navigate('Inscription')}
|
||||||
|
>
|
||||||
|
<Text style={{fontSize: normalize(18), color: '#406DE1', textDecorationLine: 'underline'}}>S'inscrire</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</ImageBackground>
|
||||||
|
</View>
|
||||||
|
</DismissKeyboard>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const styles = StyleSheet.create ({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
flex: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
imageLogo: {
|
||||||
|
width: normalize(324),
|
||||||
|
height: normalize(162),
|
||||||
|
alignSelf: 'center',
|
||||||
|
marginBottom: '25%'
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
marginTop: '10%',
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignSelf: 'center',
|
||||||
|
backgroundColor: 'white',
|
||||||
|
width: normalize(100),
|
||||||
|
height: normalize(100),
|
||||||
|
borderRadius: 21
|
||||||
|
},
|
||||||
|
buttonImage: {
|
||||||
|
width: normalize(46),
|
||||||
|
height: normalize(46),
|
||||||
|
},
|
||||||
|
iconUser : {
|
||||||
|
position: 'absolute',
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
left: normalize(80),
|
||||||
|
bottom: '50%'
|
||||||
|
},
|
||||||
|
iconLock : {
|
||||||
|
position: 'absolute',
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
left: normalize(80),
|
||||||
|
bottom: '50%'
|
||||||
|
},
|
||||||
|
input: {
|
||||||
|
width: normalize(350),
|
||||||
|
height: normalize(50),
|
||||||
|
borderRadius: 30,
|
||||||
|
color: 'black',
|
||||||
|
backgroundColor: 'white',
|
||||||
|
alignSelf: 'center',
|
||||||
|
marginBottom: 20,
|
||||||
|
paddingLeft: 50,
|
||||||
|
paddingRight: 20
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontSize: normalize(29),
|
||||||
|
alignSelf: 'center',
|
||||||
|
color: 'white',
|
||||||
|
marginBottom: 15
|
||||||
|
},
|
||||||
|
shadow: {
|
||||||
|
shadowColor: '#000',
|
||||||
|
shadowOffset: {
|
||||||
|
width: 2,
|
||||||
|
height: 3,
|
||||||
|
},
|
||||||
|
shadowOpacity: 0.50,
|
||||||
|
shadowRadius: 3.84,
|
||||||
|
},
|
||||||
|
versionText: {
|
||||||
|
position: 'absolute',
|
||||||
|
top: 40,
|
||||||
|
right: 20,
|
||||||
|
color: 'gray',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontSize: normalize(17)
|
||||||
|
},
|
||||||
|
rememberMeContainer: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
alignSelf: 'center',
|
||||||
|
marginBottom: '5%',
|
||||||
|
marginTop: normalize(10)
|
||||||
|
},
|
||||||
|
checkbox: {
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
borderRadius: 5,
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: 'gray',
|
||||||
|
marginRight: 10
|
||||||
|
},
|
||||||
|
rememberMeText: {
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontSize: normalize(19),
|
||||||
|
color: 'white'
|
||||||
|
},
|
||||||
|
checkboxChecked: {
|
||||||
|
backgroundColor: 'white'
|
||||||
|
},
|
||||||
|
inscriptionText: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignSelf: 'center',
|
||||||
|
bottom: '-20%'
|
||||||
|
}
|
||||||
|
})
|