File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed
client/react-native/common/components/Screens/Settings/Devtools Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change
1
+ import {
2
+ Clipboard ,
3
+ RefreshControl ,
4
+ ScrollView ,
5
+ Text ,
6
+ TouchableOpacity ,
7
+ } from 'react-native'
1
8
import React , { PureComponent } from 'react'
2
- import { Text , ScrollView , TouchableOpacity , Clipboard } from 'react-native'
9
+
10
+ import { GetDeviceInfos } from '../../../../graphql/queries'
3
11
import { Header } from '../../../Library'
4
12
import { colors } from '../../../../constants'
5
13
import { padding } from '../../../../styles'
6
- import { GetDeviceInfos } from '../../../../graphql/queries'
7
14
8
15
export default class DeviceInfos extends PureComponent {
9
16
static navigationOptions = ( { navigation } ) => ( {
@@ -19,12 +26,19 @@ export default class DeviceInfos extends PureComponent {
19
26
20
27
state = {
21
28
infos : { } ,
29
+ refreshing : false ,
30
+ }
31
+
32
+ fetch = ( ) => {
33
+ this . setState ( { refreshing : true } , ( ) =>
34
+ GetDeviceInfos . then ( data => {
35
+ this . setState ( { infos : data . DeviceInfos . infos , refreshing : false } )
36
+ } )
37
+ )
22
38
}
23
39
24
40
componentDidMount ( ) {
25
- GetDeviceInfos . then ( data => {
26
- this . setState ( { infos : data . DeviceInfos . infos } )
27
- } )
41
+ this . fetch ( )
28
42
}
29
43
30
44
render ( ) {
@@ -60,7 +74,15 @@ export default class DeviceInfos extends PureComponent {
60
74
}
61
75
62
76
return (
63
- < ScrollView style = { { backgroundColor : colors . background } } >
77
+ < ScrollView
78
+ style = { { backgroundColor : colors . background } }
79
+ refreshControl = {
80
+ < RefreshControl
81
+ refreshing = { this . state . refreshing }
82
+ onRefresh = { this . fetch }
83
+ />
84
+ }
85
+ >
64
86
{ fields }
65
87
</ ScrollView >
66
88
)
You can’t perform that action at this time.
0 commit comments