Sets default button type to small and moves action names to config file
This commit is contained in:
@@ -26,6 +26,10 @@ Button.propTypes = {
|
|||||||
testID: PropTypes.string
|
testID: PropTypes.string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Button.defaultProps = {
|
||||||
|
isSmall: true
|
||||||
|
}
|
||||||
|
|
||||||
const text = {
|
const text = {
|
||||||
padding: Spacing.base,
|
padding: Spacing.base,
|
||||||
textTransform: 'uppercase'
|
textTransform: 'uppercase'
|
||||||
|
|||||||
+1
-1
@@ -93,7 +93,7 @@ class Home extends Component {
|
|||||||
<View style={styles.line}>
|
<View style={styles.line}>
|
||||||
<AppText>{prediction}</AppText>
|
<AppText>{prediction}</AppText>
|
||||||
</View>
|
</View>
|
||||||
<Button onPress={this.navigateToCycleDayView} isCTA>
|
<Button isCTA isSmall={false} onPress={this.navigateToCycleDayView}>
|
||||||
{labels.addData}
|
{labels.addData}
|
||||||
</Button>
|
</Button>
|
||||||
{phase && (
|
{phase && (
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import openShareDialogAndExport from './export-dialog'
|
|||||||
import DeleteData from './delete-data'
|
import DeleteData from './delete-data'
|
||||||
|
|
||||||
import labels from '../../../i18n/en/settings'
|
import labels from '../../../i18n/en/settings'
|
||||||
|
import { ACTION_DELETE, ACTION_EXPORT, ACTION_IMPORT } from '../../../config'
|
||||||
|
|
||||||
export default class DataManagement extends Component {
|
export default class DataManagement extends Component {
|
||||||
|
|
||||||
@@ -41,12 +42,12 @@ export default class DataManagement extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startExport = () => {
|
startExport = () => {
|
||||||
this.setCurrentAction('export')
|
this.setCurrentAction(ACTION_EXPORT)
|
||||||
openShareDialogAndExport()
|
openShareDialogAndExport()
|
||||||
}
|
}
|
||||||
|
|
||||||
startImport = () => {
|
startImport = () => {
|
||||||
this.setCurrentAction('import')
|
this.setCurrentAction(ACTION_IMPORT)
|
||||||
openImportDialog(this.startImportFlow)
|
openImportDialog(this.startImportFlow)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ export default class DataManagement extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { currentAction, isLoading } = this.state
|
const { currentAction, isLoading } = this.state
|
||||||
const isDeletingData = currentAction === 'delete'
|
const isDeletingData = currentAction === ACTION_DELETE
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppPage>
|
<AppPage>
|
||||||
@@ -65,13 +66,13 @@ export default class DataManagement extends Component {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Segment title={labels.export.button}>
|
<Segment title={labels.export.button}>
|
||||||
<AppText>{labels.export.segmentExplainer}</AppText>
|
<AppText>{labels.export.segmentExplainer}</AppText>
|
||||||
<Button isCTA onPress={this.startExport}>
|
<Button isCTA isSmall={false} onPress={this.startExport}>
|
||||||
{labels.export.button}
|
{labels.export.button}
|
||||||
</Button>
|
</Button>
|
||||||
</Segment>
|
</Segment>
|
||||||
<Segment title={labels.import.button}>
|
<Segment title={labels.import.button}>
|
||||||
<AppText>{labels.import.segmentExplainer}</AppText>
|
<AppText>{labels.import.segmentExplainer}</AppText>
|
||||||
<Button isCTA onPress={this.startImport}>
|
<Button isCTA isSmall={false} onPress={this.startImport}>
|
||||||
{labels.import.button}
|
{labels.import.button}
|
||||||
</Button>
|
</Button>
|
||||||
</Segment>
|
</Segment>
|
||||||
@@ -79,7 +80,7 @@ export default class DataManagement extends Component {
|
|||||||
<AppText>{labels.deleteSegment.explainer}</AppText>
|
<AppText>{labels.deleteSegment.explainer}</AppText>
|
||||||
<DeleteData
|
<DeleteData
|
||||||
isDeletingData = {isDeletingData}
|
isDeletingData = {isDeletingData}
|
||||||
onStartDeletion = {() => this.setCurrentAction('delete')}
|
onStartDeletion = {() => this.setCurrentAction(ACTION_DELETE)}
|
||||||
/>
|
/>
|
||||||
</Segment>
|
</Segment>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export default class EnterNewPassword extends Component {
|
|||||||
{shouldShowErrorMessage &&
|
{shouldShowErrorMessage &&
|
||||||
<AppText style={styles.error}>{labels.passwordsDontMatch}</AppText>
|
<AppText style={styles.error}>{labels.passwordsDontMatch}</AppText>
|
||||||
}
|
}
|
||||||
<Button isCTA={isButtonActive} isSmall onPress={this.savePassword}>
|
<Button isCTA={isButtonActive} onPress={this.savePassword}>
|
||||||
{labels.savePassword}
|
{labels.savePassword}
|
||||||
</Button>
|
</Button>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export default class ConfirmWithPassword extends Component {
|
|||||||
render() {
|
render() {
|
||||||
const { password } = this.state
|
const { password } = this.state
|
||||||
const labels = settings.passwordSettings
|
const labels = settings.passwordSettings
|
||||||
const isCTA = password !== null
|
const isPassword = password !== null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
@@ -72,10 +72,10 @@ export default class ConfirmWithPassword extends Component {
|
|||||||
value={password}
|
value={password}
|
||||||
/>
|
/>
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Button isSmall onPress={this.props.onCancel}>
|
<Button onPress={this.props.onCancel}>
|
||||||
{shared.cancel}
|
{shared.cancel}
|
||||||
</Button>
|
</Button>
|
||||||
<Button isCTA={isCTA} isSmall onPress={this.initPasswordCheck}>
|
<Button isCTA={isPassword} onPress={this.initPasswordCheck}>
|
||||||
{shared.confirmToProceed}
|
{shared.confirmToProceed}
|
||||||
</Button>
|
</Button>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -27,4 +27,8 @@ const config = {
|
|||||||
|
|
||||||
config.columnMiddle = config.columnWidth / 2
|
config.columnMiddle = config.columnWidth / 2
|
||||||
|
|
||||||
|
export const ACTION_DELETE = 'delete'
|
||||||
|
export const ACTION_EXPORT = 'export'
|
||||||
|
export const ACTION_IMPORT = 'import'
|
||||||
|
|
||||||
export default config
|
export default config
|
||||||
Reference in New Issue
Block a user