Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { StyleSheet, Text, View, Dimensions } from 'react-native';
  3. import LinearGradient from 'react-native-linear-gradient';
  4. import Animated from 'react-native-reanimated';
  5. import { TapGestureHandler, State } from 'react-native-gesture-handler'
  6. const { height, width } = Dimensions.get("window");
  7. const { Value, event, block, cond, eq, set } = Animated
  8.  
  9. console.disableYellowBox = true;
  10. export default class Login extends Component {
  11. static navigationOptions = {
  12. header: null,
  13. };
  14. constructor(props) {
  15. super(props);
  16. this.state = {
  17. isReady: false
  18. }
  19.  
  20. this.buttonOpacity = new Value(1)
  21. this.onStateChange = event([
  22. {
  23. nativeEvent: ({ state }) => block([
  24. cond(eq(state, State.BEGAN), set(this.buttonOpacity, 0))
  25. ])
  26. },
  27. ]);
  28.  
  29. }
  30.  
  31. render() {
  32.  
  33. return (
  34. <View style={{ flex: 1, backgroundColor: 'white', justifyContent: 'flex-end' }}>
  35. <View style={{ ...StyleSheet.absoluteFill }}>
  36. <LinearGradient
  37. colors={['#e78', '#3c1053']}
  38. style={styles.linearGradient} />
  39. </View>
  40. <View style={{ height: height / 3, justifyContent: 'center' }}>
  41. <TapGestureHandler onHandlerStateChange={this.onStateChange}>
  42. <Animated.View style={[styles.button, { opacity: this.buttonOpacity }]}>
  43. <Text style={{ fontSize: 20, fontWeight: 'bold' }}>
  44. SIGN IN
  45. </Text>
  46. </Animated.View>
  47. </TapGestureHandler>
  48. <View style={{ ...styles.button, backgroundColor: '#2e71dc', marginTop: 10 }}>
  49. <Text style={{ fontSize: 20, fontWeight: 'bold', color: 'white' }}>
  50. SIGN IN WITH FACEBOOK
  51. </Text>
  52. </View>
  53. </View>
  54. </View>
  55. );
  56. }
  57. }
  58.  
  59. var styles = StyleSheet.create({
  60. linearGradient: {
  61. flex: 1,
  62. width: null,
  63. height: null,
  64. paddingLeft: 15,
  65. paddingRight: 15,
  66.  
  67. },
  68. buttonText: {
  69. fontSize: 18,
  70. fontFamily: 'Gill Sans',
  71. textAlign: 'center',
  72. margin: 10,
  73. color: '#ffffff',
  74. backgroundColor: 'transparent',
  75. },
  76. button: {
  77. backgroundColor: 'white',
  78. height: 70,
  79. marginHorizontal: 20,
  80. borderRadius: 35,
  81. alignItems: 'center',
  82. justifyContent: 'center'
  83. }
  84. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement