Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e2d6387647 | |||
| b6024ae921 | |||
| d17e7ed6a2 |
@@ -14,4 +14,3 @@ updates:
|
||||
- dependency-name: 'react'
|
||||
- dependency-name: 'react-native'
|
||||
- dependency-name: 'react-native-push-notifications'
|
||||
- dependency-name: '@babel/core'
|
||||
|
||||
@@ -201,3 +201,7 @@ More information about how the app calculates fertility status and bleeding pred
|
||||
react-native link
|
||||
|
||||
5. You should be able to use the icon now within drip, e.g. in Cycle Day Overview and on the chart.
|
||||
|
||||
## Translation
|
||||
|
||||
We are using [Weblate](https://weblate.org/) as translation software.
|
||||
|
||||
@@ -5,7 +5,7 @@ buildscript {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
ext.kotlinVersion = "1.3.10"
|
||||
ext.kotlinVersion = "1.4.20"
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:4.2.2")
|
||||
|
||||
|
||||
+11
-9
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
import React, { useEffect } from 'react'
|
||||
import { ScrollView, StyleSheet, View } from 'react-native'
|
||||
import PropTypes from 'prop-types'
|
||||
import moment from 'moment'
|
||||
@@ -10,6 +10,7 @@ import Footnote from './common/Footnote'
|
||||
|
||||
import cycleModule from '../lib/cycle'
|
||||
import { getFertilityStatusForDay } from '../lib/sympto-adapter'
|
||||
import setupNotifications from '../lib/notifications'
|
||||
import {
|
||||
determinePredictionText,
|
||||
formatWithOrdinalSuffix,
|
||||
@@ -19,13 +20,10 @@ import { Colors, Fonts, Sizes, Spacing } from '../styles'
|
||||
import { LocalDate } from '@js-joda/core'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
const Home = ({ navigate, setDate }) => {
|
||||
const Home = ({ navigation }) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
function navigateToCycleDayView() {
|
||||
setDate(todayDateString)
|
||||
navigate('CycleDay')
|
||||
}
|
||||
useEffect(() => setupNotifications(navigation), [])
|
||||
|
||||
const todayDateString = LocalDate.now().toString()
|
||||
const { getCycleDayNumber, getPredictedMenses } = cycleModule()
|
||||
@@ -33,11 +31,14 @@ const Home = ({ navigate, setDate }) => {
|
||||
const { status, phase, statusText } =
|
||||
getFertilityStatusForDay(todayDateString)
|
||||
const prediction = determinePredictionText(getPredictedMenses(), t)
|
||||
|
||||
const cycleDayText = cycleDayNumber
|
||||
? formatWithOrdinalSuffix(cycleDayNumber)
|
||||
: ''
|
||||
|
||||
function navigateToCycleDayView() {
|
||||
navigation.navigate('CycleDayOverview', { date: todayDateString })
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollView
|
||||
style={styles.container}
|
||||
@@ -109,8 +110,9 @@ const styles = StyleSheet.create({
|
||||
})
|
||||
|
||||
Home.propTypes = {
|
||||
navigate: PropTypes.func,
|
||||
setDate: PropTypes.func,
|
||||
navigation: PropTypes.shape({
|
||||
navigate: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
}
|
||||
|
||||
export default Home
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
|
||||
import { getLicenseFlag, saveEncryptionFlag } from '../local-storage'
|
||||
import { openDb } from '../db'
|
||||
import { closeDb, openDb } from '../db'
|
||||
|
||||
import App from './app'
|
||||
import AppLoadingView from './common/app-loading'
|
||||
@@ -29,6 +29,8 @@ export default function AppWrapper() {
|
||||
useEffect(() => {
|
||||
checkIsLicenseAccepted()
|
||||
checkIsDbEncrypted()
|
||||
|
||||
return () => closeDb()
|
||||
}, [])
|
||||
|
||||
if (isLoading) {
|
||||
|
||||
+64
-53
@@ -1,71 +1,82 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { BackHandler, StyleSheet, View } from 'react-native'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
import { LocalDate } from '@js-joda/core'
|
||||
import React from 'react'
|
||||
import 'react-native-gesture-handler'
|
||||
import { StyleSheet, Text } from 'react-native'
|
||||
import { NavigationContainer } from '@react-navigation/native'
|
||||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
|
||||
import { createStackNavigator } from '@react-navigation/stack'
|
||||
|
||||
import Home from './Home'
|
||||
import Chart from './chart/chart'
|
||||
import CalendarView from './calendar'
|
||||
import CycleDayOverview from './cycle-day/cycle-day-overview'
|
||||
import Stats from './stats'
|
||||
import Icon from './common/menu-icon'
|
||||
import Header from './header'
|
||||
import Menu from './menu'
|
||||
import { viewsList } from './views'
|
||||
import { pages } from './pages'
|
||||
|
||||
import setupNotifications from '../lib/notifications'
|
||||
import { closeDb } from '../db'
|
||||
import { Colors, Fonts, Sizes } from '../styles'
|
||||
|
||||
const App = ({ restartApp }) => {
|
||||
const [date, setDate] = useState(LocalDate.now().toString())
|
||||
const [currentPage, setCurrentPage] = useState('Home')
|
||||
const goBack = () => {
|
||||
if (currentPage === 'Home') {
|
||||
closeDb()
|
||||
BackHandler.exitApp()
|
||||
} else {
|
||||
const { parent } = pages.find((p) => p.component === currentPage)
|
||||
|
||||
setCurrentPage(parent)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const backHandler = BackHandler.addEventListener(
|
||||
'hardwareBackPress',
|
||||
goBack
|
||||
)
|
||||
|
||||
return () => backHandler.remove()
|
||||
})
|
||||
|
||||
useEffect(() => setupNotifications(setCurrentPage, setDate), [])
|
||||
|
||||
const Page = viewsList[currentPage]
|
||||
const isTemperatureEditView = currentPage === 'TemperatureEditView'
|
||||
const headerProps = { navigate: setCurrentPage }
|
||||
const pageProps = {
|
||||
date,
|
||||
setDate,
|
||||
isTemperatureEditView,
|
||||
navigate: setCurrentPage,
|
||||
}
|
||||
const HomeStack = createStackNavigator()
|
||||
|
||||
function HomeStackScreen() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Header {...headerProps} />
|
||||
<Page {...pageProps} restartApp={restartApp} />
|
||||
<Menu currentPage={currentPage} navigate={setCurrentPage} />
|
||||
</View>
|
||||
<HomeStack.Navigator screenOptions={{ headerShown: false }}>
|
||||
<HomeStack.Screen name="Home" component={Home} />
|
||||
<HomeStack.Screen name="CycleDayOverview" component={CycleDayOverview} />
|
||||
</HomeStack.Navigator>
|
||||
)
|
||||
}
|
||||
|
||||
App.propTypes = {
|
||||
restartApp: PropTypes.func,
|
||||
const Tab = createBottomTabNavigator()
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<NavigationContainer>
|
||||
<Tab.Navigator
|
||||
screenOptions={({ route }) => ({
|
||||
header: ({ navigation }) => <Header navigation={navigation} />,
|
||||
tabBarIcon: ({ focused }) => {
|
||||
let icon = 'chart'
|
||||
|
||||
if (route.name === 'CalendarStackScreen') {
|
||||
icon = 'calendar'
|
||||
} else if (route.name === 'Stats') {
|
||||
icon = 'statistics'
|
||||
}
|
||||
|
||||
return <Icon name={icon} isActive={focused} />
|
||||
},
|
||||
tabBarLabel: ({ color }) => {
|
||||
return (
|
||||
<Text style={[styles.text, { color: color }]}>{route.name}</Text>
|
||||
)
|
||||
},
|
||||
tabBarActiveTintColor: Colors.orange,
|
||||
tabBarInactiveTintColor: Colors.grey,
|
||||
tabBarStyle: { height: 80 },
|
||||
})}
|
||||
>
|
||||
<Tab.Screen
|
||||
name="HomeStackScreen"
|
||||
component={HomeStackScreen}
|
||||
options={{ tabBarButton: () => null, tabBarVisible: false }}
|
||||
/>
|
||||
<Tab.Screen name="Calendar" component={CalendarView} />
|
||||
<Tab.Screen name="Chart" component={Chart} />
|
||||
<Tab.Screen name="Stats" component={Stats} />
|
||||
</Tab.Navigator>
|
||||
</NavigationContainer>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
},
|
||||
text: {
|
||||
fontFamily: Fonts.bold,
|
||||
fontSize: Sizes.small,
|
||||
textTransform: 'uppercase',
|
||||
},
|
||||
})
|
||||
|
||||
export default App
|
||||
|
||||
@@ -12,13 +12,12 @@ import {
|
||||
todayToCalFormat,
|
||||
} from './helpers/calendar'
|
||||
|
||||
const CalendarView = ({ setDate, navigate }) => {
|
||||
const CalendarView = ({ navigation }) => {
|
||||
const bleedingDays = getBleedingDaysSortedByDate()
|
||||
const predictedMenses = cycleModule().getPredictedMenses()
|
||||
|
||||
const passDateToDayView = ({ dateString }) => {
|
||||
setDate(dateString)
|
||||
navigate('CycleDay')
|
||||
navigation.navigate('CycleDayOverview', { date: dateString })
|
||||
}
|
||||
|
||||
const markedDates = Object.assign(
|
||||
@@ -49,8 +48,9 @@ const styles = StyleSheet.create({
|
||||
})
|
||||
|
||||
CalendarView.propTypes = {
|
||||
setDate: PropTypes.func.isRequired,
|
||||
navigate: PropTypes.func.isRequired,
|
||||
navigation: PropTypes.shape({
|
||||
navigate: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
}
|
||||
|
||||
export default CalendarView
|
||||
|
||||
@@ -9,7 +9,7 @@ import HorizontalGrid from './horizontal-grid'
|
||||
import MainGrid from './main-grid'
|
||||
import NoData from './no-data'
|
||||
import NoTemperature from './no-temperature'
|
||||
import Tutorial from './Tutorial'
|
||||
import Tutorial from './tutorial'
|
||||
import YAxis from './y-axis'
|
||||
|
||||
import { getCycleDaysSortedByDate } from '../../db'
|
||||
@@ -28,7 +28,7 @@ import { Spacing } from '../../styles'
|
||||
const getSymptomsFromCycleDays = (cycleDays) =>
|
||||
SYMPTOMS.filter((symptom) => cycleDays.some((cycleDay) => cycleDay[symptom]))
|
||||
|
||||
const CycleChart = ({ navigate, setDate }) => {
|
||||
const CycleChart = ({ navigation }) => {
|
||||
const [shouldShowHint, setShouldShowHint] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -84,9 +84,8 @@ const CycleChart = ({ navigate, setDate }) => {
|
||||
const renderColumn = ({ item }) => {
|
||||
return (
|
||||
<DayColumn
|
||||
setDate={setDate}
|
||||
dateString={item}
|
||||
navigate={navigate}
|
||||
navigation={navigation}
|
||||
symptomHeight={symptomHeight}
|
||||
columnHeight={columnHeight}
|
||||
symptomRowSymptoms={symptomRowSymptoms}
|
||||
@@ -100,7 +99,7 @@ const CycleChart = ({ navigate, setDate }) => {
|
||||
const hasDataToDisplay = chartSymptoms.length > 0
|
||||
|
||||
if (!hasDataToDisplay) {
|
||||
return <NoData navigate={navigate} />
|
||||
return <NoData />
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -135,8 +134,9 @@ const CycleChart = ({ navigate, setDate }) => {
|
||||
}
|
||||
|
||||
CycleChart.propTypes = {
|
||||
navigate: PropTypes.func,
|
||||
setDate: PropTypes.func,
|
||||
navigation: PropTypes.shape({
|
||||
navigate: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
@@ -19,8 +19,7 @@ const DayColumn = ({
|
||||
dateString,
|
||||
chartSymptoms,
|
||||
columnHeight,
|
||||
setDate,
|
||||
navigate,
|
||||
navigation,
|
||||
shouldShowTemperatureColumn,
|
||||
symptomHeight,
|
||||
symptomRowSymptoms,
|
||||
@@ -60,10 +59,8 @@ const DayColumn = ({
|
||||
columnHeight
|
||||
)
|
||||
|
||||
const onDaySelect = (date) => {
|
||||
setDate(date)
|
||||
navigate('CycleDay')
|
||||
}
|
||||
const onDaySelect = (date) =>
|
||||
navigation.navigate('CycleDayOverview', { date })
|
||||
|
||||
return (
|
||||
<TouchableOpacity onPress={() => onDaySelect(dateString)} activeOpacity={1}>
|
||||
@@ -104,12 +101,13 @@ DayColumn.propTypes = {
|
||||
dateString: PropTypes.string.isRequired,
|
||||
chartSymptoms: PropTypes.array,
|
||||
columnHeight: PropTypes.number.isRequired,
|
||||
navigate: PropTypes.func.isRequired,
|
||||
setDate: PropTypes.func.isRequired,
|
||||
shouldShowTemperatureColumn: PropTypes.bool,
|
||||
symptomHeight: PropTypes.number.isRequired,
|
||||
symptomRowSymptoms: PropTypes.array,
|
||||
xAxisHeight: PropTypes.number,
|
||||
navigation: PropTypes.shape({
|
||||
navigate: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
}
|
||||
|
||||
export default DayColumn
|
||||
|
||||
@@ -6,17 +6,16 @@ import AppText from '../common/app-text'
|
||||
import CloseIcon from '../common/close-icon'
|
||||
|
||||
import { Containers, Spacing } from '../../styles'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { chart } from '../../i18n/en/labels'
|
||||
|
||||
const image = require('../../assets/swipe.png')
|
||||
|
||||
const Tutorial = ({ onClose }) => {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Image resizeMode="contain" source={image} style={styles.image} />
|
||||
<View style={styles.textContainer}>
|
||||
<AppText>{t('chart.tutorial')}</AppText>
|
||||
<AppText>{chart.tutorial}</AppText>
|
||||
</View>
|
||||
<CloseIcon onClose={onClose} />
|
||||
</View>
|
||||
@@ -12,7 +12,8 @@ import { getData, nextDate, prevDate } from '../helpers/cycle-day'
|
||||
import { Spacing } from '../../styles'
|
||||
import { SYMPTOMS } from '../../config'
|
||||
|
||||
const CycleDayOverView = ({ date, setDate, isTemperatureEditView }) => {
|
||||
const CycleDayOverView = ({ route }) => {
|
||||
const { date, isTemperatureEditView } = route.params
|
||||
const cycleDay = getCycleDay(date)
|
||||
|
||||
const [editedSymptom, setEditedSymptom] = useState(
|
||||
@@ -20,11 +21,11 @@ const CycleDayOverView = ({ date, setDate, isTemperatureEditView }) => {
|
||||
)
|
||||
|
||||
const showNextCycleDay = () => {
|
||||
setDate(nextDate(date))
|
||||
//setDate(nextDate(date))
|
||||
}
|
||||
|
||||
const showPrevCycleDay = () => {
|
||||
setDate(prevDate(date))
|
||||
//setDate(prevDate(date))
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -57,10 +58,12 @@ const CycleDayOverView = ({ date, setDate, isTemperatureEditView }) => {
|
||||
}
|
||||
|
||||
CycleDayOverView.propTypes = {
|
||||
cycleDay: PropTypes.object,
|
||||
date: PropTypes.string,
|
||||
setDate: PropTypes.func,
|
||||
isTemperatureEditView: PropTypes.bool,
|
||||
route: PropTypes.shape({
|
||||
params: PropTypes.shape({
|
||||
date: PropTypes.string,
|
||||
isTemperatureEditView: PropTypes.bool,
|
||||
}),
|
||||
}),
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
@@ -7,17 +7,17 @@ import HamburgerMenu from './hamburger-menu'
|
||||
|
||||
import { Colors, Containers, Sizes } from '../../styles'
|
||||
|
||||
const Header = ({ isStatic, navigate }) => {
|
||||
const Header = ({ isStatic, navigation }) => {
|
||||
return (
|
||||
<View style={styles.header}>
|
||||
{isStatic ? (
|
||||
<Logo />
|
||||
) : (
|
||||
<>
|
||||
<TouchableOpacity onPress={() => navigate('Home')}>
|
||||
<TouchableOpacity onPress={() => navigation.navigate('Home')}>
|
||||
<Logo />
|
||||
</TouchableOpacity>
|
||||
<HamburgerMenu navigate={navigate} />
|
||||
<HamburgerMenu navigate={navigation.navigate} />
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
@@ -26,7 +26,9 @@ const Header = ({ isStatic, navigate }) => {
|
||||
|
||||
Header.propTypes = {
|
||||
isStatic: PropTypes.bool,
|
||||
navigate: PropTypes.func,
|
||||
navigation: PropTypes.shape({
|
||||
navigate: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
}
|
||||
|
||||
Header.defaultProps = {
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
import React from 'react'
|
||||
import { StyleSheet, View } from 'react-native'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
import MenuItem from './menu-item'
|
||||
|
||||
import { Containers } from '../../styles'
|
||||
import { pages } from '../pages'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
const Menu = ({ currentPage, navigate }) => {
|
||||
const menuItems = pages.filter((page) => page.isInMenu)
|
||||
|
||||
const { t } = useTranslation(null, { keyPrefix: 'bottomMenu' })
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{menuItems.map(({ icon, labelKey, component }) => {
|
||||
return (
|
||||
<MenuItem
|
||||
isActive={component === currentPage}
|
||||
onPress={() => navigate(component)}
|
||||
icon={icon}
|
||||
key={labelKey}
|
||||
label={t(labelKey)}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Menu.propTypes = {
|
||||
currentPage: PropTypes.string,
|
||||
navigate: PropTypes.func,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
backgroundColor: 'white',
|
||||
...Containers.rowContainer,
|
||||
},
|
||||
})
|
||||
|
||||
export default Menu
|
||||
+15
-3
@@ -1,63 +1,75 @@
|
||||
import settingsViews from './settings'
|
||||
|
||||
import settingsLabels from '../i18n/en/settings'
|
||||
const labels = settingsLabels.menuItems
|
||||
|
||||
export const pages = [
|
||||
{
|
||||
component: 'Home',
|
||||
icon: 'home',
|
||||
label: 'Home',
|
||||
},
|
||||
{
|
||||
component: 'Calendar',
|
||||
icon: 'calendar',
|
||||
isInMenu: true,
|
||||
labelKey: 'calendar',
|
||||
label: 'Calendar',
|
||||
parent: 'Home',
|
||||
},
|
||||
{
|
||||
component: 'Chart',
|
||||
icon: 'chart',
|
||||
isInMenu: true,
|
||||
labelKey: 'chart',
|
||||
label: 'Chart',
|
||||
parent: 'Home',
|
||||
},
|
||||
{
|
||||
component: 'Stats',
|
||||
icon: 'statistics',
|
||||
isInMenu: true,
|
||||
labelKey: 'stats',
|
||||
label: 'Stats',
|
||||
parent: 'Home',
|
||||
},
|
||||
{
|
||||
children: Object.keys(settingsViews),
|
||||
component: 'SettingsMenu',
|
||||
icon: 'settings',
|
||||
label: 'Settings',
|
||||
parent: 'Home',
|
||||
},
|
||||
{
|
||||
component: 'Reminders',
|
||||
label: labels.reminders.name,
|
||||
parent: 'SettingsMenu',
|
||||
},
|
||||
{
|
||||
component: 'NfpSettings',
|
||||
label: labels.nfpSettings.name,
|
||||
parent: 'SettingsMenu',
|
||||
},
|
||||
{
|
||||
component: 'DataManagement',
|
||||
label: labels.dataManagement.name,
|
||||
parent: 'SettingsMenu',
|
||||
},
|
||||
{
|
||||
component: 'Password',
|
||||
label: labels.password.name,
|
||||
parent: 'SettingsMenu',
|
||||
},
|
||||
{
|
||||
component: 'About',
|
||||
label: 'About',
|
||||
parent: 'SettingsMenu',
|
||||
},
|
||||
{
|
||||
component: 'License',
|
||||
label: 'License',
|
||||
parent: 'SettingsMenu',
|
||||
},
|
||||
{
|
||||
component: 'PrivacyPolicy',
|
||||
label: 'PrivacyPolicy',
|
||||
parent: 'SettingsMenu',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Alert } from 'react-native'
|
||||
import DocumentPicker from 'react-native-document-picker'
|
||||
import rnfs from 'react-native-fs'
|
||||
import importCsv from '../../../lib/import-export/import-from-csv'
|
||||
import alertError from '../common/alert-error'
|
||||
import Segment from '../../common/segment'
|
||||
import AppText from '../../common/app-text'
|
||||
import Button from '../../common/button'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export default function ImportData({ resetIsDeletingData, setIsLoading }) {
|
||||
const { t } = useTranslation(null, {
|
||||
keyPrefix: 'hamburgerMenu.settings.data.import',
|
||||
})
|
||||
|
||||
async function startImport(shouldDeleteExistingData) {
|
||||
setIsLoading(true)
|
||||
await importData(shouldDeleteExistingData)
|
||||
setIsLoading(false)
|
||||
}
|
||||
|
||||
async function getFileInfo() {
|
||||
try {
|
||||
const fileInfo = await DocumentPicker.pickSingle({
|
||||
type: [DocumentPicker.types.csv, 'text/comma-separated-values'],
|
||||
})
|
||||
return fileInfo
|
||||
} catch (error) {
|
||||
if (DocumentPicker.isCancel(error)) return // User cancelled the picker, exit any dialogs or menus and move on
|
||||
showImportErrorAlert(error)
|
||||
}
|
||||
}
|
||||
|
||||
async function getFileContent() {
|
||||
const fileInfo = await getFileInfo()
|
||||
if (!fileInfo) return null
|
||||
|
||||
try {
|
||||
const fileContent = await rnfs.readFile(fileInfo.uri, 'utf8')
|
||||
return fileContent
|
||||
} catch (err) {
|
||||
return showImportErrorAlert(t('error.couldNotOpenFile'))
|
||||
}
|
||||
}
|
||||
|
||||
async function importData(shouldDeleteExistingData) {
|
||||
const fileContent = await getFileContent()
|
||||
if (!fileContent) return
|
||||
|
||||
try {
|
||||
await importCsv(fileContent, shouldDeleteExistingData)
|
||||
Alert.alert(t('success.title'), t('success.message'))
|
||||
} catch (err) {
|
||||
showImportErrorAlert(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
function openImportDialog() {
|
||||
resetIsDeletingData()
|
||||
Alert.alert(t('dialog.title'), t('dialog.message'), [
|
||||
{
|
||||
text: t('dialog.cancel'),
|
||||
style: 'cancel',
|
||||
onPress: () => {},
|
||||
},
|
||||
{
|
||||
text: t('dialog.replace'),
|
||||
onPress: () => startImport(false),
|
||||
},
|
||||
{
|
||||
text: t('dialog.delete'),
|
||||
onPress: () => startImport(true),
|
||||
},
|
||||
])
|
||||
}
|
||||
|
||||
function showImportErrorAlert(message) {
|
||||
const errorMessage = t('error.noDataImported', { message })
|
||||
alertError(errorMessage)
|
||||
}
|
||||
|
||||
return (
|
||||
<Segment title={t('button')}>
|
||||
<AppText>{t('segmentExplainer')}</AppText>
|
||||
<Button isCTA onPress={openImportDialog}>
|
||||
{t('button')}
|
||||
</Button>
|
||||
</Segment>
|
||||
)
|
||||
}
|
||||
|
||||
ImportData.propTypes = {
|
||||
resetIsDeletingData: PropTypes.func.isRequired,
|
||||
setIsLoading: PropTypes.func.isRequired,
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import { Alert } from 'react-native'
|
||||
import DocumentPicker from 'react-native-document-picker'
|
||||
import rnfs from 'react-native-fs'
|
||||
import importCsv from '../../../lib/import-export/import-from-csv'
|
||||
import { shared as sharedLabels } from '../../../i18n/en/labels'
|
||||
import labels from '../../../i18n/en/settings'
|
||||
import alertError from '../common/alert-error'
|
||||
|
||||
export function openImportDialog(onImportData) {
|
||||
Alert.alert(labels.import.title, labels.import.message, [
|
||||
{
|
||||
text: sharedLabels.cancel,
|
||||
style: 'cancel',
|
||||
onPress: () => {},
|
||||
},
|
||||
{
|
||||
text: labels.import.replaceOption,
|
||||
onPress: () => onImportData(false),
|
||||
},
|
||||
{
|
||||
text: labels.import.deleteOption,
|
||||
onPress: () => onImportData(true),
|
||||
},
|
||||
])
|
||||
}
|
||||
|
||||
export async function getFileContent() {
|
||||
let fileInfo
|
||||
try {
|
||||
fileInfo = await DocumentPicker.pickSingle({
|
||||
type: [DocumentPicker.types.csv, 'text/comma-separated-values'],
|
||||
})
|
||||
} catch (error) {
|
||||
if (DocumentPicker.isCancel(error)) {
|
||||
// User cancelled the picker, exit any dialogs or menus and move on
|
||||
return
|
||||
} else {
|
||||
importError(error)
|
||||
}
|
||||
}
|
||||
|
||||
let fileContent
|
||||
try {
|
||||
fileContent = await rnfs.readFile(fileInfo.uri, 'utf8')
|
||||
} catch (err) {
|
||||
return importError(labels.import.errors.couldNotOpenFile)
|
||||
}
|
||||
|
||||
return fileContent
|
||||
}
|
||||
|
||||
export async function importData(shouldDeleteExistingData, fileContent) {
|
||||
try {
|
||||
await importCsv(fileContent, shouldDeleteExistingData)
|
||||
Alert.alert(sharedLabels.successTitle, labels.import.success.message)
|
||||
} catch (err) {
|
||||
importError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
function importError(msg) {
|
||||
const postFixed = `${msg}\n\n${labels.import.errors.postFix}`
|
||||
alertError(postFixed)
|
||||
}
|
||||
+27
-8
@@ -6,23 +6,40 @@ import AppText from '../../common/app-text'
|
||||
import Button from '../../common/button'
|
||||
import Segment from '../../common/segment'
|
||||
|
||||
import { openImportDialog, getFileContent, importData } from './import-dialog'
|
||||
import openShareDialogAndExport from './export-dialog'
|
||||
import DeleteData from './delete-data'
|
||||
|
||||
import labels from '../../../i18n/en/settings'
|
||||
import ImportData from './ImportData'
|
||||
import { ACTION_DELETE, ACTION_EXPORT, ACTION_IMPORT } from '../../../config'
|
||||
|
||||
const DataManagement = () => {
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const [isDeletingData, setIsDeletingData] = useState(false)
|
||||
const [currentAction, setCurrentAction] = useState(null)
|
||||
|
||||
const startImportFlow = async (shouldDeleteExistingData) => {
|
||||
setIsLoading(true)
|
||||
const fileContent = await getFileContent()
|
||||
if (fileContent) {
|
||||
await importData(shouldDeleteExistingData, fileContent)
|
||||
}
|
||||
setIsLoading(false)
|
||||
}
|
||||
|
||||
const startExport = () => {
|
||||
setIsDeletingData(false)
|
||||
setCurrentAction(ACTION_EXPORT)
|
||||
openShareDialogAndExport()
|
||||
}
|
||||
|
||||
const startImport = () => {
|
||||
setCurrentAction(ACTION_IMPORT)
|
||||
openImportDialog(startImportFlow)
|
||||
}
|
||||
|
||||
if (isLoading) return <AppLoadingView />
|
||||
|
||||
const isDeletingData = currentAction === ACTION_DELETE
|
||||
|
||||
return (
|
||||
<AppPage>
|
||||
<Segment title={labels.export.button}>
|
||||
@@ -31,15 +48,17 @@ const DataManagement = () => {
|
||||
{labels.export.button}
|
||||
</Button>
|
||||
</Segment>
|
||||
<ImportData
|
||||
resetIsDeletingData={() => setIsDeletingData(false)}
|
||||
setIsLoading={setIsLoading}
|
||||
/>
|
||||
<Segment title={labels.import.button}>
|
||||
<AppText>{labels.import.segmentExplainer}</AppText>
|
||||
<Button isCTA onPress={startImport}>
|
||||
{labels.import.button}
|
||||
</Button>
|
||||
</Segment>
|
||||
<Segment title={labels.deleteSegment.title} last>
|
||||
<AppText>{labels.deleteSegment.explainer}</AppText>
|
||||
<DeleteData
|
||||
isDeletingData={isDeletingData}
|
||||
onStartDeletion={() => setIsDeletingData(true)}
|
||||
onStartDeletion={() => setCurrentAction(ACTION_DELETE)}
|
||||
/>
|
||||
</Segment>
|
||||
</AppPage>
|
||||
@@ -1,6 +1,6 @@
|
||||
import Reminders from './reminders/reminders'
|
||||
import NfpSettings from './nfp-settings'
|
||||
import DataManagement from './data-management/DataManagement'
|
||||
import DataManagement from './data-management'
|
||||
import Password from './password'
|
||||
import About from './About'
|
||||
import License from './License'
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { PixelRatio, StatusBar } from 'react-native'
|
||||
import { scale, verticalScale } from 'react-native-size-matters'
|
||||
|
||||
export const ACTION_DELETE = 'delete'
|
||||
export const ACTION_EXPORT = 'export'
|
||||
export const ACTION_IMPORT = 'import'
|
||||
|
||||
export const SYMPTOMS = [
|
||||
'bleeding',
|
||||
'temperature',
|
||||
@@ -36,7 +40,7 @@ export const HIT_SLOP = {
|
||||
top: verticalScale(20),
|
||||
bottom: verticalScale(20),
|
||||
left: scale(20),
|
||||
right: scale(20),
|
||||
right: scale(20)
|
||||
}
|
||||
|
||||
export const STATUSBAR_HEIGHT = StatusBar.currentHeight
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
{
|
||||
"bottomMenu": {
|
||||
"calendar": "Calendar",
|
||||
"chart": "Chart",
|
||||
"stats": "Stats"
|
||||
},
|
||||
"chart": {
|
||||
"tutorial": "You can swipe the chart to view more dates."
|
||||
},
|
||||
"cycleDay": {
|
||||
"symptomBox": {
|
||||
"bleeding": "Bleeding",
|
||||
@@ -88,29 +80,6 @@
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"data": {
|
||||
"import": {
|
||||
"button": "Import data",
|
||||
"dialog": {
|
||||
"cancel": "Cancel",
|
||||
"delete": "Import and delete existing",
|
||||
"message": "There are two options for the import:\n\n1. Keep existing cycle days and replace only the ones in the import file.\n\n2. Delete all existing cycle days and import cycle days from file",
|
||||
"replace": "Import and replace",
|
||||
"title": "Keep existing data?"
|
||||
},
|
||||
"error": {
|
||||
"couldNotOpenFile": "Could not open file",
|
||||
"futureEdit": "Future dates may only contain a note, no other symptoms",
|
||||
"incorrectColumns": "Expected CSV column titles to be {{incorrectColumns}}",
|
||||
"noDataImported": "{{message}}\n\nNo data was imported or changed"
|
||||
},
|
||||
"segmentExplainer": "Import data in CSV format",
|
||||
"success": {
|
||||
"message": "Data successfully imported",
|
||||
"title": "Success"
|
||||
}
|
||||
}
|
||||
},
|
||||
"menuItem": {
|
||||
"dataManagement": {
|
||||
"name": "Data",
|
||||
|
||||
@@ -3,6 +3,10 @@ export const home = {
|
||||
phase: (n) => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`,
|
||||
}
|
||||
|
||||
export const chart = {
|
||||
tutorial: 'You can swipe the chart to view more dates.',
|
||||
}
|
||||
|
||||
export const shared = {
|
||||
cancel: 'Cancel',
|
||||
save: 'Save',
|
||||
|
||||
@@ -1,6 +1,24 @@
|
||||
import links from './links'
|
||||
|
||||
export default {
|
||||
menuItems: {
|
||||
reminders: {
|
||||
name: 'Reminders',
|
||||
text: 'turn on/off reminders',
|
||||
},
|
||||
nfpSettings: {
|
||||
name: 'NFP settings',
|
||||
text: 'define how you want to use NFP',
|
||||
},
|
||||
dataManagement: {
|
||||
name: 'Data',
|
||||
text: 'import, export or delete your data',
|
||||
},
|
||||
password: {
|
||||
name: 'Password',
|
||||
text: '',
|
||||
},
|
||||
},
|
||||
export: {
|
||||
errors: {
|
||||
noData: 'There is no data to export',
|
||||
@@ -13,6 +31,24 @@ export default {
|
||||
segmentExplainer:
|
||||
'Export data in CSV format for backup or so you can use it elsewhere',
|
||||
},
|
||||
import: {
|
||||
button: 'Import data',
|
||||
title: 'Keep existing data?',
|
||||
message: `There are two options for the import:
|
||||
1. Keep existing cycle days and replace only the ones in the import file.
|
||||
2. Delete all existing cycle days and import cycle days from file.`,
|
||||
replaceOption: 'Import and replace',
|
||||
deleteOption: 'Import and delete existing',
|
||||
errors: {
|
||||
couldNotOpenFile: 'Could not open file',
|
||||
postFix: 'No data was imported or changed',
|
||||
futureEdit: 'Future dates may only contain a note, no other symptoms',
|
||||
},
|
||||
success: {
|
||||
message: 'Data successfully imported',
|
||||
},
|
||||
segmentExplainer: 'Import data in CSV format',
|
||||
},
|
||||
deleteSegment: {
|
||||
title: 'Delete app data',
|
||||
explainer: 'Delete app data from this phone',
|
||||
|
||||
@@ -17,6 +17,7 @@ i18n
|
||||
compatibilityJSON: 'v3', // TODO: migrate json to v4 and afterwards remove it
|
||||
resources,
|
||||
fallbackLng: 'en',
|
||||
debug: true,
|
||||
|
||||
interpolation: {
|
||||
escapeValue: false, // not needed for react as it escapes by default
|
||||
|
||||
@@ -5,8 +5,4 @@ module.exports = {
|
||||
transformIgnorePatterns: [
|
||||
'node_modules/(?!((jest-)?react-native(-.*)?|@react-native(-community)?)/)',
|
||||
],
|
||||
watchPlugins: [
|
||||
'jest-watch-typeahead/filename',
|
||||
'jest-watch-typeahead/testname',
|
||||
],
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import getColumnNamesForCsv from './get-csv-column-names'
|
||||
import replaceWithNullIfAllPropertiesAreNull from './replace-with-null'
|
||||
import { LocalDate } from '@js-joda/core'
|
||||
import i18next from 'i18next'
|
||||
import labels from '../../i18n/en/settings'
|
||||
|
||||
export default async function importCsv(csv, deleteFirst) {
|
||||
const parseFuncs = {
|
||||
@@ -46,10 +46,7 @@ export default async function importCsv(csv, deleteFirst) {
|
||||
|
||||
const cycleDays = await csvParser(config)
|
||||
.fromString(csv)
|
||||
.on('header', (headers) => validateHeaders(headers))
|
||||
.on('error', (error) => {
|
||||
throw error
|
||||
})
|
||||
.on('header', validateHeaders)
|
||||
|
||||
//remove symptoms where all fields are null
|
||||
putNullForEmptySymptoms(cycleDays)
|
||||
@@ -70,11 +67,8 @@ function validateHeaders(headers) {
|
||||
return expectedHeaders.indexOf(header) > -1
|
||||
})
|
||||
) {
|
||||
throw new Error(
|
||||
i18next.t('hamburgerMenu.settings.data.import.error.incorrectColumns', {
|
||||
incorrectColumns: expectedHeaders.join(),
|
||||
})
|
||||
)
|
||||
const msg = `Expected CSV column titles to be ${expectedHeaders.join()}`
|
||||
throw new Error(msg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,9 +92,7 @@ function throwIfFutureData(cycleDays) {
|
||||
day.date > today &&
|
||||
Object.keys(day).some((symptom) => symptom != 'date' && symptom != 'note')
|
||||
) {
|
||||
throw new Error(
|
||||
i18next.t('hamburgerMenu.settings.data.import.error.futureEdit')
|
||||
)
|
||||
throw new Error(labels.import.errors.futureEdit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -1,16 +1,17 @@
|
||||
export default function getSensiplanMucus(feeling, texture) {
|
||||
export default function (feeling, texture) {
|
||||
|
||||
if (typeof feeling != 'number' || typeof texture != 'number') return null
|
||||
|
||||
const feelingMapping = {
|
||||
0: 0,
|
||||
1: 1,
|
||||
2: 2,
|
||||
3: 4,
|
||||
3: 4
|
||||
}
|
||||
const textureMapping = {
|
||||
0: 0,
|
||||
1: 3,
|
||||
2: 4,
|
||||
2: 4
|
||||
}
|
||||
const nfpFeelingValue = feelingMapping[feeling]
|
||||
const nfpTextureValue = textureMapping[texture]
|
||||
|
||||
@@ -11,16 +11,15 @@ import { getBleedingDaysSortedByDate } from '../db'
|
||||
import cycleModule from './cycle'
|
||||
import nothingChanged from '../db/db-unchanged'
|
||||
|
||||
export default function setupNotifications(navigate, setDate) {
|
||||
export default function setupNotifications(navigation) {
|
||||
Notification.configure({
|
||||
onNotification: (notification) => {
|
||||
const date = LocalDate.now().toString()
|
||||
// https://github.com/zo0r/react-native-push-notification/issues/966#issuecomment-479069106
|
||||
if (notification.data?.id === '1' || notification.id === '1') {
|
||||
const todayDate = LocalDate.now().toString()
|
||||
setDate(todayDate)
|
||||
navigate('TemperatureEditView')
|
||||
navigation.navigate('TemperatureEditView', { date })
|
||||
} else {
|
||||
navigate('Home')
|
||||
navigation.navigate('Home', { date })
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
+14
-8
@@ -35,21 +35,28 @@
|
||||
"@react-native-community/art": "^1.2.0",
|
||||
"@react-native-community/datetimepicker": "^6.3.1",
|
||||
"@react-native-community/push-notification-ios": "^1.8.0",
|
||||
"@react-navigation/bottom-tabs": "^6.4.0",
|
||||
"@react-navigation/native": "^6.0.13",
|
||||
"@react-navigation/native-stack": "^6.9.0",
|
||||
"@react-navigation/stack": "^6.3.1",
|
||||
"csvtojson": "^2.0.8",
|
||||
"i18next": "^22.4.13",
|
||||
"i18next": "^21.9.0",
|
||||
"jshashes": "^1.0.8",
|
||||
"moment": "^2.29.4",
|
||||
"object-path": "^0.11.4",
|
||||
"obv": "0.0.1",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "17.0.2",
|
||||
"react-i18next": "^12.0.0",
|
||||
"react-i18next": "^11.18.3",
|
||||
"react-native": "0.67.4",
|
||||
"react-native-calendars": "^1.1287.0",
|
||||
"react-native-document-picker": "^8.1.1",
|
||||
"react-native-fs": "^2.20.0",
|
||||
"react-native-gesture-handler": "^2.6.2",
|
||||
"react-native-modal-datetime-picker": "14.0.0",
|
||||
"react-native-push-notification": "3.2.1",
|
||||
"react-native-safe-area-context": "^4.3.4",
|
||||
"react-native-screens": "^3.17.0",
|
||||
"react-native-share": "^7.9.0",
|
||||
"react-native-simple-toast": "^1.1.3",
|
||||
"react-native-size-matters": "^0.4.0",
|
||||
@@ -58,18 +65,17 @@
|
||||
"sympto": "3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.2",
|
||||
"@babel/core": "^7.12.9",
|
||||
"@babel/eslint-parser": "^7.19.1",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-react": "^7.16.0",
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@testing-library/jest-native": "^4.0.12",
|
||||
"@testing-library/react-native": "^11.1.0",
|
||||
"basic-changelog": "gitlab:bloodyhealth/basic-changelog",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-react": "^7.31.10",
|
||||
"eslint": "7.14.0",
|
||||
"eslint-plugin-react": "^7.8.2",
|
||||
"husky": "^8.0.0",
|
||||
"jest": "^29.1.2",
|
||||
"jest-watch-typeahead": "^2.2.0",
|
||||
"jest": "^28.1.3",
|
||||
"jetifier": "^1.6.6",
|
||||
"metro-react-native-babel-preset": "^0.66.2",
|
||||
"prettier": "2.4.0",
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
import React from 'react'
|
||||
import { render, screen, fireEvent } from '@testing-library/react-native'
|
||||
import AcceptLicense from '../components/AcceptLicense'
|
||||
|
||||
import { saveLicenseFlag } from '../local-storage'
|
||||
import { render, screen, fireEvent } from './test-utils'
|
||||
|
||||
jest.mock('../local-storage', () => ({
|
||||
saveLicenseFlag: jest.fn(() => Promise.resolve()),
|
||||
}))
|
||||
|
||||
jest.mock('react-i18next', () => ({
|
||||
useTranslation: () => ({
|
||||
t: (str, options) => {
|
||||
return str + (options ? JSON.stringify(options) : '')
|
||||
},
|
||||
}),
|
||||
}))
|
||||
|
||||
describe('AcceptLicense', () => {
|
||||
test('should accept license when clicking ok button', async () => {
|
||||
test('On clicking OK button, the license is accepted', async () => {
|
||||
const mockedSetLicense = jest.fn()
|
||||
render(<AcceptLicense setLicense={mockedSetLicense} />)
|
||||
|
||||
const okButton = screen.getByText('OK')
|
||||
const okButton = screen.getByText('ok', { exact: false })
|
||||
|
||||
fireEvent(okButton, 'click')
|
||||
|
||||
@@ -21,9 +29,9 @@ describe('AcceptLicense', () => {
|
||||
expect(mockedSetLicense).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test('should render cancel button', async () => {
|
||||
test('There is a Cancel button', async () => {
|
||||
render(<AcceptLicense setLicense={jest.fn()} />)
|
||||
|
||||
screen.getByText('Cancel')
|
||||
screen.getByText('cancel', { exact: false })
|
||||
})
|
||||
})
|
||||
|
||||
+11
-3
@@ -1,16 +1,24 @@
|
||||
import React from 'react'
|
||||
import { render, screen } from '@testing-library/react-native'
|
||||
import License from '../components/settings/License'
|
||||
import { render, screen } from './test-utils'
|
||||
|
||||
jest.mock('react-i18next', () => ({
|
||||
useTranslation: () => ({
|
||||
t: (str, options) => {
|
||||
return str + (options ? JSON.stringify(options) : '')
|
||||
},
|
||||
}),
|
||||
}))
|
||||
|
||||
describe('License screen', () => {
|
||||
test('should display license text with correct year', async () => {
|
||||
test('It should have a correct year', async () => {
|
||||
render(<License />)
|
||||
const year = new Date().getFullYear().toString()
|
||||
|
||||
screen.getByText(year, { exact: false })
|
||||
})
|
||||
|
||||
test('should match the snapshot', async () => {
|
||||
test('It should match the snapshot', async () => {
|
||||
const licenseScreen = render(<License />)
|
||||
|
||||
expect(licenseScreen).toMatchSnapshot()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`License screen should match the snapshot 1`] = `
|
||||
exports[`License screen It should match the snapshot 1`] = `
|
||||
<View
|
||||
style={
|
||||
{
|
||||
Object {
|
||||
"backgroundColor": "#E9F2ED",
|
||||
"flex": 1,
|
||||
}
|
||||
@@ -11,8 +11,8 @@ exports[`License screen should match the snapshot 1`] = `
|
||||
>
|
||||
<RCTScrollView
|
||||
contentContainerStyle={
|
||||
[
|
||||
{
|
||||
Array [
|
||||
Object {
|
||||
"backgroundColor": "#E9F2ED",
|
||||
"flexGrow": 1,
|
||||
},
|
||||
@@ -23,13 +23,13 @@ exports[`License screen should match the snapshot 1`] = `
|
||||
<View>
|
||||
<Text
|
||||
style={
|
||||
[
|
||||
{
|
||||
Array [
|
||||
Object {
|
||||
"color": "#555",
|
||||
"fontFamily": "Jost-Book",
|
||||
"fontSize": 34.285714285714285,
|
||||
},
|
||||
{
|
||||
Object {
|
||||
"alignSelf": "center",
|
||||
"color": "#3A2671",
|
||||
"fontFamily": "Jost-Bold",
|
||||
@@ -41,11 +41,11 @@ exports[`License screen should match the snapshot 1`] = `
|
||||
]
|
||||
}
|
||||
>
|
||||
drip. an open-source cycle tracking app
|
||||
title
|
||||
</Text>
|
||||
<View
|
||||
style={
|
||||
{
|
||||
Object {
|
||||
"marginBottom": 34.285714285714285,
|
||||
"marginHorizontal": 34.285714285714285,
|
||||
}
|
||||
@@ -53,8 +53,8 @@ exports[`License screen should match the snapshot 1`] = `
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
[
|
||||
{
|
||||
Array [
|
||||
Object {
|
||||
"color": "#555",
|
||||
"fontFamily": "Jost-Book",
|
||||
"fontSize": 34.285714285714285,
|
||||
@@ -63,14 +63,12 @@ exports[`License screen should match the snapshot 1`] = `
|
||||
]
|
||||
}
|
||||
>
|
||||
Copyright (C) 2023 Heart of Code e.V.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
|
||||
text{"currentYear":2022}
|
||||
</Text>
|
||||
<Text
|
||||
onPress={[Function]}
|
||||
style={
|
||||
{
|
||||
Object {
|
||||
"color": "#3A2671",
|
||||
"fontFamily": "Jost-Book",
|
||||
"fontSize": 34.285714285714285,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
exports[`Footnote component when children are present, renders them 1`] = `
|
||||
<View
|
||||
style={
|
||||
{
|
||||
Object {
|
||||
"alignContent": "flex-start",
|
||||
"flexDirection": "row",
|
||||
"marginBottom": 8.571428571428571,
|
||||
@@ -13,13 +13,13 @@ exports[`Footnote component when children are present, renders them 1`] = `
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
[
|
||||
{
|
||||
Array [
|
||||
Object {
|
||||
"color": "#555",
|
||||
"fontFamily": "Jost-Book",
|
||||
"fontSize": 34.285714285714285,
|
||||
},
|
||||
{
|
||||
Object {
|
||||
"color": "#F38337",
|
||||
},
|
||||
]
|
||||
@@ -29,18 +29,18 @@ exports[`Footnote component when children are present, renders them 1`] = `
|
||||
</Text>
|
||||
<Text
|
||||
linkStyle={
|
||||
{
|
||||
Object {
|
||||
"color": "white",
|
||||
}
|
||||
}
|
||||
style={
|
||||
[
|
||||
{
|
||||
Array [
|
||||
Object {
|
||||
"color": "#555",
|
||||
"fontFamily": "Jost-Book",
|
||||
"fontSize": 34.285714285714285,
|
||||
},
|
||||
{
|
||||
Object {
|
||||
"color": "#555",
|
||||
"paddingLeft": 21.428571428571427,
|
||||
},
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { render } from '@testing-library/react-native'
|
||||
import '../i18n/i18n'
|
||||
|
||||
const customRender = (ui, options) => render(ui, { ...options })
|
||||
|
||||
// re-export everything
|
||||
export * from '@testing-library/react-native'
|
||||
|
||||
// override render method
|
||||
export { customRender as render }
|
||||
Reference in New Issue
Block a user