Sets default button type to small and moves action names to config file
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user