-
-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render main screen faster. Small fixes. (#1145)
- Loading branch information
1 parent
664dc67
commit 400971c
Showing
14 changed files
with
83 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* @flow */ | ||
import React, { PureComponent } from 'react'; | ||
|
||
import { checkCompatibility } from '../api'; | ||
import CompatibilityScreen from '../start/CompatibilityScreen'; | ||
|
||
export default class CompatibilityChecker extends PureComponent { | ||
state = { | ||
compatibilityCheckFail: false, | ||
}; | ||
|
||
componentDidMount() { | ||
checkCompatibility().then(res => { | ||
if (res.status === 400) { | ||
this.setState({ | ||
compatibilityCheckFail: true, | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
render() { | ||
const { compatibilityCheckFail } = this.state; | ||
|
||
return compatibilityCheckFail ? <CompatibilityScreen /> : this.props.children; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* TODO flow */ | ||
import { connect } from 'react-redux'; | ||
|
||
import boundActions from '../boundActions'; | ||
import { getAuth } from '../selectors'; | ||
import SettingsCard from './SettingsCard'; | ||
|
||
export default connect( | ||
state => ({ | ||
offlineNotification: state.settings.offlineNotification, | ||
onlineNotification: state.settings.onlineNotification, | ||
theme: state.settings.theme, | ||
auth: getAuth(state), | ||
}), | ||
boundActions, | ||
)(SettingsCard); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,15 @@ | ||
/* TODO flow */ | ||
import React, { PureComponent } from 'react'; | ||
import { connect } from 'react-redux'; | ||
|
||
import boundActions from '../boundActions'; | ||
import { getAuth } from '../selectors'; | ||
import { Screen } from '../common'; | ||
import SettingsCard from './SettingsCard'; | ||
import SettingsContainer from './SettingsContainer'; | ||
|
||
class SettingsScreen extends PureComponent { | ||
export default class SettingsScreen extends PureComponent { | ||
render() { | ||
return ( | ||
<Screen title="Settings"> | ||
<SettingsCard {...this.props} /> | ||
<SettingsContainer /> | ||
</Screen> | ||
); | ||
} | ||
} | ||
|
||
export default connect( | ||
state => ({ | ||
offlineNotification: state.settings.offlineNotification, | ||
onlineNotification: state.settings.onlineNotification, | ||
theme: state.settings.theme, | ||
auth: getAuth(state), | ||
}), | ||
boundActions, | ||
)(SettingsScreen); |