Intro.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import React from 'react';
  2. import { ImageBackground, StyleSheet, View, TouchableOpacity, Image } from 'react-native';
  3. import { Text, } from 'react-native-paper'
  4. import 'react-native-get-random-values';
  5. const Intro = ({navigation}) => {
  6. const goToLogin = () => {
  7. navigation.navigate("Login");
  8. }
  9. const goToRegistration = () => {
  10. navigation.navigate("Registration");
  11. }
  12. return(
  13. <ImageBackground style={styles.container} source={require('../assets/cover.jpg')}>
  14. <View style={[styles.brandContainer, styles.center]}>
  15. <Image style={styles.logo} source={require('../assets/logo-white.png')}></Image>
  16. <Text style={[styles.center, styles.title]} >Click & Push</Text>
  17. </View>
  18. <View style={styles.btnContainer}>
  19. <TouchableOpacity style={styles.loginBtn} onPress={goToLogin} >
  20. <Text style={{ color: 'white', fontSize: 15 }}>Login</Text>
  21. </TouchableOpacity>
  22. <TouchableOpacity style={styles.registerBtn} onPress={goToRegistration} >
  23. <Text style={{ color: 'white', fontSize: 15 }}>Create Account</Text>
  24. </TouchableOpacity>
  25. </View>
  26. </ImageBackground>
  27. )
  28. }
  29. const styles = StyleSheet.create({
  30. container: {
  31. flex: 1,
  32. flexDirection: 'column',
  33. resizeMode: 'cover',
  34. justifyContent: 'space-between'
  35. },
  36. center: {
  37. alignItems: 'center',
  38. justifyContent: 'center',
  39. },
  40. brandContainer: {
  41. flex: 2,
  42. marginVertical: 50,
  43. flexDirection: 'column',
  44. justifyContent: 'space-between'
  45. },
  46. title: {
  47. fontFamily: 'RacingSansOne-Regular',
  48. marginTop: 30,
  49. color: 'white',
  50. fontSize: 30
  51. },
  52. textContainer: {
  53. marginHorizontal: 20,
  54. borderRadius: 50,
  55. },
  56. textInput: {
  57. marginBottom: 10,
  58. paddingLeft: 30,
  59. borderRadius: 50,
  60. overflow: 'hidden',
  61. backgroundColor: 'white',
  62. height: 50
  63. },
  64. loginBtn: {
  65. borderRadius: 50,
  66. width: '75%',
  67. justifyContent: 'center',
  68. backgroundColor: '#df3f3f',
  69. height: 60,
  70. marginBottom: 20,
  71. alignItems: 'center'
  72. },
  73. registerBtn: {
  74. width: '75%',
  75. borderColor: 'white',
  76. borderWidth: 2,
  77. borderRadius: 50,
  78. justifyContent: 'center',
  79. backgroundColor: 'transparent',
  80. height: 60,
  81. alignItems: 'center'
  82. },
  83. btnContainer: {
  84. flex: 1,
  85. alignItems: 'center',
  86. },
  87. })
  88. export default Intro;