1
1
import React from 'react' ;
2
2
import {
3
- ActivityIndicator ,
4
3
Image ,
5
- Pressable ,
6
4
ScrollView ,
7
5
StatusBar ,
8
6
StyleSheet ,
9
7
Text ,
10
- TextInput ,
11
8
View ,
12
9
} from 'react-native' ;
10
+ import { PressMe } from './src/PressMe' ;
13
11
14
12
const Section : React . FC < {
15
13
title : string ;
@@ -23,20 +21,6 @@ const Section: React.FC<{
23
21
} ;
24
22
25
23
const App = ( ) => {
26
- const [ text , setText ] = React . useState ( '' ) ;
27
- const [ isLongPressed , setIsLongPressed ] = React . useState ( false ) ;
28
- const [ isLoading , setIsLoading ] = React . useState ( false ) ;
29
- const [ isLoaded , setIsLoaded ] = React . useState ( false ) ;
30
-
31
- React . useEffect ( ( ) => {
32
- if ( isLoading ) {
33
- setTimeout ( ( ) => {
34
- setIsLoading ( false ) ;
35
- setIsLoaded ( true ) ;
36
- } , 1500 ) ;
37
- }
38
- } , [ isLoading ] ) ;
39
-
40
24
return (
41
25
< ScrollView
42
26
contentInsetAdjustmentBehavior = "automatic"
@@ -48,39 +32,7 @@ const App = () => {
48
32
49
33
< Image source = { require ( './assets/logo.png' ) } style = { styles . logo } />
50
34
51
- < View style = { styles . header } >
52
- { ! isLoaded && ! isLoading && (
53
- < Pressable
54
- testID = "Pressable"
55
- onPress = { ( ) => setIsLoading ( true ) }
56
- onLongPress = { ( ) => setIsLongPressed ( true ) }
57
- style = { styles . button }
58
- >
59
- < Text style = { styles . buttonText } > Press Me</ Text >
60
- < Text style = { styles . buttonArrow } > →</ Text >
61
- </ Pressable >
62
- ) }
63
-
64
- { isLoading && < ActivityIndicator /> }
65
-
66
- { isLongPressed && ! isLoading && ! isLoaded && (
67
- < Text style = { styles . textLongPressed } > Long Pressed!</ Text >
68
- ) }
69
-
70
- { ! isLoading && isLoaded && (
71
- < >
72
- < Text style = { styles . textInputLabel } > This is a label *</ Text >
73
-
74
- < TextInput
75
- testID = "TextInput"
76
- placeholder = "Type something here"
77
- onChangeText = { setText }
78
- value = { text }
79
- style = { styles . textInput }
80
- />
81
- </ >
82
- ) }
83
- </ View >
35
+ < PressMe />
84
36
85
37
< Section title = "Setup" >
86
38
Install < Text style = { styles . highlight } > react-native-owl</ Text > and
@@ -129,25 +81,6 @@ const styles = StyleSheet.create({
129
81
height : 175 ,
130
82
alignSelf : 'center' ,
131
83
} ,
132
- header : {
133
- marginVertical : 35 ,
134
- } ,
135
- button : {
136
- flexDirection : 'row' ,
137
- justifyContent : 'space-between' ,
138
- alignItems : 'center' ,
139
- borderWidth : 2 ,
140
- paddingVertical : 7.5 ,
141
- paddingHorizontal : 20 ,
142
- borderRadius : 20 ,
143
- } ,
144
- buttonText : {
145
- fontSize : 16 ,
146
- fontWeight : '600' ,
147
- } ,
148
- buttonArrow : {
149
- fontSize : 20 ,
150
- } ,
151
84
sectionContainer : {
152
85
marginBottom : 32 ,
153
86
} ,
0 commit comments