Prettify settings files
This commit is contained in:
@@ -3,4 +3,4 @@ import { shared as sharedLabels } from '../../../i18n/en/labels'
|
|||||||
|
|
||||||
export default function alertError(msg) {
|
export default function alertError(msg) {
|
||||||
Alert.alert(sharedLabels.errorTitle, msg)
|
Alert.alert(sharedLabels.errorTitle, msg)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,7 @@ import styles from '../../../styles'
|
|||||||
|
|
||||||
export default function PasswordField(props) {
|
export default function PasswordField(props) {
|
||||||
return (
|
return (
|
||||||
<AppTextInput
|
<AppTextInput style={styles.passwordField} secureTextEntry {...props} />
|
||||||
style={ styles.passwordField }
|
|
||||||
secureTextEntry
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -18,5 +14,5 @@ PasswordField.propTypes = {
|
|||||||
placeholder: PropTypes.string,
|
placeholder: PropTypes.string,
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
onChangeText: PropTypes.func,
|
onChangeText: PropTypes.func,
|
||||||
autoFocus: PropTypes.bool
|
autoFocus: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,15 +12,17 @@ const SettingsButton = ({ children, style, secondary, ...props }) => {
|
|||||||
styles.settingsButton,
|
styles.settingsButton,
|
||||||
secondary ? null : styles.settingsButtonAccent,
|
secondary ? null : styles.settingsButtonAccent,
|
||||||
props.disabled ? styles.settingsButtonDisabled : null,
|
props.disabled ? styles.settingsButtonDisabled : null,
|
||||||
style
|
style,
|
||||||
]}
|
]}
|
||||||
{ ...props }
|
{...props}
|
||||||
>
|
>
|
||||||
<AppText style={
|
<AppText
|
||||||
secondary ?
|
style={
|
||||||
styles.settingsButtonSecondaryText :
|
secondary
|
||||||
styles.settingsButtonText
|
? styles.settingsButtonSecondaryText
|
||||||
}>
|
: styles.settingsButtonText
|
||||||
|
}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppText>
|
</AppText>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@@ -32,7 +34,7 @@ SettingsButton.propTypes = {
|
|||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
onPress: PropTypes.func.isRequired,
|
onPress: PropTypes.func.isRequired,
|
||||||
secondary: PropTypes.bool,
|
secondary: PropTypes.bool,
|
||||||
style: PropTypes.object
|
style: PropTypes.object,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SettingsButton
|
export default SettingsButton
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export const EXPORT_FILE_NAME = 'drip-data.csv'
|
export const EXPORT_FILE_NAME = 'drip-data.csv'
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ const License = () => {
|
|||||||
const currentYear = new Date().getFullYear()
|
const currentYear = new Date().getFullYear()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppPage title={t("settings.license.title")}>
|
<AppPage title={t('settings.license.title')}>
|
||||||
<Segment last>
|
<Segment last>
|
||||||
<AppText>{t("settings.license.text", { currentYear })}</AppText>
|
<AppText>{t('settings.license.text', { currentYear })}</AppText>
|
||||||
</Segment>
|
</Segment>
|
||||||
</AppPage>
|
</AppPage>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ const SliderLabel = ({
|
|||||||
oneMarkerValue,
|
oneMarkerValue,
|
||||||
twoMarkerValue,
|
twoMarkerValue,
|
||||||
oneMarkerLeftPosition,
|
oneMarkerLeftPosition,
|
||||||
twoMarkerLeftPosition
|
twoMarkerLeftPosition,
|
||||||
}) => {
|
}) => {
|
||||||
const minCoordinate = getMarkerCoordinate(oneMarkerLeftPosition)
|
const minCoordinate = getMarkerCoordinate(oneMarkerLeftPosition)
|
||||||
const maxCoordinate = getMarkerCoordinate(twoMarkerLeftPosition)
|
const maxCoordinate = getMarkerCoordinate(twoMarkerLeftPosition)
|
||||||
const isMinNumber = Number.isFinite(oneMarkerLeftPosition) &&
|
const isMinNumber =
|
||||||
Number.isFinite(oneMarkerValue)
|
Number.isFinite(oneMarkerLeftPosition) && Number.isFinite(oneMarkerValue)
|
||||||
const isMaxNumber = Number.isFinite(twoMarkerLeftPosition) &&
|
const isMaxNumber =
|
||||||
Number.isFinite(twoMarkerValue)
|
Number.isFinite(twoMarkerLeftPosition) && Number.isFinite(twoMarkerValue)
|
||||||
const minStyle = [styles.label, { left: minCoordinate }]
|
const minStyle = [styles.label, { left: minCoordinate }]
|
||||||
const maxStyle = [styles.label, { left: maxCoordinate }]
|
const maxStyle = [styles.label, { left: maxCoordinate }]
|
||||||
|
|
||||||
@@ -40,15 +40,15 @@ SliderLabel.propTypes = {
|
|||||||
oneMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
oneMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
twoMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
twoMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
oneMarkerLeftPosition: PropTypes.number,
|
oneMarkerLeftPosition: PropTypes.number,
|
||||||
twoMarkerLeftPosition: PropTypes.number
|
twoMarkerLeftPosition: PropTypes.number,
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
label: {
|
label: {
|
||||||
fontFamily: Fonts.bold,
|
fontFamily: Fonts.bold,
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
marginTop: (-1) * Sizes.base
|
marginTop: -1 * Sizes.base,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export default SliderLabel
|
export default SliderLabel
|
||||||
|
|||||||
@@ -7,23 +7,22 @@ import settingsLabels from '../../i18n/en/settings'
|
|||||||
|
|
||||||
const { menuItems } = settingsLabels
|
const { menuItems } = settingsLabels
|
||||||
const menu = [
|
const menu = [
|
||||||
{ ...menuItems.reminders, component: 'Reminders'},
|
{ ...menuItems.reminders, component: 'Reminders' },
|
||||||
{ ...menuItems.nfpSettings, component: 'NfpSettings'},
|
{ ...menuItems.nfpSettings, component: 'NfpSettings' },
|
||||||
{ ...menuItems.dataManagement, component: 'DataManagement'},
|
{ ...menuItems.dataManagement, component: 'DataManagement' },
|
||||||
{ ...menuItems.password, component: 'Password'}
|
{ ...menuItems.password, component: 'Password' },
|
||||||
]
|
]
|
||||||
|
|
||||||
const SettingsMenu = () => {
|
const SettingsMenu = () => {
|
||||||
return (
|
return (
|
||||||
<AppPage title={settingsLabels.title}>
|
<AppPage title={settingsLabels.title}>
|
||||||
{menu.map((menuItem, i) => {
|
{menu.map((menuItem, i) => {
|
||||||
const last = (menu.length === i + 1)
|
const last = menu.length === i + 1
|
||||||
|
|
||||||
return <MenuItem item={menuItem} key={i} last={last}/>
|
return <MenuItem item={menuItem} key={i} last={last} />
|
||||||
}
|
})}
|
||||||
)}
|
|
||||||
</AppPage>
|
</AppPage>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SettingsMenu
|
export default SettingsMenu
|
||||||
|
|||||||
Reference in New Issue
Block a user