-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
38 lines (33 loc) · 907 Bytes
/
App.js
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
import { AppRegistry, StatusBar } from 'react-native';
import Limelight from './components';
import Messages from './components/messages';
import LocalMessages from './util/LocalMessages';
import React from 'react';
export default class App extends React.Component {
constructor(props) {
super(props);
StatusBar.setBarStyle('light-content', true);
this.state = {
messages: new LocalMessages(this),
isOnline: true,
finishedReading: false
};
}
finishReading() {
this.setState({
finishedReading: true
});
}
render() {
if(this.state.finishedReading) {
return <Limelight/>;
} else {
return (
<Messages ready={this.state.messages.ready} finishReading={()=>this.finishReading()}>
{this.state.messages.unreadMessages}
</Messages>
);
}
}
}
AppRegistry.registerComponent('Limelight', () => App);