Merge branch 'chore/batch-prettify' into 'main'
Chore/batch prettify See merge request bloodyhealth/drip!501
This commit is contained in:
@@ -3,4 +3,4 @@ import { shared as sharedLabels } from '../../../i18n/en/labels'
|
||||
|
||||
export default function alertError(msg) {
|
||||
Alert.alert(sharedLabels.errorTitle, msg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,7 @@ import styles from '../../../styles'
|
||||
|
||||
export default function PasswordField(props) {
|
||||
return (
|
||||
<AppTextInput
|
||||
style={ styles.passwordField }
|
||||
secureTextEntry
|
||||
{...props}
|
||||
/>
|
||||
<AppTextInput style={styles.passwordField} secureTextEntry {...props} />
|
||||
)
|
||||
}
|
||||
|
||||
@@ -18,5 +14,5 @@ PasswordField.propTypes = {
|
||||
placeholder: PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
onChangeText: PropTypes.func,
|
||||
autoFocus: PropTypes.bool
|
||||
autoFocus: PropTypes.bool,
|
||||
}
|
||||
|
||||
@@ -12,15 +12,17 @@ const SettingsButton = ({ children, style, secondary, ...props }) => {
|
||||
styles.settingsButton,
|
||||
secondary ? null : styles.settingsButtonAccent,
|
||||
props.disabled ? styles.settingsButtonDisabled : null,
|
||||
style
|
||||
style,
|
||||
]}
|
||||
{ ...props }
|
||||
{...props}
|
||||
>
|
||||
<AppText style={
|
||||
secondary ?
|
||||
styles.settingsButtonSecondaryText :
|
||||
styles.settingsButtonText
|
||||
}>
|
||||
<AppText
|
||||
style={
|
||||
secondary
|
||||
? styles.settingsButtonSecondaryText
|
||||
: styles.settingsButtonText
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppText>
|
||||
</TouchableOpacity>
|
||||
@@ -32,7 +34,7 @@ SettingsButton.propTypes = {
|
||||
disabled: PropTypes.bool,
|
||||
onPress: PropTypes.func.isRequired,
|
||||
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()
|
||||
|
||||
return (
|
||||
<AppPage title={t("settings.license.title")}>
|
||||
<AppPage title={t('settings.license.title')}>
|
||||
<Segment last>
|
||||
<AppText>{t("settings.license.text", { currentYear })}</AppText>
|
||||
<AppText>{t('settings.license.text', { currentYear })}</AppText>
|
||||
</Segment>
|
||||
</AppPage>
|
||||
)
|
||||
|
||||
@@ -17,14 +17,14 @@ const SliderLabel = ({
|
||||
oneMarkerValue,
|
||||
twoMarkerValue,
|
||||
oneMarkerLeftPosition,
|
||||
twoMarkerLeftPosition
|
||||
twoMarkerLeftPosition,
|
||||
}) => {
|
||||
const minCoordinate = getMarkerCoordinate(oneMarkerLeftPosition)
|
||||
const maxCoordinate = getMarkerCoordinate(twoMarkerLeftPosition)
|
||||
const isMinNumber = Number.isFinite(oneMarkerLeftPosition) &&
|
||||
Number.isFinite(oneMarkerValue)
|
||||
const isMaxNumber = Number.isFinite(twoMarkerLeftPosition) &&
|
||||
Number.isFinite(twoMarkerValue)
|
||||
const isMinNumber =
|
||||
Number.isFinite(oneMarkerLeftPosition) && Number.isFinite(oneMarkerValue)
|
||||
const isMaxNumber =
|
||||
Number.isFinite(twoMarkerLeftPosition) && Number.isFinite(twoMarkerValue)
|
||||
const minStyle = [styles.label, { left: minCoordinate }]
|
||||
const maxStyle = [styles.label, { left: maxCoordinate }]
|
||||
|
||||
@@ -40,15 +40,15 @@ SliderLabel.propTypes = {
|
||||
oneMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
twoMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
oneMarkerLeftPosition: PropTypes.number,
|
||||
twoMarkerLeftPosition: PropTypes.number
|
||||
twoMarkerLeftPosition: PropTypes.number,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
label: {
|
||||
fontFamily: Fonts.bold,
|
||||
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 menu = [
|
||||
{ ...menuItems.reminders, component: 'Reminders'},
|
||||
{ ...menuItems.nfpSettings, component: 'NfpSettings'},
|
||||
{ ...menuItems.dataManagement, component: 'DataManagement'},
|
||||
{ ...menuItems.password, component: 'Password'}
|
||||
{ ...menuItems.reminders, component: 'Reminders' },
|
||||
{ ...menuItems.nfpSettings, component: 'NfpSettings' },
|
||||
{ ...menuItems.dataManagement, component: 'DataManagement' },
|
||||
{ ...menuItems.password, component: 'Password' },
|
||||
]
|
||||
|
||||
const SettingsMenu = () => {
|
||||
return (
|
||||
<AppPage title={settingsLabels.title}>
|
||||
{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>
|
||||
)
|
||||
}
|
||||
|
||||
export default SettingsMenu
|
||||
export default SettingsMenu
|
||||
|
||||
Reference in New Issue
Block a user