-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.js
More file actions
48 lines (44 loc) · 1.32 KB
/
App.js
File metadata and controls
48 lines (44 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React, { Component } from 'react'
import { View, Modal, DeviceEventEmitter, StatusBar } from 'react-native'
import ImageViewer from 'react-native-image-zoom-viewer'
import event from './event'
import Routers from './src/routers'
import { ErrorBoundary } from './src/components'
if (!global.__DEV__) {
global.console = {
info: () => {},
log: () => {},
warn: () => {},
debug: () => {},
error: () => {}
}
}
export default class App extends Component {
constructor (props) {
super(props)
this.state = {
barStyle: 'light-content',
screenProps: {},
imageViewer: { images: [], show: false, index: 0 }
}
}
componentDidMount () {
event(this).emit('LOCKTO', 'Portrait')
}
render () {
return (
<ErrorBoundary>
<View style={{flex: 1}}>
<StatusBar
barStyle={this.state.barStyle}
animated={true}
/>
<Routers ref="router" screenProps={this.state.screenProps} />
<Modal visible={this.state.imageViewer.show} transparent={true} animationType="fade">
<ImageViewer imageUrls={this.state.imageViewer.images} index={this.state.imageViewer.index} onCancel={() => { DeviceEventEmitter.emit('SHOW_IMAGE_VIEWER', { show: false }) }} />
</Modal>
</View>
</ErrorBoundary>
)
}
}