File tree Expand file tree Collapse file tree 2 files changed +14
-40
lines changed Expand file tree Collapse file tree 2 files changed +14
-40
lines changed Original file line number Diff line number Diff line change 1
1
import _ from 'lodash' ;
2
2
import React , { Component } from 'react' ;
3
3
import { StyleSheet } from 'react-native' ;
4
- import { View , Text } from 'react-native-ui-lib' ; //eslint-disable-line
5
-
4
+ import { View , Text , Card } from 'react-native-ui-lib' ; //eslint-disable-line
6
5
7
6
export default class PlaygroundScreen extends Component {
8
-
9
7
render ( ) {
10
8
return (
11
9
< View center bg-dark80 flex >
12
- < Text text50 > Playground Screen</ Text >
10
+ < Card height = { 100 } center padding-20 >
11
+ < Text text50 > Playground Screen</ Text >
12
+ </ Card >
13
13
</ View >
14
14
) ;
15
15
}
16
16
}
17
17
18
18
const styles = StyleSheet . create ( {
19
- container : {
20
- }
19
+ container : { }
21
20
} ) ;
Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import React , { Component } from 'react' ;
2
2
import { View , Text , TouchableOpacity } from 'react-native-ui-lib' ; //eslint-disable-line
3
3
4
4
export default class TouchableOpacityScreen extends Component {
5
-
6
5
state = {
7
- count : 0 ,
8
- }
9
-
10
- componentDidMount ( ) {
11
- const snippet = this . example . getSnippet ( ) ;
12
- this . setState ( {
13
- snippet,
14
- } ) ;
15
- }
6
+ count : 0
7
+ } ;
16
8
17
9
count ( ) {
18
10
this . setState ( {
19
- count : this . state . count + 1 ,
11
+ count : this . state . count + 1
20
12
} ) ;
21
13
}
22
14
@@ -25,33 +17,16 @@ export default class TouchableOpacityScreen extends Component {
25
17
< View flex bg-dark70 useSafeArea >
26
18
< View flex center >
27
19
< View marginB-20 >
28
- < Text center >
29
- TouchableOpacity with support for throttling.
30
- </ Text >
31
- < Text center >
32
- In this example, throttleTime is set to 1200
33
- </ Text >
20
+ < Text center > TouchableOpacity with support for throttling.</ Text >
21
+ < Text center > In this example, throttleTime is set to 1200</ Text >
34
22
</ View >
35
- < TouchableOpacity
36
- throttleTime = { 1200 }
37
- onPress = { ( ) => this . count ( ) }
38
- ref = { element => this . example = element }
39
- >
40
- < Text text40 >
41
- Click Me!
42
- </ Text >
23
+ < TouchableOpacity throttleTime = { 1200 } onPress = { ( ) => this . count ( ) } ref = { element => ( this . example = element ) } >
24
+ < Text text40 > Click Me!</ Text >
43
25
</ TouchableOpacity >
44
26
< View center marginT-20 >
45
- < Text text20 >
46
- { this . state . count }
47
- </ Text >
27
+ < Text text20 > { this . state . count } </ Text >
48
28
</ View >
49
29
</ View >
50
- < View bg-dark10 margin-10 padding-10 >
51
- < Text white >
52
- { this . state . snippet }
53
- </ Text >
54
- </ View >
55
30
</ View >
56
31
) ;
57
32
}
You can’t perform that action at this time.
0 commit comments