Skip to content
Snippets Groups Projects
Commit 714d9fd6 authored by Sofiya Tepikin's avatar Sofiya Tepikin
Browse files

Styles the buttons in password confirmation

parent 3babba0d
No related branches found
No related tags found
No related merge requests found
...@@ -64,7 +64,6 @@ export default class ConfirmWithPassword extends Component { ...@@ -64,7 +64,6 @@ export default class ConfirmWithPassword extends Component {
} }
render() { render() {
const { password } = this.state const { password } = this.state
const labels = settings.passwordSettings const labels = settings.passwordSettings
...@@ -75,17 +74,27 @@ export default class ConfirmWithPassword extends Component { ...@@ -75,17 +74,27 @@ export default class ConfirmWithPassword extends Component {
value={password} value={password}
onChangeText={this.handlePasswordInput} onChangeText={this.handlePasswordInput}
/> />
<SettingsButton <View style={{
onPress={this.initPasswordCheck} flex: 1,
disabled={!password} flexDirection: 'row',
> justifyContent: 'space-between'
{shared.confirmToProceed} }}>
</SettingsButton> <SettingsButton
<SettingsButton onPress={this.props.onCancel}
onPress={this.props.onCancel} secondary
> >
{shared.cancel} {shared.cancel}
</SettingsButton> </SettingsButton>
<SettingsButton
onPress={this.initPasswordCheck}
disabled={!password}
style={{
flex: 1,
}}
>
{shared.confirmToProceed}
</SettingsButton>
</View>
</View> </View>
) )
......
...@@ -5,16 +5,22 @@ import { TouchableOpacity } from 'react-native' ...@@ -5,16 +5,22 @@ import { TouchableOpacity } from 'react-native'
import AppText from '../../app-text' import AppText from '../../app-text'
import styles from '../../../styles' import styles from '../../../styles'
const SettingsButton = ({ children, ...props }) => { const SettingsButton = ({ children, style, secondary, ...props }) => {
return ( return (
<TouchableOpacity <TouchableOpacity
style={[ style={[
styles.settingsButton, styles.settingsButton,
props.disabled ? styles.settingsButtonDisabled : null secondary ? null : styles.settingsButtonAccent,
props.disabled ? styles.settingsButtonDisabled : null,
style
]} ]}
{ ...props } { ...props }
> >
<AppText style={styles.settingsButtonText}> <AppText style={
secondary ?
styles.settingsButtonSecondaryText :
styles.settingsButtonText
}>
{children} {children}
</AppText> </AppText>
</TouchableOpacity> </TouchableOpacity>
......
...@@ -280,10 +280,12 @@ export default StyleSheet.create({ ...@@ -280,10 +280,12 @@ export default StyleSheet.create({
fontWeight: 'bold' fontWeight: 'bold'
}, },
settingsButton: { settingsButton: {
backgroundColor: secondaryColor,
padding: 10, padding: 10,
alignItems: 'center', alignItems: 'center',
margin: 10, margin: 10
},
settingsButtonAccent: {
backgroundColor: secondaryColor
}, },
settingsButtonDisabled: { settingsButtonDisabled: {
backgroundColor: colorInActive backgroundColor: colorInActive
...@@ -291,6 +293,10 @@ export default StyleSheet.create({ ...@@ -291,6 +293,10 @@ export default StyleSheet.create({
settingsButtonText: { settingsButtonText: {
color: fontOnPrimaryColor color: fontOnPrimaryColor
}, },
settingsButtonSecondaryText: {
color: secondaryColor
},
statsRow: { statsRow: {
flexDirection: 'row', flexDirection: 'row',
width: '100%' width: '100%'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment