Prettify files before other changes

Prettify
This commit is contained in:
Sofiya Tepikin
2022-08-10 13:54:22 +02:00
parent 04bd981871
commit 0ec23219bf
5 changed files with 35 additions and 51 deletions
+4 -4
View File
@@ -12,7 +12,7 @@ import AppStatusBar from './common/app-status-bar'
import License from './License' import License from './License'
import PasswordPrompt from './password-prompt' import PasswordPrompt from './password-prompt'
import store from "../store" import store from '../store'
export default class AppWrapper extends Component { export default class AppWrapper extends Component {
constructor() { constructor() {
@@ -51,7 +51,7 @@ export default class AppWrapper extends Component {
enableShowLicenseAgreement = () => { enableShowLicenseAgreement = () => {
this.setState({ this.setState({
shouldShowLicenseAgreement: true, shouldShowLicenseAgreement: true,
isCheckingLicenseAgreement: false isCheckingLicenseAgreement: false,
}) })
} }
@@ -62,7 +62,7 @@ export default class AppWrapper extends Component {
enableShowApp = () => { enableShowApp = () => {
this.setState({ this.setState({
shouldShowApp: true, shouldShowApp: true,
shouldShowPasswordPrompt: false shouldShowPasswordPrompt: false,
}) })
} }
@@ -100,5 +100,5 @@ export default class AppWrapper extends Component {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
} },
}) })
+8 -12
View File
@@ -17,7 +17,6 @@ import setupNotifications from '../lib/notifications'
import { getCycleDay, closeDb } from '../db' import { getCycleDay, closeDb } from '../db'
class App extends Component { class App extends Component {
static propTypes = { static propTypes = {
date: PropTypes.string, date: PropTypes.string,
navigation: PropTypes.object.isRequired, navigation: PropTypes.object.isRequired,
@@ -90,25 +89,22 @@ class App extends Component {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1 flex: 1,
} },
}) })
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return({ return {
date: getDate(state), date: getDate(state),
navigation: getNavigation(state) navigation: getNavigation(state),
}) }
} }
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return({ return {
navigate: (page) => dispatch(navigate(page)), navigate: (page) => dispatch(navigate(page)),
goBack: () => dispatch(goBack()), goBack: () => dispatch(goBack()),
}) }
} }
export default connect( export default connect(mapStateToProps, mapDispatchToProps)(App)
mapStateToProps,
mapDispatchToProps
)(App)
-1
View File
@@ -36,6 +36,5 @@ export default class CreatePassword extends Component {
} else { } else {
return <EnterNewPassword /> return <EnterNewPassword />
} }
} }
} }
+6 -14
View File
@@ -18,7 +18,7 @@ export default class PasswordSetting extends Component {
this.state = { this.state = {
isPasswordSet: hasEncryptionObservable.value, isPasswordSet: hasEncryptionObservable.value,
isChangingPassword: false, isChangingPassword: false,
isDeletingPassword: false isDeletingPassword: false,
} }
} }
@@ -39,18 +39,10 @@ export default class PasswordSetting extends Component {
} }
render() { render() {
const { isPasswordSet, isChangingPassword, isDeletingPassword } = this.state
const { const { title, explainerEnabled, explainerDisabled } =
isPasswordSet, labels.passwordSettings
isChangingPassword,
isDeletingPassword,
} = this.state
const {
title,
explainerEnabled,
explainerDisabled
} = labels.passwordSettings
return ( return (
<AppPage> <AppPage>
@@ -61,14 +53,14 @@ export default class PasswordSetting extends Component {
{!isPasswordSet && <CreatePassword />} {!isPasswordSet && <CreatePassword />}
{(isPasswordSet && !isDeletingPassword) && ( {isPasswordSet && !isDeletingPassword && (
<ChangePassword <ChangePassword
onStartChange={this.onChangingPassword} onStartChange={this.onChangingPassword}
onCancelChange={this.onCancelChangingPassword} onCancelChange={this.onCancelChangingPassword}
/> />
)} )}
{(isPasswordSet && !isChangingPassword) && ( {isPasswordSet && !isChangingPassword && (
<DeletePassword <DeletePassword
onStartDelete={this.onDeletingPassword} onStartDelete={this.onDeletingPassword}
onCancelDelete={this.onCancelDeletingPassword} onCancelDelete={this.onCancelDeletingPassword}
+6 -9
View File
@@ -12,7 +12,7 @@ import settings from '../../../i18n/en/settings'
export default class ChangePassword extends Component { export default class ChangePassword extends Component {
static propTypes = { static propTypes = {
onStartChange: PropTypes.func, onStartChange: PropTypes.func,
onCancelChange: PropTypes.func onCancelChange: PropTypes.func,
} }
constructor() { constructor() {
@@ -21,7 +21,7 @@ export default class ChangePassword extends Component {
this.state = { this.state = {
currentPassword: null, currentPassword: null,
enteringCurrentPassword: false, enteringCurrentPassword: false,
enteringNewPassword: false enteringNewPassword: false,
} }
} }
@@ -41,7 +41,7 @@ export default class ChangePassword extends Component {
this.setState({ this.setState({
currentPassword: null, currentPassword: null,
enteringNewPassword: true, enteringNewPassword: true,
enteringCurrentPassword: false enteringCurrentPassword: false,
}) })
} }
@@ -49,17 +49,14 @@ export default class ChangePassword extends Component {
this.setState({ this.setState({
currentPassword: null, currentPassword: null,
enteringNewPassword: false, enteringNewPassword: false,
enteringCurrentPassword: false enteringCurrentPassword: false,
}) })
this.props.onCancelChange() this.props.onCancelChange()
} }
render() { render() {
const { const { enteringCurrentPassword, enteringNewPassword, currentPassword } =
enteringCurrentPassword, this.state
enteringNewPassword,
currentPassword
} = this.state
const labels = settings.passwordSettings const labels = settings.passwordSettings
const isPasswordSet = currentPassword !== null const isPasswordSet = currentPassword !== null