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
+5 -5
View File
@@ -12,7 +12,7 @@ import AppStatusBar from './common/app-status-bar'
import License from './License'
import PasswordPrompt from './password-prompt'
import store from "../store"
import store from '../store'
export default class AppWrapper extends Component {
constructor() {
@@ -51,7 +51,7 @@ export default class AppWrapper extends Component {
enableShowLicenseAgreement = () => {
this.setState({
shouldShowLicenseAgreement: true,
isCheckingLicenseAgreement: false
isCheckingLicenseAgreement: false,
})
}
@@ -62,7 +62,7 @@ export default class AppWrapper extends Component {
enableShowApp = () => {
this.setState({
shouldShowApp: true,
shouldShowPasswordPrompt: false
shouldShowPasswordPrompt: false,
})
}
@@ -79,7 +79,7 @@ export default class AppWrapper extends Component {
if (isCheckingLicenseAgreement) {
initialView = <AppLoadingView />
} else if (shouldShowLicenseAgreement) {
initialView = <License setLicense={this.disableShowLicenseAgreement}/>
initialView = <License setLicense={this.disableShowLicenseAgreement} />
} else if (shouldShowPasswordPrompt) {
initialView = <PasswordPrompt enableShowApp={this.enableShowApp} />
} else if (shouldShowApp) {
@@ -100,5 +100,5 @@ export default class AppWrapper extends Component {
const styles = StyleSheet.create({
container: {
flex: 1,
}
},
})
+10 -14
View File
@@ -17,7 +17,6 @@ import setupNotifications from '../lib/notifications'
import { getCycleDay, closeDb } from '../db'
class App extends Component {
static propTypes = {
date: PropTypes.string,
navigation: PropTypes.object.isRequired,
@@ -80,8 +79,8 @@ class App extends Component {
return (
<View style={styles.container}>
<Header { ...headerProps } />
<Page { ...pageProps } />
<Header {...headerProps} />
<Page {...pageProps} />
<Menu />
</View>
)
@@ -90,25 +89,22 @@ class App extends Component {
const styles = StyleSheet.create({
container: {
flex: 1
}
flex: 1,
},
})
const mapStateToProps = (state) => {
return({
return {
date: getDate(state),
navigation: getNavigation(state)
})
navigation: getNavigation(state),
}
}
const mapDispatchToProps = (dispatch) => {
return({
return {
navigate: (page) => dispatch(navigate(page)),
goBack: () => dispatch(goBack()),
})
}
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(App)
export default connect(mapStateToProps, mapDispatchToProps)(App)
+2 -3
View File
@@ -23,7 +23,7 @@ export default class CreatePassword extends Component {
showBackUpReminder(this.toggleSettingPassword, () => {})
}
render () {
render() {
const { isSettingPassword } = this.state
const labels = settings.passwordSettings
@@ -36,6 +36,5 @@ export default class CreatePassword extends Component {
} else {
return <EnterNewPassword />
}
}
}
}
+11 -19
View File
@@ -18,7 +18,7 @@ export default class PasswordSetting extends Component {
this.state = {
isPasswordSet: hasEncryptionObservable.value,
isChangingPassword: false,
isDeletingPassword: false
isDeletingPassword: false,
}
}
@@ -39,18 +39,10 @@ export default class PasswordSetting extends Component {
}
render() {
const { isPasswordSet, isChangingPassword, isDeletingPassword } = this.state
const {
isPasswordSet,
isChangingPassword,
isDeletingPassword,
} = this.state
const {
title,
explainerEnabled,
explainerDisabled
} = labels.passwordSettings
const { title, explainerEnabled, explainerDisabled } =
labels.passwordSettings
return (
<AppPage>
@@ -59,19 +51,19 @@ export default class PasswordSetting extends Component {
{isPasswordSet ? explainerEnabled : explainerDisabled}
</AppText>
{!isPasswordSet && <CreatePassword/>}
{!isPasswordSet && <CreatePassword />}
{(isPasswordSet && !isDeletingPassword) && (
{isPasswordSet && !isDeletingPassword && (
<ChangePassword
onStartChange = {this.onChangingPassword}
onCancelChange = {this.onCancelChangingPassword}
onStartChange={this.onChangingPassword}
onCancelChange={this.onCancelChangingPassword}
/>
)}
{(isPasswordSet && !isChangingPassword) && (
{isPasswordSet && !isChangingPassword && (
<DeletePassword
onStartDelete = {this.onDeletingPassword}
onCancelDelete = {this.onCancelDeletingPassword}
onStartDelete={this.onDeletingPassword}
onCancelDelete={this.onCancelDeletingPassword}
/>
)}
</Segment>
+7 -10
View File
@@ -12,7 +12,7 @@ import settings from '../../../i18n/en/settings'
export default class ChangePassword extends Component {
static propTypes = {
onStartChange: PropTypes.func,
onCancelChange: PropTypes.func
onCancelChange: PropTypes.func,
}
constructor() {
@@ -21,7 +21,7 @@ export default class ChangePassword extends Component {
this.state = {
currentPassword: null,
enteringCurrentPassword: false,
enteringNewPassword: false
enteringNewPassword: false,
}
}
@@ -41,7 +41,7 @@ export default class ChangePassword extends Component {
this.setState({
currentPassword: null,
enteringNewPassword: true,
enteringCurrentPassword: false
enteringCurrentPassword: false,
})
}
@@ -49,17 +49,14 @@ export default class ChangePassword extends Component {
this.setState({
currentPassword: null,
enteringNewPassword: false,
enteringCurrentPassword: false
enteringCurrentPassword: false,
})
this.props.onCancelChange()
}
render() {
const {
enteringCurrentPassword,
enteringNewPassword,
currentPassword
} = this.state
const { enteringCurrentPassword, enteringNewPassword, currentPassword } =
this.state
const labels = settings.passwordSettings
const isPasswordSet = currentPassword !== null
@@ -86,4 +83,4 @@ export default class ChangePassword extends Component {
</Button>
)
}
}
}