Adds disabled prop to Button, style change name in AppSwitch component
This commit is contained in:
@@ -8,7 +8,7 @@ import { Containers } from '../../styles/redesign'
|
|||||||
|
|
||||||
const AppSwitch = ({ onToggle, text, value }) => {
|
const AppSwitch = ({ onToggle, text, value }) => {
|
||||||
return (
|
return (
|
||||||
<View style={styles.line}>
|
<View style={styles.container}>
|
||||||
<View style={styles.textContainer}>
|
<View style={styles.textContainer}>
|
||||||
<AppText>{text}</AppText>
|
<AppText>{text}</AppText>
|
||||||
</View>
|
</View>
|
||||||
@@ -24,7 +24,7 @@ AppSwitch.propTypes = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
line: {
|
container: {
|
||||||
...Containers.rowContainer
|
...Containers.rowContainer
|
||||||
},
|
},
|
||||||
switch: {
|
switch: {
|
||||||
|
|||||||
@@ -6,13 +6,18 @@ import AppText from './app-text'
|
|||||||
|
|
||||||
import { Colors, Fonts, Spacing } from '../../styles/redesign'
|
import { Colors, Fonts, Spacing } from '../../styles/redesign'
|
||||||
|
|
||||||
const Button = ({ children, isCTA, isSmall, onPress, testID }) => {
|
const Button = ({ children, isCTA, isSmall, onPress, testID, ...props }) => {
|
||||||
const buttonStyle = isCTA ? styles.cta : styles.regular
|
const buttonStyle = isCTA ? styles.cta : styles.regular
|
||||||
const textCTA = isCTA ? styles.buttonTextBold : styles.buttonTextRegular
|
const textCTA = isCTA ? styles.buttonTextBold : styles.buttonTextRegular
|
||||||
const textStyle = [ textCTA, isSmall ? textSmall : text]
|
const textStyle = [ textCTA, isSmall ? textSmall : text]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={onPress} style={buttonStyle} testID={testID}>
|
<TouchableOpacity
|
||||||
|
onPress={onPress}
|
||||||
|
style={buttonStyle}
|
||||||
|
testID={testID}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
<AppText style={textStyle}>{children}</AppText>
|
<AppText style={textStyle}>{children}</AppText>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -75,7 +75,11 @@ export default class ConfirmWithPassword extends Component {
|
|||||||
<Button onPress={this.props.onCancel}>
|
<Button onPress={this.props.onCancel}>
|
||||||
{shared.cancel}
|
{shared.cancel}
|
||||||
</Button>
|
</Button>
|
||||||
<Button isCTA={isPassword} onPress={this.initPasswordCheck}>
|
<Button
|
||||||
|
disabled={!isPassword}
|
||||||
|
isCTA={isPassword}
|
||||||
|
onPress={this.initPasswordCheck}
|
||||||
|
>
|
||||||
{shared.confirmToProceed}
|
{shared.confirmToProceed}
|
||||||
</Button>
|
</Button>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user