Prettify misc files
This commit is contained in:
@@ -23,14 +23,16 @@ export default function License({ setLicense }) {
|
||||
|
||||
return (
|
||||
<AppPage testID="licensePage">
|
||||
<Segment last testID="test" title={t("settings.license.title")}>
|
||||
<AppText testID="test">{t("settings.license.text", { currentYear })}</AppText>
|
||||
<Segment last testID="test" title={t('settings.license.title')}>
|
||||
<AppText testID="test">
|
||||
{t('settings.license.text', { currentYear })}
|
||||
</AppText>
|
||||
<View style={styles.container}>
|
||||
<Button onPress={BackHandler.exitApp} testID="licenseCancelButton">
|
||||
{t("labels.shared.cancel")}
|
||||
{t('labels.shared.cancel')}
|
||||
</Button>
|
||||
<Button isCTA onPress={onAcceptLicense} testID="licenseOkButton">
|
||||
{t("labels.shared.ok")}
|
||||
{t('labels.shared.ok')}
|
||||
</Button>
|
||||
</View>
|
||||
</Segment>
|
||||
@@ -39,11 +41,11 @@ export default function License({ setLicense }) {
|
||||
}
|
||||
|
||||
License.propTypes = {
|
||||
setLicense: PropTypes.func.isRequired
|
||||
setLicense: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
...Containers.rowContainer
|
||||
}
|
||||
...Containers.rowContainer,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Colors, Containers } from '../../styles'
|
||||
const SelectBoxGroup = ({ labels, optionsState, onSelect }) => {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{Object.keys(labels).map(key => {
|
||||
{Object.keys(labels).map((key) => {
|
||||
const isActive = optionsState[key]
|
||||
const boxStyle = [styles.box, isActive && styles.boxActive]
|
||||
const textStyle = [styles.text, isActive && styles.textActive]
|
||||
@@ -31,25 +31,25 @@ const SelectBoxGroup = ({ labels, optionsState, onSelect }) => {
|
||||
SelectBoxGroup.propTypes = {
|
||||
labels: PropTypes.object.isRequired,
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
optionsState: PropTypes.object.isRequired
|
||||
optionsState: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
box: {
|
||||
...Containers.box
|
||||
...Containers.box,
|
||||
},
|
||||
boxActive: {
|
||||
...Containers.boxActive
|
||||
...Containers.boxActive,
|
||||
},
|
||||
container: {
|
||||
...Containers.selectGroupContainer
|
||||
...Containers.selectGroupContainer,
|
||||
},
|
||||
text: {
|
||||
color: Colors.orange
|
||||
color: Colors.orange,
|
||||
},
|
||||
textActive: {
|
||||
color: 'white'
|
||||
}
|
||||
color: 'white',
|
||||
},
|
||||
})
|
||||
|
||||
export default SelectBoxGroup
|
||||
|
||||
@@ -9,23 +9,21 @@ import { Colors, Containers } from '../../styles'
|
||||
export default function SelectTabGroup({ activeButton, buttons, onSelect }) {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{
|
||||
buttons.map(({ label, value }, i) => {
|
||||
const isActive = value === activeButton
|
||||
const boxStyle = [styles.box, isActive && styles.boxActive]
|
||||
const textStyle = [styles.text, isActive && styles.textActive]
|
||||
{buttons.map(({ label, value }, i) => {
|
||||
const isActive = value === activeButton
|
||||
const boxStyle = [styles.box, isActive && styles.boxActive]
|
||||
const textStyle = [styles.text, isActive && styles.textActive]
|
||||
|
||||
return (
|
||||
<TouchableOpacity
|
||||
onPress={() => onSelect(value)}
|
||||
key={i}
|
||||
style={boxStyle}
|
||||
>
|
||||
<AppText style={textStyle}>{label}</AppText>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
})
|
||||
}
|
||||
return (
|
||||
<TouchableOpacity
|
||||
onPress={() => onSelect(value)}
|
||||
key={i}
|
||||
style={boxStyle}
|
||||
>
|
||||
<AppText style={textStyle}>{label}</AppText>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
})}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -33,23 +31,23 @@ export default function SelectTabGroup({ activeButton, buttons, onSelect }) {
|
||||
SelectTabGroup.propTypes = {
|
||||
activeButton: PropTypes.number,
|
||||
buttons: PropTypes.array.isRequired,
|
||||
onSelect: PropTypes.func.isRequired
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
box: {
|
||||
...Containers.box
|
||||
...Containers.box,
|
||||
},
|
||||
boxActive: {
|
||||
...Containers.boxActive
|
||||
...Containers.boxActive,
|
||||
},
|
||||
container: {
|
||||
...Containers.selectGroupContainer
|
||||
...Containers.selectGroupContainer,
|
||||
},
|
||||
text: {
|
||||
color: Colors.orange
|
||||
color: Colors.orange,
|
||||
},
|
||||
textActive: {
|
||||
color: 'white'
|
||||
}
|
||||
color: 'white',
|
||||
},
|
||||
})
|
||||
@@ -8,29 +8,28 @@ import HamburgerMenu from './hamburger-menu'
|
||||
import { Colors, Containers, Sizes } from '../../styles'
|
||||
|
||||
const Header = ({ isSideMenuEnabled }) => {
|
||||
|
||||
return (
|
||||
<View style={styles.header}>
|
||||
<Logo />
|
||||
{isSideMenuEnabled && <HamburgerMenu />}
|
||||
</View >
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Header.propTypes = {
|
||||
isSideMenuEnabled: PropTypes.bool
|
||||
isSideMenuEnabled: PropTypes.bool,
|
||||
}
|
||||
|
||||
Header.defaultProps = {
|
||||
isSideMenuEnabled: true
|
||||
isSideMenuEnabled: true,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
header: {
|
||||
backgroundColor: Colors.purple,
|
||||
padding: Sizes.base,
|
||||
...Containers.rowContainer
|
||||
}
|
||||
...Containers.rowContainer,
|
||||
},
|
||||
})
|
||||
|
||||
export default Header
|
||||
@@ -1,5 +1,7 @@
|
||||
import Toast from 'react-native-simple-toast'
|
||||
|
||||
export const showToast = (text) => Toast.show(
|
||||
text, Toast.SHORT, ['RCTModalHostViewController', 'UIAlertController']
|
||||
)
|
||||
export const showToast = (text) =>
|
||||
Toast.show(text, Toast.SHORT, [
|
||||
'RCTModalHostViewController',
|
||||
'UIAlertController',
|
||||
])
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export const getLabelsList =
|
||||
(categories) => categories.map((label, i) => ({ label, value: i }))
|
||||
export const getLabelsList = (categories) =>
|
||||
categories.map((label, i) => ({ label, value: i }))
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
|
||||
export default function (jsDate) {
|
||||
const vals = [jsDate.getHours(), jsDate.getMinutes()]
|
||||
return vals.map(val => {
|
||||
if (parseInt(val) < 10) {
|
||||
val = `0${val}`
|
||||
}
|
||||
return val
|
||||
}).join(':')
|
||||
return vals
|
||||
.map((val) => {
|
||||
if (parseInt(val) < 10) {
|
||||
val = `0${val}`
|
||||
}
|
||||
return val
|
||||
})
|
||||
.join(':')
|
||||
}
|
||||
@@ -7,11 +7,11 @@ import { Containers } from '../../styles'
|
||||
import { pages } from '../pages'
|
||||
|
||||
const Menu = () => {
|
||||
const menuItems = pages.filter(page => page.isInMenu)
|
||||
const menuItems = pages.filter((page) => page.isInMenu)
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{ menuItems.map(({ icon, label, component }) => {
|
||||
{menuItems.map(({ icon, label, component }) => {
|
||||
return (
|
||||
<MenuItem
|
||||
component={component}
|
||||
@@ -19,17 +19,17 @@ const Menu = () => {
|
||||
key={label}
|
||||
label={label}
|
||||
/>
|
||||
)}
|
||||
)}
|
||||
</View >
|
||||
)
|
||||
})}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
backgroundColor: 'white',
|
||||
...Containers.rowContainer
|
||||
}
|
||||
...Containers.rowContainer,
|
||||
},
|
||||
})
|
||||
|
||||
export default Menu
|
||||
Reference in New Issue
Block a user