Sets default button type to small and moves action names to config file

This commit is contained in:
mashazyu
2020-04-20 17:02:11 +02:00
committed by Sofiya Tepikin
parent 45cff710c8
commit bba25aeaac
6 changed files with 20 additions and 11 deletions
+4
View File
@@ -26,6 +26,10 @@ Button.propTypes = {
testID: PropTypes.string
}
Button.defaultProps = {
isSmall: true
}
const text = {
padding: Spacing.base,
textTransform: 'uppercase'
+1 -1
View File
@@ -93,7 +93,7 @@ class Home extends Component {
<View style={styles.line}>
<AppText>{prediction}</AppText>
</View>
<Button onPress={this.navigateToCycleDayView} isCTA>
<Button isCTA isSmall={false} onPress={this.navigateToCycleDayView}>
{labels.addData}
</Button>
{phase && (
+7 -6
View File
@@ -11,6 +11,7 @@ import openShareDialogAndExport from './export-dialog'
import DeleteData from './delete-data'
import labels from '../../../i18n/en/settings'
import { ACTION_DELETE, ACTION_EXPORT, ACTION_IMPORT } from '../../../config'
export default class DataManagement extends Component {
@@ -41,12 +42,12 @@ export default class DataManagement extends Component {
}
startExport = () => {
this.setCurrentAction('export')
this.setCurrentAction(ACTION_EXPORT)
openShareDialogAndExport()
}
startImport = () => {
this.setCurrentAction('import')
this.setCurrentAction(ACTION_IMPORT)
openImportDialog(this.startImportFlow)
}
@@ -56,7 +57,7 @@ export default class DataManagement extends Component {
render() {
const { currentAction, isLoading } = this.state
const isDeletingData = currentAction === 'delete'
const isDeletingData = currentAction === ACTION_DELETE
return (
<AppPage>
@@ -65,13 +66,13 @@ export default class DataManagement extends Component {
<React.Fragment>
<Segment title={labels.export.button}>
<AppText>{labels.export.segmentExplainer}</AppText>
<Button isCTA onPress={this.startExport}>
<Button isCTA isSmall={false} onPress={this.startExport}>
{labels.export.button}
</Button>
</Segment>
<Segment title={labels.import.button}>
<AppText>{labels.import.segmentExplainer}</AppText>
<Button isCTA onPress={this.startImport}>
<Button isCTA isSmall={false} onPress={this.startImport}>
{labels.import.button}
</Button>
</Segment>
@@ -79,7 +80,7 @@ export default class DataManagement extends Component {
<AppText>{labels.deleteSegment.explainer}</AppText>
<DeleteData
isDeletingData = {isDeletingData}
onStartDeletion = {() => this.setCurrentAction('delete')}
onStartDeletion = {() => this.setCurrentAction(ACTION_DELETE)}
/>
</Segment>
</React.Fragment>
@@ -79,7 +79,7 @@ export default class EnterNewPassword extends Component {
{shouldShowErrorMessage &&
<AppText style={styles.error}>{labels.passwordsDontMatch}</AppText>
}
<Button isCTA={isButtonActive} isSmall onPress={this.savePassword}>
<Button isCTA={isButtonActive} onPress={this.savePassword}>
{labels.savePassword}
</Button>
</React.Fragment>
@@ -62,7 +62,7 @@ export default class ConfirmWithPassword extends Component {
render() {
const { password } = this.state
const labels = settings.passwordSettings
const isCTA = password !== null
const isPassword = password !== null
return (
<React.Fragment>
@@ -72,10 +72,10 @@ export default class ConfirmWithPassword extends Component {
value={password}
/>
<View style={styles.container}>
<Button isSmall onPress={this.props.onCancel}>
<Button onPress={this.props.onCancel}>
{shared.cancel}
</Button>
<Button isCTA={isCTA} isSmall onPress={this.initPasswordCheck}>
<Button isCTA={isPassword} onPress={this.initPasswordCheck}>
{shared.confirmToProceed}
</Button>
</View>