Extracting SettingsButton component
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import {
|
import { View } from 'react-native'
|
||||||
View,
|
|
||||||
TouchableOpacity,
|
|
||||||
} from 'react-native'
|
|
||||||
import nodejs from 'nodejs-mobile-react-native'
|
import nodejs from 'nodejs-mobile-react-native'
|
||||||
import AppText from '../../app-text'
|
import AppText from '../../app-text'
|
||||||
import styles from '../../../styles'
|
import styles from '../../../styles'
|
||||||
@@ -10,22 +7,9 @@ import { settings } from '../../../i18n/en/settings'
|
|||||||
import { requestHash, changeEncryptionAndRestartApp } from '../../../db'
|
import { requestHash, changeEncryptionAndRestartApp } from '../../../db'
|
||||||
import PasswordField from './password-field'
|
import PasswordField from './password-field'
|
||||||
import showBackUpReminder from './show-backup-reminder'
|
import showBackUpReminder from './show-backup-reminder'
|
||||||
|
import SettingsButton from './settings-button'
|
||||||
|
|
||||||
|
|
||||||
const SettingsButton = ({ children, ...props }) => {
|
|
||||||
return (
|
|
||||||
<TouchableOpacity
|
|
||||||
style={[
|
|
||||||
styles.settingsButton,
|
|
||||||
props.disabled ? styles.settingsButtonDisabled : null
|
|
||||||
]}
|
|
||||||
{ ...props }
|
|
||||||
>
|
|
||||||
<AppText style={styles.settingsButtonText}>
|
|
||||||
{children}
|
|
||||||
</AppText>
|
|
||||||
</TouchableOpacity>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class CreatePassword extends Component {
|
export default class CreatePassword extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
import { TouchableOpacity } from 'react-native'
|
||||||
|
import AppText from '../../app-text'
|
||||||
|
import styles from '../../../styles'
|
||||||
|
|
||||||
|
const SettingsButton = ({ children, ...props }) => {
|
||||||
|
return (
|
||||||
|
<TouchableOpacity
|
||||||
|
style={[
|
||||||
|
styles.settingsButton,
|
||||||
|
props.disabled ? styles.settingsButtonDisabled : null
|
||||||
|
]}
|
||||||
|
{ ...props }
|
||||||
|
>
|
||||||
|
<AppText style={styles.settingsButtonText}>
|
||||||
|
{children}
|
||||||
|
</AppText>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SettingsButton
|
||||||
Reference in New Issue
Block a user