Compare commits

..

24 Commits

Author SHA1 Message Date
Lisa Hillebrand df6bc575d0 621 Use translation library for data export 2022-10-14 12:11:03 +02:00
Lisa Hillebrand d77cb17f1d 618 Rename function to start import 2022-10-14 12:08:29 +02:00
Lisa Hillebrand bcc8ebd7e2 618 Remove old file with import functions 2022-09-30 19:52:56 +02:00
Lisa Hillebrand a54dad9b1d 618 Remove unused constants 2022-09-30 19:52:56 +02:00
Lisa Hillebrand bb83785e56 618 Create dedicated component for importing data 2022-09-30 19:52:56 +02:00
Lisa Hillebrand 0a80b30388 618 Rename index.js to DataManagement.js 2022-09-30 12:44:41 +02:00
Sofiya Tepikin 9dfe8b4b05 Merge branch '614/Use-translation-library-for-settings-menu' into 'main'
614 Use translation library for settings menu

See merge request bloodyhealth/drip!529
2022-09-27 16:24:41 +00:00
Lisa b7d97f0589 614 Use translation library for settings menu 2022-09-27 16:24:40 +00:00
Maria Zadnepryanets fd611db750 Merge branch 'feature/add-stats-explainer-take2' into 'main'
Feature: add stats explainer take2

See merge request bloodyhealth/drip!546
2022-09-26 17:19:23 +00:00
Maria Zadnepryanets 7b9293f7a2 Feature: add stats explainer take2 2022-09-26 17:19:23 +00:00
Lisa db1388c3c4 Merge branch 'chore/retire-nodejs-mobile' into 'main'
Retire nodejs mobile

See merge request bloodyhealth/drip!541
2022-09-25 17:14:15 +00:00
Lisa 09d164b9fc Merge branch '613/Use-translation-library-for-symptom-boxes' into 'main'
613 Use translation library for symptom boxes

See merge request bloodyhealth/drip!527
2022-09-24 17:18:39 +00:00
Maria Zadnepryanets d78fbf74e3 Merge branch 'chore/add-translations-to-stats' into 'main'
Chore: add translations to stats

See merge request bloodyhealth/drip!545
2022-09-20 17:50:05 +00:00
Maria Zadnepryanets c9430439c5 Chore: add translations to stats 2022-09-20 17:50:05 +00:00
Maria Zadnepryanets 08712f460e Merge branch 'chore/add-footnote-component' into 'main'
Chore: add footnote component

See merge request bloodyhealth/drip!544
2022-09-20 16:43:21 +00:00
Maria Zadnepryanets 3447a0ea1e Chore: add footnote component 2022-09-20 16:43:20 +00:00
Sofiya Tepikin b4d92d0d7b Merge branch 'fix/chart-warning' into 'main'
Fix useEffect callback cannot be async

See merge request bloodyhealth/drip!540
2022-09-20 15:32:47 +00:00
Sofiya Tepikin d5f0e3532a Fix useEffect callback cannot be async 2022-09-20 15:32:47 +00:00
Sofiya Tepikin 9f9eadfc46 Cleanup 2022-09-19 15:56:54 +02:00
Sofiya Tepikin f5004f2d7a Use jshashes on Enter new password 2022-09-19 15:15:48 +02:00
Sofiya Tepikin afc177cb53 Use jshashes on Confirmation with password 2022-09-19 15:07:03 +02:00
Sofiya Tepikin 0ebadbc92a Use jshashes on Password prompt screen 2022-09-19 14:40:57 +02:00
Sofiya Tepikin 47b7021fa3 Add jshashes dependency 2022-09-19 14:40:25 +02:00
Lisa Hillebrand d6d333432c 613 Use translation library for symptom boxes 2022-09-16 19:14:03 +02:00
60 changed files with 778 additions and 2348 deletions
-5
View File
@@ -73,11 +73,6 @@ ios/Podfile.lock
android/app/src/main/res/drawable-*
android/app/src/main/assets/*
# nodejs-mobile creates these with every npm install
nodejs-assets/nodejs-project/sample-*
nodejs-assets/build-native-modules-MacOS-helper-script-node.sh
nodejs-assets/build-native-modules-MacOS-helper-script-npm.sh
# yarn
.yarn/*
yarn-error.log
-1
View File
@@ -11,7 +11,6 @@ updates:
- dependency-name: '*'
update-types: ['version-update:semver-patch']
- dependency-name: 'realm'
- dependency-name: 'nodejs-mobile-react-native'
- dependency-name: 'react'
- dependency-name: 'react-native'
- dependency-name: 'react-native-push-notifications'
+1 -1
View File
@@ -50,7 +50,7 @@ Install [Android Studio](https://developer.android.com/studio/) - you'll need it
### 3.2 More requirements from Android Studio
Open Android Studio and click on "Open an existing Android Studio project". Navigate to the drip repository you cloned and double click the android folder. It detects, downloads and cofigures requirements that might be missing, like the NDK and CMake to build the native code part of the project. Also see the [nodejs-mobile repository](https://github.com/janeasystems/nodejs-mobile) for the necessary prerequisites for your system.
Open Android Studio and click on "Open an existing Android Studio project". Navigate to the drip repository you cloned and double click the android folder. It detects, downloads and cofigures requirements that might be missing, like the NDK and CMake to build the native code part of the project.
### 3.3 Run the app on Android
+3 -28
View File
@@ -4,7 +4,9 @@ import PropTypes from 'prop-types'
import moment from 'moment'
import AppText from './common/app-text'
import Asterisk from './common/Asterisk'
import Button from './common/button'
import Footnote from './common/Footnote'
import cycleModule from '../lib/cycle'
import { getFertilityStatusForDay } from '../lib/sympto-adapter'
@@ -69,26 +71,12 @@ const Home = ({ navigate, setDate }) => {
<Button isCTA isSmall={false} onPress={navigateToCycleDayView}>
{t('labels.home.addDataForToday')}
</Button>
{phase && (
<View style={styles.asteriskLine}>
<Asterisk />
<AppText linkStyle={styles.whiteText} style={styles.greyText}>
{statusText}
</AppText>
</View>
)}
{phase && <Footnote colorLabel="greyLight">{statusText}</Footnote>}
</ScrollView>
)
}
const Asterisk = () => {
return <AppText style={styles.asterisk}>*</AppText>
}
const styles = StyleSheet.create({
asterisk: {
color: Colors.orange,
},
container: {
backgroundColor: Colors.purple,
flex: 1,
@@ -104,12 +92,6 @@ const styles = StyleSheet.create({
marginBottom: Spacing.tiny,
marginTop: Spacing.small,
},
asteriskLine: {
flexDirection: 'row',
alignContent: 'flex-start',
marginBottom: Spacing.tiny,
marginTop: Spacing.small,
},
title: {
color: Colors.purpleLight,
fontFamily: Fonts.bold,
@@ -124,13 +106,6 @@ const styles = StyleSheet.create({
color: 'white',
fontSize: Sizes.subtitle,
},
whiteText: {
color: 'white',
},
greyText: {
color: Colors.greyLight,
paddingLeft: Spacing.base,
},
})
Home.propTypes = {
-2
View File
@@ -1,5 +1,4 @@
import React, { useState, useEffect } from 'react'
import nodejs from 'nodejs-mobile-react-native'
import { getLicenseFlag, saveEncryptionFlag } from '../local-storage'
import { openDb } from '../db'
@@ -28,7 +27,6 @@ export default function AppWrapper() {
}
useEffect(() => {
nodejs.start('main.js')
checkIsLicenseAccepted()
checkIsDbEncrypted()
}, [])
+15 -3
View File
@@ -31,9 +31,21 @@ const getSymptomsFromCycleDays = (cycleDays) =>
const CycleChart = ({ navigate, setDate }) => {
const [shouldShowHint, setShouldShowHint] = useState(true)
useEffect(async () => {
const flag = await getChartFlag()
setShouldShowHint(flag === 'true')
useEffect(() => {
let isMounted = true
async function checkShouldShowHint() {
const flag = await getChartFlag()
if (isMounted) {
setShouldShowHint(flag === 'true')
}
}
checkShouldShowHint()
return () => {
isMounted = false
}
}, [])
const hideHint = () => {
-32
View File
@@ -1,32 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import { StyleSheet, View } from 'react-native'
import AppText from '../common/app-text'
import { Containers, Spacing, Typography } from '../../styles'
const AppHelp = ({ text }) => (
<View style={styles.container}>
<AppText style={styles.accentPurple}>*</AppText>
<AppText>{text}</AppText>
</View>
)
AppHelp.propTypes = {
text: PropTypes.string.isRequired,
}
const styles = StyleSheet.create({
accentPurple: {
...Typography.accentPurple,
alignSelf: 'flex-start',
paddingRight: Spacing.base,
},
container: {
...Containers.rowContainer,
padding: Spacing.base,
},
})
export default AppHelp
+16
View File
@@ -0,0 +1,16 @@
import React from 'react'
import { StyleSheet } from 'react-native'
import AppText from './app-text'
import { Colors } from '../../styles'
const Asterisk = () => <AppText style={styles.asterisk}>*</AppText>
const styles = StyleSheet.create({
asterisk: {
color: Colors.orange,
},
})
export default Asterisk
+50
View File
@@ -0,0 +1,50 @@
import React from 'react'
import PropTypes from 'prop-types'
import { StyleSheet, View } from 'react-native'
import AppText from '../common/app-text'
import Asterisk from '../common/Asterisk'
import { Colors, Spacing } from '../../styles'
const Footnote = ({ children, colorLabel }) => {
if (!children) return false
return (
<View style={styles.container}>
<Asterisk />
<AppText
linkStyle={styles.link}
style={{ ...styles.text, color: Colors[colorLabel] }}
>
{children}
</AppText>
</View>
)
}
Footnote.propTypes = {
children: PropTypes.node,
colorLabel: PropTypes.string,
}
Footnote.defaultProps = {
colorLabel: 'greyDark',
}
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
alignContent: 'flex-start',
marginBottom: Spacing.tiny,
marginTop: Spacing.base,
},
link: {
color: 'white',
},
text: {
paddingLeft: Spacing.small,
},
})
export default Footnote
+48 -13
View File
@@ -1,20 +1,33 @@
import React from 'react'
import { Modal, StyleSheet, TouchableOpacity } from 'react-native'
import {
Dimensions,
Modal,
StyleSheet,
TouchableOpacity,
View,
} from 'react-native'
import PropTypes from 'prop-types'
const AppModal = ({ children, onClose }) => {
return (
<Modal
animationType="fade"
onRequestClose={onClose}
transparent={true}
visible={true}
>
<TouchableOpacity onPress={onClose} style={styles.blackBackground} />
import CloseIcon from './close-icon'
import { Sizes, Spacing } from '../../styles'
const AppModal = ({ children, onClose }) => (
<Modal
animationType="fade"
onRequestClose={onClose}
transparent={true}
visible={true}
>
<TouchableOpacity onPress={onClose} style={styles.blackBackground} />
<View style={styles.modalWindow}>
<View style={styles.headerContainer}>
<CloseIcon onClose={onClose} />
</View>
{children}
</Modal>
)
}
</View>
</Modal>
)
AppModal.propTypes = {
children: PropTypes.node,
@@ -27,6 +40,28 @@ const styles = StyleSheet.create({
flex: 1,
opacity: 0.5,
},
headerContainer: {
flexDirection: 'row',
justifyContent: 'flex-end',
paddingTop: Spacing.base,
paddingHorizontal: Spacing.base,
position: 'absolute',
width: '100%',
zIndex: 3, // works on ios
elevation: 3, // works on android
},
modalWindow: {
alignSelf: 'center',
backgroundColor: 'white',
borderRadius: 10,
marginTop: Sizes.huge * 2,
paddingVertical: Spacing.large * 2,
position: 'absolute',
maxHeight: Dimensions.get('window').height * 0.7,
zIndex: 2, // works on ios
elevation: 2, // works on android
minWidth: '80%',
},
})
export default AppModal
+3 -4
View File
@@ -10,7 +10,7 @@ import SymptomEditView from './symptom-edit-view'
import { isDateInFuture } from '../helpers/cycle-day'
import { Colors, Sizes, Spacing } from '../../styles'
import { headerTitles as symptomTitles } from '../../i18n/en/labels'
import { useTranslation } from 'react-i18next'
const SymptomBox = ({
date,
@@ -20,6 +20,7 @@ const SymptomBox = ({
editedSymptom,
setEditedSymptom,
}) => {
const { t } = useTranslation(null, { keyPrefix: 'cycleDay.symptomBox' })
const isSymptomEdited = editedSymptom === symptom
const isSymptomDisabled = isDateInFuture(date) && symptom !== 'note'
const isExcluded = symptomData !== null ? symptomData.exclude : false
@@ -61,9 +62,7 @@ const SymptomBox = ({
size={Sizes.icon}
/>
<View style={styles.textContainer}>
<AppText style={symptomNameStyle}>
{symptomTitles[symptom].toLowerCase()}
</AppText>
<AppText style={symptomNameStyle}>{t(symptom)}</AppText>
{symptomDataToDisplay && (
<AppText style={textStyle} numberOfLines={4}>
{symptomDataToDisplay}
+87 -113
View File
@@ -1,13 +1,12 @@
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import { Dimensions, ScrollView, StyleSheet, View } from 'react-native'
import { ScrollView, StyleSheet, View } from 'react-native'
import AppModal from '../common/app-modal'
import AppSwitch from '../common/app-switch'
import AppText from '../common/app-text'
import AppTextInput from '../common/app-text-input'
import Button from '../common/button'
import CloseIcon from '../common/close-icon'
import Segment from '../common/segment'
import SelectBoxGroup from './select-box-group'
import SelectTabGroup from './select-tab-group'
@@ -119,99 +118,94 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
return (
<AppModal onClose={onSave}>
<View style={styles.modalWindow}>
<View style={styles.headerContainer}>
<CloseIcon onClose={onSave} />
</View>
<ScrollView
contentContainerStyle={styles.modalContainer}
keyboardDismissMode="on-drag"
>
{symptom === 'temperature' && (
<Temperature
date={date}
data={data}
save={(value, field) => onSaveTemperature(value, field)}
/>
)}
{shouldShow(symptomConfig.selectTabGroups) &&
symtomPage[symptom].selectTabGroups.map((group) => {
return (
<Segment key={group.key} style={styles.segmentBorder}>
<AppText style={styles.title}>{group.title}</AppText>
<SelectTabGroup
activeButton={data[group.key]}
buttons={group.options}
onSelect={(value) => onSelectTab(group, value)}
/>
</Segment>
)
})}
{shouldShow(symptomConfig.selectBoxGroups) &&
symtomPage[symptom].selectBoxGroups.map((group) => {
const isOtherSelected =
data['other'] !== null &&
data['other'] !== false &&
Object.keys(group.options).includes('other')
<ScrollView
contentContainerStyle={styles.modalContainer}
keyboardDismissMode="on-drag"
>
{symptom === 'temperature' && (
<Temperature
date={date}
data={data}
save={(value, field) => onSaveTemperature(value, field)}
/>
)}
{shouldShow(symptomConfig.selectTabGroups) &&
symtomPage[symptom].selectTabGroups.map((group) => {
return (
<Segment key={group.key} style={styles.segmentBorder}>
<AppText style={styles.title}>{group.title}</AppText>
<SelectTabGroup
activeButton={data[group.key]}
buttons={group.options}
onSelect={(value) => onSelectTab(group, value)}
/>
</Segment>
)
})}
{shouldShow(symptomConfig.selectBoxGroups) &&
symtomPage[symptom].selectBoxGroups.map((group) => {
const isOtherSelected =
data['other'] !== null &&
data['other'] !== false &&
Object.keys(group.options).includes('other')
return (
<Segment key={group.key} style={styles.segmentBorder}>
<AppText style={styles.title}>{group.title}</AppText>
<SelectBoxGroup
labels={group.options}
onSelect={(value) => onSelectBox(value)}
optionsState={data}
return (
<Segment key={group.key} style={styles.segmentBorder}>
<AppText style={styles.title}>{group.title}</AppText>
<SelectBoxGroup
labels={group.options}
onSelect={(value) => onSelectBox(value)}
optionsState={data}
/>
{isOtherSelected && (
<AppTextInput
{...inputProps}
placeholder={sharedLabels.enter}
value={data.note}
onChangeText={(value) => onSelectBoxNote(value)}
/>
{isOtherSelected && (
<AppTextInput
{...inputProps}
placeholder={sharedLabels.enter}
value={data.note}
onChangeText={(value) => onSelectBoxNote(value)}
/>
)}
</Segment>
)
})}
{shouldShow(symptomConfig.excludeText) && (
<Segment style={styles.segmentBorder}>
<AppSwitch
onToggle={onExcludeToggle}
text={symtomPage[symptom].excludeText}
value={data.exclude}
/>
</Segment>
)}
{shouldShow(symptomConfig.note) && (
<Segment style={styles.segmentBorder}>
<AppText>{symtomPage[symptom].note}</AppText>
<AppTextInput
{...inputProps}
onChangeText={onEditNote}
placeholder={sharedLabels.enter}
testID="noteInput"
value={noteText !== null ? noteText : ''}
/>
</Segment>
)}
<View style={styles.buttonsContainer}>
<Button iconName={iconName} isSmall onPress={onPressLearnMore}>
{sharedLabels.learnMore}
</Button>
<Button isSmall onPress={onRemove}>
{sharedLabels.remove}
</Button>
<Button isCTA isSmall onPress={onSave}>
{sharedLabels.save}
</Button>
</View>
{shouldShowInfo && (
<Segment last style={styles.segmentBorder}>
<AppText>{info[symptom].text}</AppText>
</Segment>
)}
</ScrollView>
</View>
)}
</Segment>
)
})}
{shouldShow(symptomConfig.excludeText) && (
<Segment style={styles.segmentBorder}>
<AppSwitch
onToggle={onExcludeToggle}
text={symtomPage[symptom].excludeText}
value={data.exclude}
/>
</Segment>
)}
{shouldShow(symptomConfig.note) && (
<Segment style={styles.segmentBorder}>
<AppText>{symtomPage[symptom].note}</AppText>
<AppTextInput
{...inputProps}
onChangeText={onEditNote}
placeholder={sharedLabels.enter}
testID="noteInput"
value={noteText !== null ? noteText : ''}
/>
</Segment>
)}
<View style={styles.buttonsContainer}>
<Button iconName={iconName} isSmall onPress={onPressLearnMore}>
{sharedLabels.learnMore}
</Button>
<Button isSmall onPress={onRemove}>
{sharedLabels.remove}
</Button>
<Button isCTA isSmall onPress={onSave}>
{sharedLabels.save}
</Button>
</View>
{shouldShowInfo && (
<Segment last style={styles.segmentBorder}>
<AppText>{info[symptom].text}</AppText>
</Segment>
)}
</ScrollView>
</AppModal>
)
}
@@ -229,32 +223,12 @@ const styles = StyleSheet.create({
paddingHorizontal: Spacing.base,
paddingBottom: Spacing.base,
},
headerContainer: {
flexDirection: 'row',
justifyContent: 'flex-end',
paddingTop: Spacing.base,
paddingHorizontal: Spacing.base,
position: 'absolute',
width: '100%',
zIndex: 3, // works on ios
elevation: 3, // works on android
},
input: {
height: Sizes.base * 5,
},
modalContainer: {
paddingHorizontal: Spacing.base,
},
modalWindow: {
alignSelf: 'center',
backgroundColor: 'white',
borderRadius: 10,
marginTop: Sizes.huge * 2,
paddingTop: Spacing.large * 2,
position: 'absolute',
minHeight: '40%',
maxHeight: Dimensions.get('window').height * 0.7,
},
segmentBorder: {
borderBottomColor: Colors.greyLight,
},
+24 -21
View File
@@ -7,28 +7,28 @@ import {
View,
} from 'react-native'
import PropTypes from 'prop-types'
import AppText from '../common/app-text'
import AppIcon from '../common/app-icon'
import CloseIcon from '../common/close-icon'
import MenuItem from './menu-item'
import { Colors, Sizes } from '../../styles'
import settingsLabels from '../../i18n/en/settings'
import { Colors, Sizes, Typography } from '../../styles'
import { HIT_SLOP } from '../../config'
const { menuItems } = settingsLabels
import { useTranslation } from 'react-i18next'
const settingsMenuItems = [
{ name: menuItems.settings, component: 'SettingsMenu' },
{ name: menuItems.about, component: 'About' },
{ name: menuItems.license, component: 'License' },
{ name: menuItems.privacyPolicy, component: 'PrivacyPolicy' },
{ labelKey: 'settings', componentName: 'SettingsMenu' },
{ labelKey: 'about', componentName: 'About' },
{ labelKey: 'license', componentName: 'License' },
{ labelKey: 'privacyPolicy', componentName: 'PrivacyPolicy' },
]
const HamburgerMenu = ({ navigate }) => {
const [isOpen, setIsOpen] = useState(false)
const closeMenu = () => setIsOpen(false)
const { t } = useTranslation(null, { keyPrefix: 'hamburgerMenu.menuMain' })
if (!isOpen)
return (
<TouchableOpacity onPress={() => setIsOpen(true)} hitSlop={HIT_SLOP}>
@@ -36,23 +36,25 @@ const HamburgerMenu = ({ navigate }) => {
</TouchableOpacity>
)
function onPress(componentName) {
closeMenu()
navigate(componentName)
}
return (
<Modal animationType="fade" onRequestClose={closeMenu} transparent={true}>
<TouchableOpacity
onPress={closeMenu}
style={styles.blackBackground}
></TouchableOpacity>
<Modal animationType="fade" onRequestClose={closeMenu} transparent>
<TouchableOpacity onPress={closeMenu} style={styles.blackBackground} />
<View style={styles.menu}>
<View style={styles.iconContainer}>
<CloseIcon color={'black'} onClose={closeMenu} />
</View>
{settingsMenuItems.map((item) => (
<MenuItem
item={item}
key={item.name}
closeMenu={closeMenu}
navigate={navigate}
/>
{settingsMenuItems.map(({ labelKey, componentName }) => (
<TouchableOpacity
onPress={() => onPress(componentName)}
key={labelKey}
>
<AppText style={styles.menuItem}>{t(labelKey)}</AppText>
</TouchableOpacity>
))}
</View>
</Modal>
@@ -84,4 +86,5 @@ const styles = StyleSheet.create({
position: 'absolute',
width: '60%',
},
menuItem: Typography.subtitle,
})
-35
View File
@@ -1,35 +0,0 @@
import React from 'react'
import { StyleSheet, TouchableOpacity } from 'react-native'
import PropTypes from 'prop-types'
import AppText from '../common/app-text'
import { Typography } from '../../styles'
const MenuItem = ({ item, navigate, closeMenu }) => {
const { component, name } = item
const onPress = () => {
closeMenu()
navigate(component)
}
return (
<TouchableOpacity onPress={onPress}>
<AppText style={styles.text}>{name}</AppText>
</TouchableOpacity>
)
}
MenuItem.propTypes = {
item: PropTypes.object.isRequired,
navigate: PropTypes.func.isRequired,
closeMenu: PropTypes.func.isRequired,
}
const styles = StyleSheet.create({
text: {
...Typography.subtitle,
},
})
export default MenuItem
+6 -12
View File
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react'
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import { Alert, KeyboardAvoidingView, StyleSheet, View } from 'react-native'
import nodejs from 'nodejs-mobile-react-native'
import { SHA512 } from 'jshashes'
import AppPage from './common/app-page'
import AppTextInput from './common/app-text-input'
@@ -9,7 +9,7 @@ import Button from './common/button'
import Header from './header'
import { saveEncryptionFlag } from '../local-storage'
import { requestHash, deleteDbAndOpenNew, openDb } from '../db'
import { deleteDbAndOpenNew, openDb } from '../db'
import { passwordPrompt as labels, shared } from '../i18n/en/labels'
import { Containers, Spacing } from '../styles'
@@ -17,9 +17,10 @@ const cancelButton = { text: shared.cancel, style: 'cancel' }
const PasswordPrompt = ({ enableShowApp }) => {
const [password, setPassword] = useState(null)
const unlockApp = () => requestHash('check-pw', password)
const isPasswordEntered = Boolean(password)
const passHashToDb = async (hash) => {
const unlockApp = async () => {
const hash = new SHA512().hex(password)
const connected = await openDb(hash)
if (!connected) {
@@ -31,16 +32,9 @@ const PasswordPrompt = ({ enableShowApp }) => {
])
return
}
enableShowApp()
}
useEffect(() => {
const listener = nodejs.channel.addListener('check-pw', passHashToDb, this)
return () => listener.remove()
}, [])
const onDeleteDataConfirmation = async () => {
await deleteDbAndOpenNew()
await saveEncryptionFlag(false)
+1 -1
View File
@@ -12,7 +12,7 @@ import links from '../../i18n/en/links'
import { useTranslation } from 'react-i18next'
const AboutSection = () => {
const { t } = useTranslation(null, { keyPrefix: 'settings.about' })
const { t } = useTranslation(null, { keyPrefix: 'hamburgerMenu.about' })
return (
<AppPage title={t('title')}>
+1 -1
View File
@@ -8,7 +8,7 @@ import AppLink from '../common/AppLink'
import Segment from '../common/segment'
const License = ({ children }) => {
const { t } = useTranslation(null, { keyPrefix: 'settings.license' })
const { t } = useTranslation(null, { keyPrefix: 'hamburgerMenu.license' })
const currentYear = new Date().getFullYear()
const link = 'https://www.gnu.org/licenses/gpl-3.0.html'
return (
@@ -1,12 +1,12 @@
import React, { useState, useEffect } from 'react'
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import { Alert, KeyboardAvoidingView, StyleSheet, View } from 'react-native'
import nodejs from 'nodejs-mobile-react-native'
import { SHA512 } from 'jshashes'
import AppTextInput from '../../common/app-text-input'
import Button from '../../common/button'
import { requestHash, openDb } from '../../../db'
import { openDb } from '../../../db'
import { Containers } from '../../../styles'
import settings from '../../../i18n/en/settings'
import { shared } from '../../../i18n/en/labels'
@@ -14,7 +14,8 @@ import { shared } from '../../../i18n/en/labels'
const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
const [password, setPassword] = useState(null)
const checkPassword = async (hash) => {
const checkPassword = async () => {
const hash = new SHA512().hex(password)
try {
await openDb(hash)
onSuccess()
@@ -23,15 +24,6 @@ const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
}
}
useEffect(() => {
const listener = nodejs.channel.addListener(
'password-check',
checkPassword,
this
)
return () => listener.remove()
}, [])
const onIncorrectPassword = () => {
Alert.alert(shared.incorrectPassword, shared.incorrectPasswordMessage, [
{
@@ -45,10 +37,6 @@ const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
])
}
const initPasswordCheck = () => {
requestHash('password-check', password)
}
const labels = settings.passwordSettings
const isPassword = password !== null
@@ -65,7 +53,7 @@ const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
<Button
disabled={!isPassword}
isCTA={isPassword}
onPress={initPasswordCheck}
onPress={checkPassword}
>
{shared.confirmToProceed}
</Button>
@@ -0,0 +1,41 @@
import React, { useState } from 'react'
import AppLoadingView from '../../common/app-loading'
import AppPage from '../../common/app-page'
import AppText from '../../common/app-text'
import Segment from '../../common/segment'
import DeleteData from './delete-data'
import labels from '../../../i18n/en/settings'
import ImportData from './ImportData'
import ExportData from './ExportData'
const DataManagement = () => {
const [isLoading, setIsLoading] = useState(false)
const [isDeletingData, setIsDeletingData] = useState(false)
if (isLoading) return <AppLoadingView />
return (
<AppPage>
<ExportData
resetIsDeletingData={() => setIsDeletingData(false)}
setIsLoading={setIsLoading}
/>
<ImportData
resetIsDeletingData={() => setIsDeletingData(false)}
setIsLoading={setIsLoading}
/>
<Segment title={labels.deleteSegment.title} last>
<AppText>{labels.deleteSegment.explainer}</AppText>
<DeleteData
isDeletingData={isDeletingData}
onStartDeletion={() => setIsDeletingData(true)}
/>
</Segment>
</AppPage>
)
}
export default DataManagement
@@ -0,0 +1,77 @@
import React from 'react'
import PropTypes from 'prop-types'
import { getCycleDaysSortedByDate, mapRealmObjToJsObj } from '../../../db'
import getDataAsCsvDataUri from '../../../lib/import-export/export-to-csv'
import alertError from '../common/alert-error'
import { EXPORT_FILE_NAME } from './constants'
import RNFS from 'react-native-fs'
import { useTranslation } from 'react-i18next'
import AppText from '../../common/app-text'
import Button from '../../common/button'
import Segment from '../../common/segment'
import Share from 'react-native-share'
export default function ExportData({ setIsLoading, resetIsDeletingData }) {
const { t } = useTranslation(null, {
keyPrefix: 'hamburgerMenu.settings.data.export',
})
async function startExport() {
resetIsDeletingData()
setIsLoading(true)
await exportData()
setIsLoading(false)
}
async function getData() {
const cycleDaysByDate = mapRealmObjToJsObj(getCycleDaysSortedByDate())
try {
return cycleDaysByDate.length
? getDataAsCsvDataUri(cycleDaysByDate)
: null
} catch (err) {
alertError(t('error.convert'))
return null
}
}
async function exportData() {
const data = await getData()
if (!data) {
alertError(t('error.data'))
return
}
try {
const path = `${RNFS.DocumentDirectoryPath}/${EXPORT_FILE_NAME}`
await RNFS.writeFile(path, data)
await Share.open({
title: t('title'),
url: `file://${path}`,
subject: t('title'),
type: 'text/csv',
showAppsToView: true,
failOnCancel: false,
})
} catch (err) {
return alertError(t('error.share'))
}
}
return (
<Segment title={t('button')}>
<AppText>{t('text')}</AppText>
<Button isCTA onPress={startExport}>
{t('button')}
</Button>
</Segment>
)
}
ExportData.propTypes = {
resetIsDeletingData: PropTypes.func.isRequired,
setIsLoading: PropTypes.func.isRequired,
}
@@ -0,0 +1,97 @@
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('errors.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('errors.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,
}
@@ -1,43 +0,0 @@
import Share from 'react-native-share'
import { getCycleDaysSortedByDate, mapRealmObjToJsObj } from '../../../db'
import getDataAsCsvDataUri from '../../../lib/import-export/export-to-csv'
import alertError from '../common/alert-error'
import settings from '../../../i18n/en/settings'
import { EXPORT_FILE_NAME } from './constants'
import RNFS from 'react-native-fs'
export default async function exportData() {
let data
const labels = settings.export
const cycleDaysByDate = mapRealmObjToJsObj(getCycleDaysSortedByDate())
if (!cycleDaysByDate.length) return alertError(labels.errors.noData)
try {
data = getDataAsCsvDataUri(cycleDaysByDate)
if (!data) {
return alertError(labels.errors.noData)
}
} catch (err) {
console.error(err)
return alertError(labels.errors.couldNotConvert)
}
try {
const path = `${RNFS.DocumentDirectoryPath}/${EXPORT_FILE_NAME}`
await RNFS.writeFile(path, data)
await Share.open({
title: labels.title,
url: `file://${path}`,
subject: labels.subject,
type: 'text/csv',
showAppsToView: true,
failOnCancel: false,
})
} catch (err) {
console.error(err)
return alertError(labels.errors.problemSharing)
}
}
@@ -1,64 +0,0 @@
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)
}
@@ -1,68 +0,0 @@
import React, { useState } from 'react'
import AppLoadingView from '../../common/app-loading'
import AppPage from '../../common/app-page'
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 { ACTION_DELETE, ACTION_EXPORT, ACTION_IMPORT } from '../../../config'
const DataManagement = () => {
const [isLoading, setIsLoading] = 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 = () => {
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}>
<AppText>{labels.export.segmentExplainer}</AppText>
<Button isCTA onPress={startExport}>
{labels.export.button}
</Button>
</Segment>
<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={() => setCurrentAction(ACTION_DELETE)}
/>
</Segment>
</AppPage>
)
}
export default DataManagement
+1 -1
View File
@@ -1,6 +1,6 @@
import Reminders from './reminders/reminders'
import NfpSettings from './nfp-settings'
import DataManagement from './data-management'
import DataManagement from './data-management/DataManagement'
import Password from './password'
import About from './About'
import License from './License'
+8 -4
View File
@@ -7,18 +7,22 @@ import AppText from '../common/app-text'
import Segment from '../common/segment'
import { Colors, Containers, Sizes } from '../../styles'
import { useTranslation } from 'react-i18next'
const MenuItem = ({ item, last, navigate }) => {
const { t } = useTranslation(null, {
keyPrefix: 'hamburgerMenu.settings.menuItem',
})
return (
<Segment last={last}>
<TouchableOpacity
style={styles.container}
key={item.name}
onPress={() => navigate(item.component)}
key={item.label}
onPress={() => navigate(item.componentName)}
>
<View>
<AppText style={styles.title}>{item.name}</AppText>
{item.text.length > 0 && <AppText>{item.text}</AppText>}
<AppText style={styles.title}>{t(`${item.label}.name`)}</AppText>
{!!item.label && <AppText>{t(`${item.label}.text`)}</AppText>}
</View>
<AppIcon name="chevron-right" color={Colors.orange} />
</TouchableOpacity>
@@ -1,35 +1,24 @@
import React, { useState, useEffect } from 'react'
import React, { useState } from 'react'
import { KeyboardAvoidingView, StyleSheet } from 'react-native'
import nodejs from 'nodejs-mobile-react-native'
import PropTypes from 'prop-types'
import { SHA512 } from 'jshashes'
import AppText from '../../common/app-text'
import AppTextInput from '../../common/app-text-input'
import Button from '../../common/button'
import { requestHash } from '../../../db'
import { Colors, Spacing } from '../../../styles'
import settings from '../../../i18n/en/settings'
const LISTENER_TYPE = 'create-or-change-pw'
const EnterNewPassword = ({ changeEncryptionAndRestart }) => {
const [password, setPassword] = useState('')
const [passwordConfirmation, setPasswordConfirmation] = useState('')
const [shouldShowErrorMessage, setShouldShowErrorMessage] = useState(false)
useEffect(() => {
const listener = nodejs.channel.addListener(
LISTENER_TYPE,
changeEncryptionAndRestart,
this
)
return () => listener.remove()
}, [])
const savePassword = () => {
if (comparePasswords()) {
requestHash(LISTENER_TYPE, password)
const hash = new SHA512().hex(password)
changeEncryptionAndRestart(hash)
} else {
setShouldShowErrorMessage(true)
}
+3 -1
View File
@@ -9,7 +9,9 @@ import Segment from '../common/segment'
import { Colors, Sizes } from '../../styles'
const PrivacyPolicy = () => {
const { t } = useTranslation(null, { keyPrefix: 'settings.privacyPolicy' })
const { t } = useTranslation(null, {
keyPrefix: 'hamburgerMenu.privacyPolicy',
})
const sections = ['intro', 'dataUse', 'permissions', 'transparency']
return (
+10 -10
View File
@@ -4,21 +4,21 @@ import PropTypes from 'prop-types'
import AppPage from '../common/app-page'
import MenuItem from './menu-item'
import settingsLabels from '../../i18n/en/settings'
import { useTranslation } from 'react-i18next'
const { menuItems } = settingsLabels
const menu = [
{ ...menuItems.reminders, component: 'Reminders' },
{ ...menuItems.nfpSettings, component: 'NfpSettings' },
{ ...menuItems.dataManagement, component: 'DataManagement' },
{ ...menuItems.password, component: 'Password' },
const menuItems = [
{ label: 'reminders', componentName: 'Reminders' },
{ label: 'nfpSettings', componentName: 'NfpSettings' },
{ label: 'dataManagement', componentName: 'DataManagement' },
{ label: 'password', componentName: 'Password' },
]
const SettingsMenu = ({ navigate }) => {
const { t } = useTranslation()
return (
<AppPage title={settingsLabels.title}>
{menu.map((menuItem, i) => {
const last = menu.length === i + 1
<AppPage title={t('hamburgerMenu.settings.title')}>
{menuItems.map((menuItem, i) => {
const last = menuItems.length === i + 1
return (
<MenuItem item={menuItem} key={i} last={last} navigate={navigate} />
@@ -1,13 +1,13 @@
import React from 'react'
import { Dimensions, FlatList, StyleSheet, View } from 'react-native'
import { FlatList, StyleSheet, View } from 'react-native'
import PropTypes from 'prop-types'
import { useTranslation } from 'react-i18next'
import AppText from './app-text'
import CloseIcon from './close-icon'
import AppModal from '../common/app-modal'
import AppText from '../common/app-text'
import cycleModule from '../../lib/cycle'
import { Sizes, Spacing, Typography, Colors } from '../../styles'
import { Spacing, Typography, Colors } from '../../styles'
import { humanizeDate } from '../helpers/format-date'
const Item = ({ data }) => {
@@ -36,67 +36,51 @@ Item.propTypes = {
data: PropTypes.object.isRequired,
}
const StatsTable = ({ onClose }) => {
const PeriodDetailsModal = ({ onClose }) => {
const renderItem = ({ item }) => <Item data={item} />
const data = cycleModule().getStats()
if (!data || data.length === 0) return false
return (
<View style={styles.modalContainer}>
<View style={styles.headerContainer}>
<CloseIcon onClose={onClose} />
<AppModal onClose={onClose}>
<View>
<FlatList
data={data}
renderItem={renderItem}
keyExtractor={(item) => item.date}
ItemSeparatorComponent={ItemDivider}
ListHeaderComponent={FlatListHeader}
ListHeaderComponentStyle={styles.headerDivider}
stickyHeaderIndices={[0]}
contentContainerStyle={styles.container}
/>
</View>
<FlatList
data={data}
renderItem={renderItem}
keyExtractor={(item) => item.date}
ItemSeparatorComponent={ItemDivider}
ListHeaderComponent={FlatListHeader}
ListHeaderComponentStyle={styles.headerDivider}
stickyHeaderIndices={[0]}
contentContainerStyle={styles.container}
/>
</View>
</AppModal>
)
}
StatsTable.propTypes = {
PeriodDetailsModal.propTypes = {
onClose: PropTypes.func,
}
const ItemDivider = () => <View style={styles.divider} />
const FlatListHeader = () => {
const { t } = useTranslation(null, { keyPrefix: 'stats' })
return (
<View style={styles.row}>
<View style={styles.accentCell}>
<AppText style={styles.header}>{t('cycle_start')}</AppText>
</View>
<View style={styles.cell}>
<AppText style={styles.header}>{t('cycle_length')}</AppText>
</View>
<View style={styles.cell}>
<AppText style={styles.header}>{t('bleeding')}</AppText>
</View>
const FlatListHeader = () => (
<View style={styles.row}>
<View style={styles.accentCell}>
<AppText style={styles.header}>{'Cycle Start'}</AppText>
</View>
)
}
<View style={styles.cell}>
<AppText style={styles.header}>{'Cycle Length'}</AppText>
</View>
<View style={styles.cell}>
<AppText style={styles.header}>{'Bleeding'}</AppText>
</View>
</View>
)
const styles = StyleSheet.create({
accentCell: {
flex: 3,
justifyContent: 'center',
},
cell: {
flex: 2,
justifyContent: 'center',
},
container: {
paddingHorizontal: Spacing.base,
},
divider: {
height: 1,
width: '100%',
@@ -106,31 +90,29 @@ const styles = StyleSheet.create({
...Typography.accentOrange,
paddingVertical: Spacing.small,
},
headerContainer: {
flexDirection: 'row',
justifyContent: 'flex-end',
paddingTop: Spacing.base,
paddingRight: Spacing.base,
},
headerDivider: {
borderBottomColor: Colors.purple,
borderBottomWidth: 2,
},
modalContainer: {
alignSelf: 'center',
backgroundColor: Colors.turquoiseLight,
marginTop: Sizes.huge * 2,
maxHeight: Dimensions.get('window').height * 0.7,
minHeight: '40%',
position: 'absolute',
width: '100%',
},
row: {
flexDirection: 'row',
justifyContent: 'space-between',
paddingVertical: Spacing.tiny,
backgroundColor: Colors.turquoiseLight,
backgroundColor: 'white',
},
cell: {
flex: 2,
justifyContent: 'center',
},
accentCell: {
flex: 3,
justifyContent: 'center',
},
container: {
minHeight: '40%',
minWidth: '95%',
paddingHorizontal: Spacing.base,
},
})
export default StatsTable
export default PeriodDetailsModal
@@ -2,7 +2,7 @@ import React from 'react'
import { StyleSheet, View } from 'react-native'
import PropTypes from 'prop-types'
import AppText from './app-text'
import AppText from '../common/app-text'
import { Sizes, Spacing, Typography } from '../../styles'
@@ -15,12 +15,12 @@ StatsOverview.propTypes = {
}
const Row = ({ rowContent }) => {
const showHelp = rowContent[1].includes('deviation') ? true : false
const isStandardDeviation = rowContent[1].includes('deviation')
return (
<View style={styles.row}>
<Cell content={rowContent[0]} isLeft />
<Cell content={rowContent[1]} showHelp={showHelp} />
<Cell content={rowContent[1]} hasAsterisk={isStandardDeviation} />
</View>
)
}
@@ -29,7 +29,7 @@ Row.propTypes = {
rowContent: PropTypes.array.isRequired,
}
const Cell = ({ content, isLeft, showHelp }) => {
const Cell = ({ content, isLeft, hasAsterisk }) => {
const styleContainer = isLeft ? styles.cellLeft : styles.cellRight
const styleText = isLeft ? styles.accentPurpleBig : styles.accentOrange
const numberOfLines = isLeft ? 1 : 2
@@ -43,8 +43,8 @@ const Cell = ({ content, isLeft, showHelp }) => {
style={styleText}
>
{content}
{hasAsterisk && <AppText style={styles.accentOrange}>*</AppText>}
</AppText>
{showHelp && <AppText style={styles.accentPurpleBig}>*</AppText>}
</View>
)
}
@@ -52,7 +52,7 @@ const Cell = ({ content, isLeft, showHelp }) => {
Cell.propTypes = {
content: PropTypes.node.isRequired,
isLeft: PropTypes.bool,
showHelp: PropTypes.bool,
hasAsterisk: PropTypes.bool,
}
const styles = StyleSheet.create({
@@ -70,10 +70,7 @@ const styles = StyleSheet.create({
flex: 3,
justifyContent: 'center',
},
cellRight: {
flex: 5,
flexDirection: 'row',
},
cellRight: { flex: 5 },
row: { flexDirection: 'row' },
})
@@ -3,19 +3,18 @@ import { ImageBackground, SafeAreaView, ScrollView, View } from 'react-native'
import { ScaledSheet } from 'react-native-size-matters'
import { useTranslation } from 'react-i18next'
import Button from './common/button'
import AppHelp from './common/AppHelp'
import AppModal from './common/app-modal'
import AppText from './common/app-text'
import StatsOverview from './common/StatsOverview'
import StatsTable from './common/StatsTable'
import AppText from '../common/app-text'
import Button from '../common/button'
import Footnote from '../common/Footnote'
import StatsOverview from './StatsOverview'
import PeriodDetailsModal from './PeriodDetailsModal'
import cycleModule from '../lib/cycle'
import { getCycleLengthStats as getCycleInfo } from '../lib/cycle-length'
import cycleModule from '../../lib/cycle'
import { getCycleLengthStats as getCycleInfo } from '../../lib/cycle-length'
import { Containers, Sizes, Spacing, Typography } from '../styles'
import { Containers, Sizes, Spacing, Typography } from '../../styles'
const image = require('../assets/cycle-icon.png')
const image = require('../../assets/cycle-icon.png')
const Stats = () => {
const [isStatsVisible, setIsStatsVisible] = useState(false)
@@ -23,27 +22,28 @@ const Stats = () => {
const { t } = useTranslation(null, { keyPrefix: 'stats' })
const cycleLengths = cycleModule().getAllCycleLengths()
const numberOfCycles = cycleLengths?.length
const hasAtLeastOneCycle = numberOfCycles >= 1
const cycleData = hasAtLeastOneCycle
? getCycleInfo(cycleLengths)
: { minimum: '—', maximum: '—', stdDeviation: '—' }
const numberOfCycles = cycleLengths.length
const cycleData =
numberOfCycles > 0
? getCycleInfo(cycleLengths)
: { minimum: '—', maximum: '—', stdDeviation: '—' }
const standardDeviation = cycleData.stdDeviation
? cycleData.stdDeviation
: '—'
const statsData = [
[cycleData.minimum, t('min')],
[cycleData.maximum, t('max')],
[
cycleData.stdDeviation ? cycleData.stdDeviation : '—',
t('standard_deviation'),
],
[numberOfCycles, t('completed_cycles')],
[cycleData.minimum, t('overview.min')],
[cycleData.maximum, t('overview.max')],
[standardDeviation, t('overview.standardDeviation')],
[numberOfCycles, t('overview.completedCycles')],
]
return (
<SafeAreaView style={styles.pageContainer}>
<ScrollView contentContainerStyle={styles.overviewContainer}>
<AppText>{t('cycle_length_explainer')}</AppText>
{!hasAtLeastOneCycle && <AppText>{t('no_data')}</AppText>}
{hasAtLeastOneCycle && (
<AppText>{t('intro')}</AppText>
{numberOfCycles === 0 ? (
<AppText>{t('noData')}</AppText>
) : (
<>
<View style={styles.container}>
<View style={styles.columnLeft}>
@@ -59,30 +59,28 @@ const Stats = () => {
>
{cycleData.mean}
</AppText>
<AppText style={styles.accentPurpleHuge}>{t('days')}</AppText>
<AppText style={styles.accentPurpleHuge}>
{t('overview.days')}
</AppText>
</ImageBackground>
<AppText style={styles.accentOrange}>{t('average')}</AppText>
<AppText style={styles.accentOrange}>
{t('overview.average')}
</AppText>
</View>
<View style={styles.columnRight}>
<StatsOverview data={statsData} />
</View>
</View>
<Button isCTA onPress={() => setIsStatsVisible(true)}>
{t('show_stats')}
{t('showStats')}
</Button>
<AppHelp text={t('standard_deviation_help')} />
{isStatsVisible && (
<PeriodDetailsModal onClose={() => setIsStatsVisible(false)} />
)}
<Footnote>{t('footnote')}</Footnote>
</>
)}
</ScrollView>
{isStatsVisible && (
<AppModal onClose={() => setIsStatsVisible(false)}>
<StatsTable
onClose={() => setIsStatsVisible(false)}
testID="statsTable"
/>
</AppModal>
)}
</SafeAreaView>
)
}
+1 -5
View File
@@ -1,10 +1,6 @@
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',
@@ -40,7 +36,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
-11
View File
@@ -1,6 +1,5 @@
import Realm from 'realm'
import { LocalDate, ChronoUnit } from '@js-joda/core'
import nodejs from 'nodejs-mobile-react-native'
import fs from 'react-native-fs'
import schemas from './schemas'
@@ -184,16 +183,6 @@ export function tryToImportWithoutDelete(cycleDays) {
})
}
export function requestHash(type, pw) {
nodejs.channel.post(
'request-SHA512',
JSON.stringify({
type: type,
message: pw,
})
)
}
export async function changeDbEncryption(hash) {
let key
if (hash) key = hashToInt8Array(hash)
+92 -16
View File
@@ -1,4 +1,17 @@
{
"cycleDay": {
"symptomBox": {
"bleeding": "Bleeding",
"temperature": "Temperature",
"mucus": "Cervical Mucus",
"cervix": "Cervix",
"note": "Note",
"desire": "Desire",
"sex": "Sex",
"pain": "Pain",
"mood": "Mood"
}
},
"labels": {
"bleedingPrediction": {
"noPrediction": "As soon as you have tracked 3 menstrual cycles, drip. will make predictions for the next ones."
@@ -13,7 +26,7 @@
"ok": "OK"
}
},
"settings": {
"hamburgerMenu": {
"about": {
"credits": {
"title": "Credits",
@@ -41,6 +54,12 @@
"title": "drip. an open-source cycle tracking app",
"text": "Copyright (C) {{currentYear}} Heart of Code e.V.\n\nThis 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:"
},
"menuMain": {
"about": "About",
"license": "License",
"settings": "Settings",
"privacyPolicy": "Privacy Policy"
},
"privacyPolicy": {
"title": "Privacy Policy",
"intro": {
@@ -59,25 +78,82 @@
"title": "Transparency",
"text": "You can read through the source code of drip. to ensure the given information is correct. The source code is like a recipe: It tells you how much and what kind of ingredients you need and how you prepare them to cook a tasty meal or program a funky app.\n\nBuon appetito!"
}
},
"settings": {
"data": {
"export": {
"button": "Export data",
"error": {
"convert": "Could not convert data to CSV",
"data": "There is no data to export",
"share": "There was a problem sharing the data export file"
},
"text": "Export data in CSV format for backup or so you can use it elsewhere",
"title": "My drip. data export"
},
"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?"
},
"errors": {
"couldNotOpenFile": "Could not open file",
"futureEdit": "Future dates may only contain a note, no other symptoms",
"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",
"text": "import, export or delete your data"
},
"nfpSettings": {
"name": "NFP settings",
"text": "define how you want to use NFP"
},
"password": {
"name": "Password",
"text": ""
},
"reminders": {
"name": "Reminders",
"text": "turn on/off reminders"
}
},
"title": "Settings"
}
},
"stats": {
"noData": "At least one completed cycle is needed to display stats.",
"intro": "Basic statistics about the length of your cycles.",
"overview": {
"average": "Average cycle",
"days": "days",
"min": "Shortest",
"max": "Longest",
"standardDeviation": "Standard\ndeviation",
"completedCycles": "completed\ncycles"
},
"showStats": "Show period details",
"details": {
"cycleStart": "Cycle start",
"cycleLength": "Cycle length",
"bleedingDays": "Bleeding"
},
"footnote": "Based on the standard deviation of all your tracked periods drip. calculates a range for the starting day of the upcoming 3 periods. The range will be 3 days if your standard deviation is smaller than 1.5 and 5 days if the value is bigger.\n\nThe standard deviation tells you how much the length of your periods vary, 0 means all your periods are exactly the same length and the bigger the value the more the period length varies."
},
"plurals": {
"day": "{{count}} day",
"day_plural": "{{count}} days"
},
"stats": {
"show_stats": "Show period details",
"cycle_start": "Cycle start",
"cycle_length": "Cycle length",
"bleeding": "Bleeding",
"cycle_length_explainer": "Basic statistics about the length of your cycles.",
"no_data": "At least one completed cycle is needed to display stats.",
"days": "days",
"completed_cycles": "completed\ncycles",
"average": "Average cycle",
"min": "Shortest",
"max": "Longest",
"standard_deviation": "Standard\ndeviation",
"standard_deviation_help": "Based on the standard deviation of all your tracked periods drip. calculates a range for the starting day of the upcoming 3 periods. The range will be 3 days if your standard deviation is smaller than 1.5 and 5 days if the value is bigger.\n\nThe standard deviation tells you how much the length of your periods vary, 0 means all your periods are exactly the same length and the bigger the value the more the period length varies."
}
}
-27
View File
@@ -1,6 +1,3 @@
import labels from './settings'
const settingsTitles = labels.menuItems
export const home = {
unknown: '?',
phase: (n) => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`,
@@ -33,30 +30,6 @@ export const shared = {
learnMore: 'Learn more',
}
export const headerTitles = {
Home: 'Home',
Calendar: 'Calendar',
Chart: 'Chart',
Stats: 'Statistics',
SettingsMenu: 'Settings',
Reminders: settingsTitles.reminders.name,
NfpSettings: settingsTitles.nfpSettings.name,
DataManagement: settingsTitles.dataManagement.name,
Password: settingsTitles.password.name,
About: 'About',
License: 'License',
PrivacyPolicy: 'Privacy Policy',
bleeding: 'Bleeding',
temperature: 'Temperature',
mucus: 'Cervical Mucus',
cervix: 'Cervix',
note: 'Note',
desire: 'Desire',
sex: 'Sex',
pain: 'Pain',
mood: 'Mood',
}
export const stats = {
cycleLengthExplainer: 'Basic statistics about the length of your cycles.',
emptyStats: 'At least one completed cycle is needed to display stats.',
-35
View File
@@ -1,7 +1,6 @@
import links from './links'
export default {
title: 'Settings',
menuItems: {
reminders: {
name: 'Reminders',
@@ -19,40 +18,6 @@ export default {
name: 'Password',
text: '',
},
about: 'About',
license: 'License',
settings: 'Settings',
privacyPolicy: 'Privacy Policy',
},
export: {
errors: {
noData: 'There is no data to export',
couldNotConvert: 'Could not convert data to CSV',
problemSharing: 'There was a problem sharing the data export file',
},
title: 'My drip. data export',
subject: 'My drip. data export',
button: 'Export data',
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',
+2 -159
View File
@@ -36,12 +36,9 @@
54DFE73D25D94DED0025C3FC /* cycle-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 54DFE73C25D94DED0025C3FC /* cycle-icon.png */; };
54DFE73E25D94DED0025C3FC /* cycle-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 54DFE73C25D94DED0025C3FC /* cycle-icon.png */; };
54E1D49923E7588F003FA37B /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54E1D49823E7588F003FA37B /* JavaScriptCore.framework */; };
5C4C9DDE2824847500B72CBE /* NodeMobile.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C225FC4966694B9FBD32E946 /* NodeMobile.framework */; };
62F2A4645AC84CDC9506FF27 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AEBF0735214455AAEDF56D5 /* libc++.tbd */; };
A16B351C3F3644CF95F104D2 /* builtin_modules in Resources */ = {isa = PBXBuildFile; fileRef = 36F1B55D0DEE47AA9AF4BBDD /* builtin_modules */; };
BD7041F2826E4A2CBE6CB87D /* RealmJSTests.xctest in Frameworks */ = {isa = PBXBuildFile; fileRef = F79F72C5390646E0A06AAE68 /* RealmJSTests.xctest */; };
D91133DCE120440893E2FD2E /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CD8C8B91E0A747B3883A0D56 /* libz.tbd */; };
E4584E55EEC24302A3E84A23 /* nodejs-project in Resources */ = {isa = PBXBuildFile; fileRef = 6466AE2461BE4FA88B8372F0 /* nodejs-project */; };
E545887DBE87912F11770AB9 /* libPods-drip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 699D3B3789FC2E5185CB9894 /* libPods-drip.a */; };
FAC423E577F555F66C9891E4 /* libPods-drip-dripTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F33CCAAB670FD0D98C5C72DF /* libPods-drip-dripTests.a */; };
/* End PBXBuildFile section */
@@ -69,7 +66,6 @@
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = drip/main.m; sourceTree = "<group>"; };
2B1578D5817F46EE9BFC9BAF /* Pods-drip.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-drip.debug.xcconfig"; path = "Target Support Files/Pods-drip/Pods-drip.debug.xcconfig"; sourceTree = "<group>"; };
2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
36F1B55D0DEE47AA9AF4BBDD /* builtin_modules */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = builtin_modules; path = "../node_modules/nodejs-mobile-react-native/install/resources/nodejs-modules/builtin_modules"; sourceTree = "<group>"; };
4A9B2D77CAC90DFEB5C4565A /* Pods-dripTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-dripTests.debug.xcconfig"; path = "Target Support Files/Pods-dripTests/Pods-dripTests.debug.xcconfig"; sourceTree = "<group>"; };
5409189625AB725F00086AE1 /* OpenSans-LightItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "OpenSans-LightItalic.ttf"; path = "../../assets/fonts/OpenSans-LightItalic.ttf"; sourceTree = "<group>"; };
540918A225AB725F00086AE1 /* Prompt-ExtraLight.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Prompt-ExtraLight.ttf"; path = "../../assets/fonts/Prompt-ExtraLight.ttf"; sourceTree = "<group>"; };
@@ -97,7 +93,6 @@
54E1D49823E7588F003FA37B /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
5ABC2C1190B4D25AC0398D09 /* Pods-dripTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-dripTests.release.xcconfig"; path = "Target Support Files/Pods-dripTests/Pods-dripTests.release.xcconfig"; sourceTree = "<group>"; };
5C649EDC281151BC005FED46 /* dripRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = dripRelease.entitlements; path = drip/dripRelease.entitlements; sourceTree = "<group>"; };
6466AE2461BE4FA88B8372F0 /* nodejs-project */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "nodejs-project"; path = "../nodejs-assets/nodejs-project"; sourceTree = "<group>"; };
699D3B3789FC2E5185CB9894 /* libPods-drip.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-drip.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6B7C2A0A7AAA83BBEFBD0B6A /* libPods-drip-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-drip-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
72DDDE8D34518ED64FD7EBBA /* Pods-drip-dripTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-drip-dripTests.release.xcconfig"; path = "Target Support Files/Pods-drip-dripTests/Pods-drip-dripTests.release.xcconfig"; sourceTree = "<group>"; };
@@ -108,7 +103,6 @@
A8B59389C2FC4F19BD30ABC3 /* libRNShare.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNShare.a; sourceTree = "<group>"; };
AB636AA0286D45CE9B23B2C3 /* libRCTRestart.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTRestart.a; sourceTree = "<group>"; };
B6FD0A300273E09D74C14C19 /* Pods-drip-dripTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-drip-dripTests.debug.xcconfig"; path = "Target Support Files/Pods-drip-dripTests/Pods-drip-dripTests.debug.xcconfig"; sourceTree = "<group>"; };
C225FC4966694B9FBD32E946 /* NodeMobile.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = NodeMobile.framework; path = "../node_modules/nodejs-mobile-react-native/ios/NodeMobile.framework"; sourceTree = "<group>"; };
CD8C8B91E0A747B3883A0D56 /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
D211D71BE5A8436A978770A9 /* libRNDocumentPicker.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNDocumentPicker.a; sourceTree = "<group>"; };
E086AB579387F878A2CBCFEB /* libPods-drip-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-drip-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -117,7 +111,6 @@
F5039D0A572B4BBCB7995891 /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = "<group>"; };
F710D85E391D4094816E1B62 /* libRealmJS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRealmJS.a; sourceTree = "<group>"; };
F79F72C5390646E0A06AAE68 /* RealmJSTests.xctest */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = RealmJSTests.xctest; sourceTree = "<group>"; };
F992F2D99E614DD79FAD6565 /* libRNNodeJsMobile.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNNodeJsMobile.a; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -137,7 +130,6 @@
62F2A4645AC84CDC9506FF27 /* libc++.tbd in Frameworks */,
D91133DCE120440893E2FD2E /* libz.tbd in Frameworks */,
BD7041F2826E4A2CBE6CB87D /* RealmJSTests.xctest in Frameworks */,
5C4C9DDE2824847500B72CBE /* NodeMobile.framework in Frameworks */,
E545887DBE87912F11770AB9 /* libPods-drip.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -204,7 +196,6 @@
2D16E6891FA4F8E400B85C8A /* libReact.a */,
9AEBF0735214455AAEDF56D5 /* libc++.tbd */,
CD8C8B91E0A747B3883A0D56 /* libz.tbd */,
C225FC4966694B9FBD32E946 /* NodeMobile.framework */,
6B7C2A0A7AAA83BBEFBD0B6A /* libPods-drip-tvOS.a */,
E086AB579387F878A2CBCFEB /* libPods-drip-tvOSTests.a */,
699D3B3789FC2E5185CB9894 /* libPods-drip.a */,
@@ -222,7 +213,6 @@
D211D71BE5A8436A978770A9 /* libRNDocumentPicker.a */,
84CCEBD3B2C44758853BC941 /* libRNFS.a */,
AB636AA0286D45CE9B23B2C3 /* libRCTRestart.a */,
F992F2D99E614DD79FAD6565 /* libRNNodeJsMobile.a */,
90224CB4571D41C4969E9722 /* libGCDWebServers.a */,
F710D85E391D4094816E1B62 /* libRealmJS.a */,
F79F72C5390646E0A06AAE68 /* RealmJSTests.xctest */,
@@ -267,8 +257,6 @@
00E356EF1AD99517003FC87E /* dripTests */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
6466AE2461BE4FA88B8372F0 /* nodejs-project */,
36F1B55D0DEE47AA9AF4BBDD /* builtin_modules */,
42C7F9942202468200F22656 /* Recovered References */,
6817ABC38854EEB6D3EE933A /* Pods */,
006C39A0B9774387BC5ACA43 /* Resources */,
@@ -298,7 +286,6 @@
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
22A5D3F7F84BDF2020F07B0E /* [CP] Embed Pods Frameworks */,
46313D848A7A3E69E5ED05E7 /* [CP] Copy Pods Resources */,
);
buildRules = (
@@ -320,14 +307,6 @@
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
DE9DD9049EBE47E5A1EA3F5D /* Build NodeJS Mobile Native Modules */,
6C10CEE2CE544C7F9400F1B4 /* Sign NodeJS Mobile Native Modules */,
B93B657279074F0DB95BCDE2 /* Remove NodeJS Mobile Framework Simulator Strips */,
CD43B73558845DFAF38EE039 /* [CP] Embed Pods Frameworks */,
935E6C85F581DC5BB536B833 /* [CP-User] [NODEJS MOBILE] Copy Node.js Project files */,
FCE9B437260EC219FF32251C /* [CP-User] [NODEJS MOBILE] Build Native Modules */,
2A3F66C5C345646DE949E1FF /* [CP-User] [NODEJS MOBILE] Sign Native Modules */,
CD7DBF41D9E2377DC61F80D8 /* [CP-User] [NODEJS MOBILE] Remove Simulator Strip */,
616E70055A3365D214C7B201 /* [CP] Copy Pods Resources */,
);
buildRules = (
@@ -412,8 +391,6 @@
54DFE73A25D94D6E0025C3FC /* swipe.png in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
5472A44A25BB7806005E81DE /* drip-home-icons.ttf in Resources */,
E4584E55EEC24302A3E84A23 /* nodejs-project in Resources */,
A16B351C3F3644CF95F104D2 /* builtin_modules in Resources */,
5472A45225BB7807005E81DE /* Jost-700-Bold.otf in Resources */,
5472A44E25BB7807005E81DE /* Prompt-ExtraLight.ttf in Resources */,
);
@@ -436,34 +413,6 @@
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
22A5D3F7F84BDF2020F07B0E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-drip-dripTests/Pods-drip-dripTests-frameworks.sh",
"${PODS_ROOT}/../../node_modules/nodejs-mobile-react-native/ios/NodeMobile.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NodeMobile.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-drip-dripTests/Pods-drip-dripTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
2A3F66C5C345646DE949E1FF /* [CP-User] [NODEJS MOBILE] Sign Native Modules */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
name = "[CP-User] [NODEJS MOBILE] Sign Native Modules";
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/sh\nset -e\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, look for it in the project's\n#nodejs-assets/BUILD_NATIVE_MODULES.txt file.\nNODEJS_ASSETS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../nodejs-assets/ && pwd )\"\nPREFERENCE_FILE_PATH=\"$NODEJS_ASSETS_DIR/BUILD_NATIVE_MODULES.txt\"\n if [ -f \"$PREFERENCE_FILE_PATH\" ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=\"$(cat $PREFERENCE_FILE_PATH | xargs)\"\n fi\nfi\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, try to find .gyp files\n#to turn it on.\n gypfiles=($(find \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -type f -name \"*.gyp\"))\n if [ ${#gypfiles[@]} -gt 0 ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=1\n else\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=0\n fi\nfi\nif [ \"1\" != \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then exit 0; fi\n# Delete object files\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.o\" -type f -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.a\" -type f -delete\n# Create Info.plist for each framework built and loader override.\nPATCH_SCRIPT_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/scripts/ && pwd )\"\nNODEJS_PROJECT_DIR=\"$( cd \"$CODESIGNING_FOLDER_PATH\" && cd nodejs-project/ && pwd )\"\nnode \"$PATCH_SCRIPT_DIR\"/ios-create-plists-and-dlopen-override.js $NODEJS_PROJECT_DIR\n# Embed every resulting .framework in the application and delete them afterwards.\nembed_framework()\n{\n FRAMEWORK_NAME=\"$(basename \"$1\")\"\n cp -r \"$1\" \"$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH/\"\n /usr/bin/codesign --force --sign $EXPANDED_CODE_SIGN_IDENTITY --preserve-metadata=identifier,entitlements,flags --timestamp=none \"$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH/$FRAMEWORK_NAME\"\n}\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.framework\" -type d | while read frmwrk_path; do embed_framework \"$frmwrk_path\"; done\n\n#Delete gyp temporary .deps dependency folders from the project structure.\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/.deps/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \".deps\" -type d -delete\n\n#Delete frameworks from their build paths\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/*.framework/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.framework\" -type d -delete\n";
};
46313D848A7A3E69E5ED05E7 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -564,20 +513,6 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-drip/Pods-drip-resources.sh\"\n";
showEnvVarsInLog = 0;
};
6C10CEE2CE544C7F9400F1B4 /* Sign NodeJS Mobile Native Modules */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Sign NodeJS Mobile Native Modules";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\nset -e\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, look for it in the project's\n#nodejs-assets/BUILD_NATIVE_MODULES.txt file.\nNODEJS_ASSETS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../nodejs-assets/ && pwd )\"\nPREFERENCE_FILE_PATH=\"$NODEJS_ASSETS_DIR/BUILD_NATIVE_MODULES.txt\"\n if [ -f \"$PREFERENCE_FILE_PATH\" ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=\"$(cat $PREFERENCE_FILE_PATH | xargs)\"\n fi\nfi\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, try to find .gyp files\n#to turn it on.\n gypfiles=($(find \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -type f -name \"*.gyp\"))\n if [ ${#gypfiles[@]} -gt 0 ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=1\n else\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=0\n fi\nfi\nif [ \"1\" != \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then exit 0; fi\n# Delete object files\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.o\" -type f -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.a\" -type f -delete\n# Create Info.plist for each framework built and loader override.\nPATCH_SCRIPT_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/scripts/ && pwd )\"\nNODEJS_PROJECT_DIR=\"$( cd \"$CODESIGNING_FOLDER_PATH\" && cd nodejs-project/ && pwd )\"\nnode \"$PATCH_SCRIPT_DIR\"/ios-create-plists-and-dlopen-override.js $NODEJS_PROJECT_DIR\n# Embed every resulting .framework in the application and delete them afterwards.\nembed_framework()\n{\n FRAMEWORK_NAME=\"$(basename \"$1\")\"\n cp -r \"$1\" \"$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH/\"\n \n /usr/bin/codesign --force --sign $EXPANDED_CODE_SIGN_IDENTITY --preserve-metadata=identifier,entitlements,flags --timestamp=none \"$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH/$FRAMEWORK_NAME\"\n}\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.framework\" -type d | while read frmwrk_path; do embed_framework \"$frmwrk_path\"; done\n\n#Delete gyp temporary .deps dependency folders from the project structure.\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/.deps/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \".deps\" -type d -delete\n\n#Delete frameworks from their build paths\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/*.framework/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.framework\" -type d -delete\n";
};
852A2E0CD5D0F561CE2927A3 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -600,48 +535,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
935E6C85F581DC5BB536B833 /* [CP-User] [NODEJS MOBILE] Copy Node.js Project files */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
name = "[CP-User] [NODEJS MOBILE] Copy Node.js Project files";
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/sh\nset -e\nNODEJS_ASSETS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../nodejs-assets/ && pwd )\"\nNODEJS_BUILT_IN_MODULES_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/install/resources/nodejs-modules/ && pwd )\"\nif [ -d \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" ]\nthen\nrm -rf \"$CODESIGNING_FOLDER_PATH/nodejs-project/\"\nfi\nif [ -d \"$CODESIGNING_FOLDER_PATH/builtin_modules/\" ]\nthen\nrm -rf \"$CODESIGNING_FOLDER_PATH/builtin_modules/\"\nfi\nrsync -av --delete \"$NODEJS_ASSETS_DIR/nodejs-project\" \"$CODESIGNING_FOLDER_PATH\"\nrsync -av --delete \"$NODEJS_BUILT_IN_MODULES_DIR/builtin_modules\" \"$CODESIGNING_FOLDER_PATH\"\n";
};
B93B657279074F0DB95BCDE2 /* Remove NodeJS Mobile Framework Simulator Strips */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Remove NodeJS Mobile Framework Simulator Strips";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\nset -e\nFRAMEWORK_BINARY_PATH=\"$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH/NodeMobile.framework/NodeMobile\"\nFRAMEWORK_STRIPPED_PATH=\"$FRAMEWORK_BINARY_PATH-strip\"\nif [ \"$PLATFORM_NAME\" != \"iphonesimulator\" ]; then\n if $(lipo \"$FRAMEWORK_BINARY_PATH\" -verify_arch \"x86_64\") ; then\n lipo -output \"$FRAMEWORK_STRIPPED_PATH\" -remove \"x86_64\" \"$FRAMEWORK_BINARY_PATH\"\n rm \"$FRAMEWORK_BINARY_PATH\"\n mv \"$FRAMEWORK_STRIPPED_PATH\" \"$FRAMEWORK_BINARY_PATH\"\n echo \"Removed simulator strip from NodeMobile.framework\"\n fi\nfi\n";
};
CD43B73558845DFAF38EE039 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-drip/Pods-drip-frameworks.sh",
"${PODS_ROOT}/../../node_modules/nodejs-mobile-react-native/ios/NodeMobile.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NodeMobile.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-drip/Pods-drip-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
CD68B565C5F4A7A674494D02 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -664,40 +557,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
CD7DBF41D9E2377DC61F80D8 /* [CP-User] [NODEJS MOBILE] Remove Simulator Strip */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
name = "[CP-User] [NODEJS MOBILE] Remove Simulator Strip";
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/sh\nset -e\nFRAMEWORK_BINARY_PATH=\"$TARGET_BUILD_DIR/$FRAMEWORKS_FOLDER_PATH/NodeMobile.framework/NodeMobile\"\nFRAMEWORK_STRIPPED_PATH=\"$FRAMEWORK_BINARY_PATH-strip\"\nif [ \"$PLATFORM_NAME\" != \"iphonesimulator\" ]; then\n if $(lipo \"$FRAMEWORK_BINARY_PATH\" -verify_arch \"x86_64\") ; then\n lipo -output \"$FRAMEWORK_STRIPPED_PATH\" -remove \"x86_64\" \"$FRAMEWORK_BINARY_PATH\"\n rm \"$FRAMEWORK_BINARY_PATH\"\n mv \"$FRAMEWORK_STRIPPED_PATH\" \"$FRAMEWORK_BINARY_PATH\"\n echo \"Removed simulator strip from NodeMobile.framework\"\n fi\nfi\n";
};
DE9DD9049EBE47E5A1EA3F5D /* Build NodeJS Mobile Native Modules */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Build NodeJS Mobile Native Modules";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\nset -e\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, look for it in the project's\n#nodejs-assets/BUILD_NATIVE_MODULES.txt file.\nNODEJS_ASSETS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../nodejs-assets/ && pwd )\"\nPREFERENCE_FILE_PATH=\"$NODEJS_ASSETS_DIR/BUILD_NATIVE_MODULES.txt\"\n if [ -f \"$PREFERENCE_FILE_PATH\" ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=\"$(cat $PREFERENCE_FILE_PATH | xargs)\"\n fi\nfi\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, try to find .gyp files\n#to turn it on.\n gypfiles=($(find \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -type f -name \"*.gyp\"))\n if [ ${#gypfiles[@]} -gt 0 ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=1\n else\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=0\n fi\nfi\nif [ \"1\" != \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then exit 0; fi\n# Delete object files that may already come from within the npm package.\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.o\" -type f -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.a\" -type f -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.node\" -type f -delete\n# Delete bundle contents that may be there from previous builds.\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/*.node/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.node\" -type d -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/*.framework/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.framework\" -type d -delete\n# Apply patches to the modules package.json\nif [ -d \"$CODESIGNING_FOLDER_PATH\"/nodejs-project/node_modules/ ]; then\n PATCH_SCRIPT_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/scripts/ && pwd )\"\n NODEJS_PROJECT_MODULES_DIR=\"$( cd \"$CODESIGNING_FOLDER_PATH\" && cd nodejs-project/node_modules/ && pwd )\"\n node \"$PATCH_SCRIPT_DIR\"/patch-package.js $NODEJS_PROJECT_MODULES_DIR\nfi\n# Get the nodejs-mobile-gyp location\nif [ -d \"$PROJECT_DIR/../node_modules/nodejs-mobile-gyp/\" ]; then\n NODEJS_MOBILE_GYP_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-gyp/ && pwd )\"\nelse\n NODEJS_MOBILE_GYP_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/node_modules/nodejs-mobile-gyp/ && pwd )\"\nfi\nNODEJS_MOBILE_GYP_BIN_FILE=\"$NODEJS_MOBILE_GYP_DIR\"/bin/node-gyp.js\n# Rebuild modules with right environment\nNODEJS_HEADERS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/ios/libnode/ && pwd )\"\npushd $CODESIGNING_FOLDER_PATH/nodejs-project/\nif [ \"$PLATFORM_NAME\" == \"iphoneos\" ]\nthen\n GYP_DEFINES=\"OS=ios\" npm_config_nodedir=\"$NODEJS_HEADERS_DIR\" npm_config_node_gyp=\"$NODEJS_MOBILE_GYP_BIN_FILE\" npm_config_platform=\"ios\" npm_config_format=\"make-ios\" npm_config_node_engine=\"chakracore\" npm_config_arch=\"arm64\" npm --verbose rebuild --build-from-source\nelse\n GYP_DEFINES=\"OS=ios\" npm_config_nodedir=\"$NODEJS_HEADERS_DIR\" npm_config_node_gyp=\"$NODEJS_MOBILE_GYP_BIN_FILE\" npm_config_platform=\"ios\" npm_config_format=\"make-ios\" npm_config_node_engine=\"chakracore\" npm_config_arch=\"x64\" npm --verbose rebuild --build-from-source\nfi\npopd\n";
};
FCE9B437260EC219FF32251C /* [CP-User] [NODEJS MOBILE] Build Native Modules */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
name = "[CP-User] [NODEJS MOBILE] Build Native Modules";
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/sh\nset -e\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, look for it in the project's\n#nodejs-assets/BUILD_NATIVE_MODULES.txt file.\nNODEJS_ASSETS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../nodejs-assets/ && pwd )\"\nPREFERENCE_FILE_PATH=\"$NODEJS_ASSETS_DIR/BUILD_NATIVE_MODULES.txt\"\n if [ -f \"$PREFERENCE_FILE_PATH\" ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=\"$(cat $PREFERENCE_FILE_PATH | xargs)\"\n fi\nfi\nif [ -z \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then\n# If build native modules preference is not set, try to find .gyp files\n#to turn it on.\n gypfiles=($(find \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -type f -name \"*.gyp\"))\n if [ ${#gypfiles[@]} -gt 0 ]; then\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=1\n else\n NODEJS_MOBILE_BUILD_NATIVE_MODULES=0\n fi\nfi\nif [ \"1\" != \"$NODEJS_MOBILE_BUILD_NATIVE_MODULES\" ]; then exit 0; fi\n# Delete object files that may already come from within the npm package.\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.o\" -type f -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.a\" -type f -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.node\" -type f -delete\n# Delete bundle contents that may be there from previous builds.\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/*.node/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.node\" -type d -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -path \"*/*.framework/*\" -delete\nfind \"$CODESIGNING_FOLDER_PATH/nodejs-project/\" -name \"*.framework\" -type d -delete\n# Apply patches to the modules package.json\nif [ -d \"$CODESIGNING_FOLDER_PATH\"/nodejs-project/node_modules/ ]; then\n PATCH_SCRIPT_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/scripts/ && pwd )\"\n NODEJS_PROJECT_MODULES_DIR=\"$( cd \"$CODESIGNING_FOLDER_PATH\" && cd nodejs-project/node_modules/ && pwd )\"\n node \"$PATCH_SCRIPT_DIR\"/patch-package.js $NODEJS_PROJECT_MODULES_DIR\nfi\n# Get the nodejs-mobile-gyp location\nif [ -d \"$PROJECT_DIR/../node_modules/nodejs-mobile-gyp/\" ]; then\n NODEJS_MOBILE_GYP_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-gyp/ && pwd )\"\nelse\n NODEJS_MOBILE_GYP_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/node_modules/nodejs-mobile-gyp/ && pwd )\"\nfi\nNODEJS_MOBILE_GYP_BIN_FILE=\"$NODEJS_MOBILE_GYP_DIR\"/bin/node-gyp.js\n# Support building neon-bindings (Rust) native modules\nif [ -f ~/.cargo/env ]; then\n source ~/.cargo/env;\nfi\n# Rebuild modules with right environment\nNODEJS_HEADERS_DIR=\"$( cd \"$PROJECT_DIR\" && cd ../node_modules/nodejs-mobile-react-native/ios/libnode/ && pwd )\"\npushd $CODESIGNING_FOLDER_PATH/nodejs-project/\nif [ \"$PLATFORM_NAME\" == \"iphoneos\" ]\nthen\n GYP_DEFINES=\"OS=ios\" CARGO_BUILD_TARGET=\"aarch64-apple-ios\" npm_config_nodedir=\"$NODEJS_HEADERS_DIR\" npm_config_node_gyp=\"$NODEJS_MOBILE_GYP_BIN_FILE\" npm_config_platform=\"ios\" npm_config_format=\"make-ios\" npm_config_node_engine=\"chakracore\" npm_config_arch=\"arm64\" npm --verbose rebuild --build-from-source\nelse\n GYP_DEFINES=\"OS=ios\" CARGO_BUILD_TARGET=\"x86_64-apple-ios\" npm_config_nodedir=\"$NODEJS_HEADERS_DIR\" npm_config_node_gyp=\"$NODEJS_MOBILE_GYP_BIN_FILE\" npm_config_platform=\"ios\" npm_config_format=\"make-ios\" npm_config_node_engine=\"chakracore\" npm_config_arch=\"x64\" npm --verbose rebuild --build-from-source\nfi\npopd\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -737,8 +596,6 @@
ENABLE_BITCODE = "$(inherited)";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"../node_modules/nodejs-mobile-react-native/ios\"",
"\"../node_modules/nodejs-mobile-react-native/ios\"",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
);
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -753,7 +610,6 @@
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
"$(SRCROOT)/../node_modules/react-native-fs/**",
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
"$(SRCROOT)/../node_modules/nodejs-mobile-react-native/ios/**",
"$(SRCROOT)/../node_modules/realm/src/**",
);
INFOPLIST_FILE = dripTests/Info.plist;
@@ -785,8 +641,6 @@
ENABLE_BITCODE = "$(inherited)";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"../node_modules/nodejs-mobile-react-native/ios\"",
"\"../node_modules/nodejs-mobile-react-native/ios\"",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
);
HEADER_SEARCH_PATHS = (
@@ -797,7 +651,6 @@
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
"$(SRCROOT)/../node_modules/react-native-fs/**",
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
"$(SRCROOT)/../node_modules/nodejs-mobile-react-native/ios/**",
"$(SRCROOT)/../node_modules/realm/src/**",
);
INFOPLIST_FILE = dripTests/Info.plist;
@@ -832,10 +685,7 @@
ENABLE_BITCODE = "$(inherited)";
EXCLUDED_ARCHS = "";
"EXCLUDED_ARCHS[sdk=*]" = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"../node_modules/nodejs-mobile-react-native/ios\"",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREPROCESSOR_DEFINITIONS = (
"COCOAPODS=1",
"$(inherited)",
@@ -848,7 +698,6 @@
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
"$(SRCROOT)/../node_modules/react-native-fs/**",
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
"$(SRCROOT)/../node_modules/nodejs-mobile-react-native/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/push-notification-ios/ios",
"$(SRCROOT)/../node_modules/realm/src/**",
);
@@ -883,7 +732,6 @@
"\"${PODS_CONFIGURATION_BUILD_DIR}/RealmJS\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/glog\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/nodejs-mobile-react-native\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-document-picker\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-restart\"",
"\"${PODS_ROOT}/../../node_modules/realm/vendor/realm-ios\"",
@@ -915,10 +763,7 @@
DEVELOPMENT_TEAM = 6AD72X6W26;
ENABLE_BITCODE = "$(inherited)";
EXCLUDED_ARCHS = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"../node_modules/nodejs-mobile-react-native/ios\"",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREPROCESSOR_DEFINITIONS = (
"COCOAPODS=1",
"$(inherited)",
@@ -931,7 +776,6 @@
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
"$(SRCROOT)/../node_modules/react-native-fs/**",
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
"$(SRCROOT)/../node_modules/nodejs-mobile-react-native/ios/**",
"$(SRCROOT)/../node_modules/@react-native-community/push-notification-ios/ios",
"$(SRCROOT)/../node_modules/realm/src/**",
);
@@ -966,7 +810,6 @@
"\"${PODS_CONFIGURATION_BUILD_DIR}/RealmJS\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/glog\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/nodejs-mobile-react-native\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-document-picker\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-restart\"",
"\"${PODS_ROOT}/../../node_modules/realm/vendor/realm-ios\"",
+2
View File
@@ -0,0 +1,2 @@
// Import Jest Native matchers
import '@testing-library/jest-native/extend-expect'
+1 -4
View File
@@ -1,10 +1,7 @@
module.exports = {
preset: '@testing-library/react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
moduleNameMapper: {
'\\.(png)$': require.resolve('./test/file-mock.js'),
},
setupFilesAfterEnv: ['./test/jest-setup.js'],
setupFilesAfterEnv: ['./jest-setup.js'],
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native(-.*)?|@react-native(-community)?)/)',
],
-12
View File
@@ -1,12 +0,0 @@
// too see stdout / stderr from this process, run
// adb logcat | grep "NODEJS-MOBILE"
const rnBridge = require('rn-bridge')
const crypto = require('crypto')
rnBridge.channel.on('request-SHA512', (msg) => {
msg = JSON.parse(msg)
const hash = crypto.createHash('sha512')
hash.update(msg.message)
const result = hash.digest('hex')
rnBridge.channel.post(msg.type, result)
})
@@ -1,4 +0,0 @@
{
"dependencies": {},
"main": "main.js"
}
+1 -1
View File
@@ -37,8 +37,8 @@
"@react-native-community/push-notification-ios": "^1.8.0",
"csvtojson": "^2.0.8",
"i18next": "^21.9.0",
"jshashes": "^1.0.8",
"moment": "^2.29.4",
"nodejs-mobile-react-native": "^0.8.2",
"object-path": "^0.11.4",
"obv": "0.0.1",
"prop-types": "^15.8.1",
-13
View File
@@ -1,13 +0,0 @@
// https://github.com/janeasystems/nodejs-mobile-react-native#duplicate-module-name
const blacklist = require('metro-config/src/defaults/blacklist')
module.exports = {
resolver:{
blacklistRE: blacklist([
/nodejs-assets\/.*/,
/android\/.*/,
/ios\/.*/
])
},
}
+15 -19
View File
@@ -6,7 +6,7 @@ import Spacing from './spacing'
export const fonts = {
main: Platform.OS === 'ios' ? 'Jost-Book' : 'Jost-400-Book',
bold: Platform.OS === 'ios' ? 'Jost-Bold' : 'Jost-700-Bold',
bold : Platform.OS === 'ios' ? 'Jost-Bold' : 'Jost-700-Bold',
}
export const sizes = {
@@ -23,7 +23,7 @@ export const sizes = {
const accentText = {
fontFamily: fonts.bold,
textAlignVertical: 'center',
textTransform: 'uppercase',
textTransform: 'uppercase'
}
const accentTextBig = {
@@ -43,51 +43,47 @@ const accentTextHuge = {
const accentTextSmall = {
...accentText,
fontSize: sizes.small,
fontSize: sizes.small
}
const title = {
color: Colors.purple,
marginVertical: Spacing.large,
marginVertical: Spacing.large
}
const label = {
fontSize: sizes.small,
textTransform: 'uppercase',
textTransform: 'uppercase'
}
export default {
accentOrange: {
...accentTextSmall,
color: Colors.orange,
},
accentPurple: {
...accentTextSmall,
color: Colors.purple,
color: Colors.orange
},
accentPurpleBig: {
...accentTextBig,
color: Colors.purple,
color: Colors.purple
},
accentPurpleGiant: {
...accentTextGiant,
color: Colors.purple,
color: Colors.purple
},
accentPurpleHuge: {
...accentTextHuge,
color: Colors.purple,
color: Colors.purple
},
mainText: {
fontFamily: fonts.main,
fontSize: sizes.base,
fontSize: sizes.base
},
label: {
...label,
...label
},
labelBold: {
color: Colors.greyDark,
fontWeight: 'bold',
...label,
...label
},
labelLight: {
color: Colors.grey,
@@ -95,7 +91,7 @@ export default {
},
subtitle: {
fontSize: sizes.subtitle,
...title,
...title
},
title: {
alignSelf: 'center',
@@ -103,7 +99,7 @@ export default {
fontWeight: '700',
fontSize: sizes.title,
marginHorizontal: Spacing.base,
...title,
...title
},
titleWithoutMargin: {
alignSelf: 'center',
@@ -111,5 +107,5 @@ export default {
fontFamily: fonts.bold,
fontWeight: '700',
fontSize: sizes.title,
},
}
}
@@ -1,14 +1,21 @@
import React from 'react'
import { render, screen, fireEvent } from '@testing-library/react-native'
import AcceptLicense from '../components/AcceptLicense'
import AcceptLicense from '../../components/AcceptLicense'
import { saveLicenseFlag } from '../local-storage'
import { saveLicenseFlag } from '../../local-storage'
jest.mock('../../local-storage', () => ({
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('On clicking OK button, the license is accepted', async () => {
const mockedSetLicense = jest.fn()
@@ -1,7 +1,14 @@
import React from 'react'
import { render, screen } from '@testing-library/react-native'
import License from '../components/settings/License'
import License from '../../../components/settings/License'
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (str, options) => {
return str + (options ? JSON.stringify(options) : '')
},
}),
}))
describe('License screen', () => {
test('It should have a correct year', async () => {
@@ -1,395 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Stats screen when provided data, renders stats 1`] = `
<RCTSafeAreaView
emulateUnlessSupported={true}
style={
Object {
"backgroundColor": "#E9F2ED",
"flex": 1,
}
}
>
<RCTScrollView
contentContainerStyle={
Object {
"paddingHorizontal": 34.285714285714285,
"paddingTop": 34.285714285714285,
}
}
>
<View>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
cycle_length_explainer
</Text>
<View
style={
Object {
"alignItems": "center",
"flexDirection": "row",
"justifyContent": "space-between",
}
}
>
<View
style={
Object {
"flex": 3,
"flexDirection": "column",
}
}
>
<View
accessibilityIgnoresInvertColors={true}
style={
Object {
"marginBottom": 42.857142857142854,
"paddingTop": 107.14285714285714,
}
}
>
<Image
source={123}
style={
Array [
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
Object {
"height": undefined,
"width": undefined,
},
Object {
"resizeMode": "contain",
},
]
}
/>
<Text
ellipsizeMode="clip"
numberOfLines={1}
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#3A2671",
"fontFamily": "Jost-Bold",
"fontSize": 85.71428571428571,
"marginTop": -68.57142857142857,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
30.33
</Text>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#3A2671",
"fontFamily": "Jost-Bold",
"fontSize": 68.57142857142857,
"marginTop": -34.285714285714285,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
days
</Text>
</View>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#F38337",
"fontFamily": "Jost-Bold",
"fontSize": 27.857142857142858,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
average
</Text>
</View>
<View
style={
Object {
"flex": 5,
"flexDirection": "column",
"paddingTop": 21.428571428571427,
}
}
>
<StatsOverview
data={
Array [
Array [
30,
"min",
],
Array [
31,
"max",
],
Array [
0.58,
"standard_deviation",
],
Array [
3,
"completed_cycles",
],
]
}
/>
</View>
</View>
<View
accessible={true}
collapsable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignItems": "center",
"alignSelf": "center",
"backgroundColor": "#F38337",
"borderRadius": 25,
"flexDirection": "row",
"justifyContent": "center",
"marginTop": 34.285714285714285,
"minWidth": "15%",
"opacity": 1,
"paddingHorizontal": 8.571428571428571,
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Array [
Object {
"color": "white",
"fontFamily": "Jost-Bold",
},
Object {
"fontSize": 27.857142857142858,
"padding": 21.428571428571427,
"textTransform": "uppercase",
},
],
]
}
>
show_stats
</Text>
</View>
<AppHelp
text="standard_deviation_help"
/>
</View>
</RCTScrollView>
</RCTSafeAreaView>
`;
exports[`Stats screen when provided no data, renders no_data text 1`] = `
<RCTSafeAreaView
emulateUnlessSupported={true}
style={
Object {
"backgroundColor": "#E9F2ED",
"flex": 1,
}
}
>
<RCTScrollView
contentContainerStyle={
Object {
"paddingHorizontal": 34.285714285714285,
"paddingTop": 34.285714285714285,
}
}
>
<View>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
cycle_length_explainer
</Text>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
no_data
</Text>
</View>
</RCTScrollView>
</RCTSafeAreaView>
`;
exports[`Stats screen when provided null, renders no_data text 1`] = `
<RCTSafeAreaView
emulateUnlessSupported={true}
style={
Object {
"backgroundColor": "#E9F2ED",
"flex": 1,
}
}
>
<RCTScrollView
contentContainerStyle={
Object {
"paddingHorizontal": 34.285714285714285,
"paddingTop": 34.285714285714285,
}
}
>
<View>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
cycle_length_explainer
</Text>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
no_data
</Text>
</View>
</RCTScrollView>
</RCTSafeAreaView>
`;
exports[`Stats screen when provided undefined, renders no_data text 1`] = `
<RCTSafeAreaView
emulateUnlessSupported={true}
style={
Object {
"backgroundColor": "#E9F2ED",
"flex": 1,
}
}
>
<RCTScrollView
contentContainerStyle={
Object {
"paddingHorizontal": 34.285714285714285,
"paddingTop": 34.285714285714285,
}
}
>
<View>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
cycle_length_explainer
</Text>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
no_data
</Text>
</View>
</RCTScrollView>
</RCTSafeAreaView>
`;
-13
View File
@@ -1,13 +0,0 @@
import React from 'react'
import { render } from '@testing-library/react-native'
import AppHelp from '../../../components/common/AppHelp'
describe('AppHelp screen', () => {
test('when provided text, should render it', async () => {
const text = 'Some help test'
const { toJSON } = render(<AppHelp text={text} />)
expect(toJSON()).toMatchSnapshot()
})
})
+19
View File
@@ -0,0 +1,19 @@
import React from 'react'
import { render } from '@testing-library/react-native'
import Footnote from '../../../components/common/Footnote'
describe('Footnote component', () => {
test('when children are present, renders them', () => {
const text = 'Some footnote text'
const { toJSON } = render(<Footnote>{text}</Footnote>)
expect(toJSON()).toMatchSnapshot()
})
test('when no children, renders nothing', () => {
const { toJSON } = render(<Footnote></Footnote>)
expect(toJSON()).toMatchSnapshot()
})
})
@@ -1,25 +0,0 @@
import React from 'react'
import { render } from '@testing-library/react-native'
import StatsOverview from '../../../components/common/StatsOverview'
describe('StatsOverview screen', () => {
test('when provided correct, renders it', async () => {
const data = [
[21, 'shortest'],
[21, 'longest'],
[0, 'standard deviation'],
[2, 'completed cycles'],
]
const { toJSON } = render(<StatsOverview data={data} />)
expect(toJSON()).toMatchSnapshot()
})
test('when provided empty data, renders nothing (does not break)', async () => {
const data = []
const { toJSON } = render(<StatsOverview data={data} />)
expect(toJSON()).toMatchSnapshot()
})
})
-47
View File
@@ -1,47 +0,0 @@
import React from 'react'
import { render } from '@testing-library/react-native'
import StatsTable from '../../../components/common/StatsTable'
const mockGetStats = jest
.fn()
.mockImplementationOnce(() => [
{ date: '2022-07-01', cycleLength: 31, bleedingLength: 5 },
{ date: '2022-06-01', cycleLength: 31, bleedingLength: 5 },
])
.mockImplementationOnce(() => [])
.mockImplementationOnce(() => null)
.mockImplementationOnce(() => undefined)
jest.mock('../../../lib/cycle', () => ({
__esModule: true,
default: () => ({
getStats: mockGetStats,
}),
}))
describe('StatsTable screen', () => {
test('when provided correct data set, renders it', async () => {
const { toJSON } = render(<StatsTable onClose={jest.fn()} />)
expect(toJSON()).toMatchSnapshot()
})
test('when provided no data, renders nothing', async () => {
const { toJSON } = render(<StatsTable onClose={jest.fn()} />)
expect(toJSON()).toMatchSnapshot()
})
test('when provided null, renders nothing', async () => {
const { toJSON } = render(<StatsTable onClose={jest.fn()} />)
expect(toJSON()).toMatchSnapshot()
})
test('when provided undefined, renders nothing', async () => {
const { toJSON } = render(<StatsTable onClose={jest.fn()} />)
expect(toJSON()).toMatchSnapshot()
})
})
@@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AppHelp screen when provided text, should render it 1`] = `
exports[`Footnote component when children are present, renders them 1`] = `
<View
style={
Object {
"alignItems": "center",
"alignContent": "flex-start",
"flexDirection": "row",
"justifyContent": "space-between",
"padding": 34.285714285714285,
"marginBottom": 8.571428571428571,
"marginTop": 34.285714285714285,
}
}
>
@@ -20,13 +20,7 @@ exports[`AppHelp screen when provided text, should render it 1`] = `
"fontSize": 34.285714285714285,
},
Object {
"alignSelf": "flex-start",
"color": "#3A2671",
"fontFamily": "Jost-Bold",
"fontSize": 27.857142857142858,
"paddingRight": 34.285714285714285,
"textAlignVertical": "center",
"textTransform": "uppercase",
"color": "#F38337",
},
]
}
@@ -34,6 +28,11 @@ exports[`AppHelp screen when provided text, should render it 1`] = `
*
</Text>
<Text
linkStyle={
Object {
"color": "white",
}
}
style={
Array [
Object {
@@ -41,11 +40,16 @@ exports[`AppHelp screen when provided text, should render it 1`] = `
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
Object {
"color": "#555",
"paddingLeft": 21.428571428571427,
},
]
}
>
Some help test
Some footnote text
</Text>
</View>
`;
exports[`Footnote component when no children, renders nothing 1`] = `null`;
@@ -1,321 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`StatsOverview screen when provided correct, renders it 1`] = `
Array [
<View
style={
Object {
"flexDirection": "row",
}
}
>
<View
style={
Object {
"alignItems": "flex-end",
"flex": 3,
"justifyContent": "center",
}
}
>
<Text
ellipsizeMode="clip"
numberOfLines={1}
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#3A2671",
"fontFamily": "Jost-Bold",
"fontSize": 64.28571428571428,
"marginRight": 8.571428571428571,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
21
</Text>
</View>
<View
style={
Object {
"flex": 5,
"flexDirection": "row",
}
}
>
<Text
ellipsizeMode="tail"
numberOfLines={2}
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#F38337",
"fontFamily": "Jost-Bold",
"fontSize": 27.857142857142858,
"margin": 15,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
shortest
</Text>
</View>
</View>,
<View
style={
Object {
"flexDirection": "row",
}
}
>
<View
style={
Object {
"alignItems": "flex-end",
"flex": 3,
"justifyContent": "center",
}
}
>
<Text
ellipsizeMode="clip"
numberOfLines={1}
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#3A2671",
"fontFamily": "Jost-Bold",
"fontSize": 64.28571428571428,
"marginRight": 8.571428571428571,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
21
</Text>
</View>
<View
style={
Object {
"flex": 5,
"flexDirection": "row",
}
}
>
<Text
ellipsizeMode="tail"
numberOfLines={2}
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#F38337",
"fontFamily": "Jost-Bold",
"fontSize": 27.857142857142858,
"margin": 15,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
longest
</Text>
</View>
</View>,
<View
style={
Object {
"flexDirection": "row",
}
}
>
<View
style={
Object {
"alignItems": "flex-end",
"flex": 3,
"justifyContent": "center",
}
}
>
<Text
ellipsizeMode="clip"
numberOfLines={1}
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#3A2671",
"fontFamily": "Jost-Bold",
"fontSize": 64.28571428571428,
"marginRight": 8.571428571428571,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
0
</Text>
</View>
<View
style={
Object {
"flex": 5,
"flexDirection": "row",
}
}
>
<Text
ellipsizeMode="tail"
numberOfLines={2}
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#F38337",
"fontFamily": "Jost-Bold",
"fontSize": 27.857142857142858,
"margin": 15,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
standard deviation
</Text>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#3A2671",
"fontFamily": "Jost-Bold",
"fontSize": 64.28571428571428,
"marginRight": 8.571428571428571,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
*
</Text>
</View>
</View>,
<View
style={
Object {
"flexDirection": "row",
}
}
>
<View
style={
Object {
"alignItems": "flex-end",
"flex": 3,
"justifyContent": "center",
}
}
>
<Text
ellipsizeMode="clip"
numberOfLines={1}
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#3A2671",
"fontFamily": "Jost-Bold",
"fontSize": 64.28571428571428,
"marginRight": 8.571428571428571,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
2
</Text>
</View>
<View
style={
Object {
"flex": 5,
"flexDirection": "row",
}
}
>
<Text
ellipsizeMode="tail"
numberOfLines={2}
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#F38337",
"fontFamily": "Jost-Bold",
"fontSize": 27.857142857142858,
"margin": 15,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
completed cycles
</Text>
</View>
</View>,
]
`;
exports[`StatsOverview screen when provided empty data, renders nothing (does not break) 1`] = `null`;
@@ -1,433 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`StatsTable screen when provided correct data set, renders it 1`] = `
<View
style={
Object {
"alignSelf": "center",
"backgroundColor": "#E9F2ED",
"marginTop": 137.14285714285714,
"maxHeight": 933.8,
"minHeight": "40%",
"position": "absolute",
"width": "100%",
}
}
>
<View
style={
Object {
"flexDirection": "row",
"justifyContent": "flex-end",
"paddingRight": 34.285714285714285,
"paddingTop": 34.285714285714285,
}
}
>
<View
accessible={true}
collapsable={false}
focusable={true}
hitSlop={
Object {
"bottom": 39.23529411764706,
"left": 42.857142857142854,
"right": 42.857142857142854,
"top": 39.23529411764706,
}
}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignSelf": "flex-start",
"marginBottom": 34.285714285714285,
"opacity": 1,
}
}
>
<Text
allowFontScaling={false}
selectable={false}
style={
Array [
Object {
"color": undefined,
"fontSize": 12,
},
Array [
Object {
"fontSize": 47.14285714285714,
},
undefined,
Object {
"color": "#F38337",
},
],
Object {
"fontFamily": "Entypo",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
</View>
</View>
<RCTScrollView
ItemSeparatorComponent={[Function]}
ListHeaderComponent={[Function]}
ListHeaderComponentStyle={
Object {
"borderBottomColor": "#3A2671",
"borderBottomWidth": 2,
}
}
contentContainerStyle={
Object {
"paddingHorizontal": 34.285714285714285,
}
}
data={
Array [
Object {
"bleedingLength": 5,
"cycleLength": 31,
"date": "2022-07-01",
},
Object {
"bleedingLength": 5,
"cycleLength": 31,
"date": "2022-06-01",
},
]
}
getItem={[Function]}
getItemCount={[Function]}
keyExtractor={[Function]}
onContentSizeChange={[Function]}
onLayout={[Function]}
onMomentumScrollBegin={[Function]}
onMomentumScrollEnd={[Function]}
onScroll={[Function]}
onScrollBeginDrag={[Function]}
onScrollEndDrag={[Function]}
removeClippedSubviews={false}
renderItem={[Function]}
scrollEventThrottle={50}
stickyHeaderIndices={
Array [
0,
]
}
viewabilityConfigCallbackPairs={Array []}
>
<View>
<View
onLayout={[Function]}
style={
Object {
"borderBottomColor": "#3A2671",
"borderBottomWidth": 2,
}
}
>
<View
style={
Object {
"backgroundColor": "#E9F2ED",
"flexDirection": "row",
"justifyContent": "space-between",
"paddingVertical": 8.571428571428571,
}
}
>
<View
style={
Object {
"flex": 3,
"justifyContent": "center",
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#F38337",
"fontFamily": "Jost-Bold",
"fontSize": 27.857142857142858,
"paddingVertical": 21.428571428571427,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
cycle_start
</Text>
</View>
<View
style={
Object {
"flex": 2,
"justifyContent": "center",
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#F38337",
"fontFamily": "Jost-Bold",
"fontSize": 27.857142857142858,
"paddingVertical": 21.428571428571427,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
cycle_length
</Text>
</View>
<View
style={
Object {
"flex": 2,
"justifyContent": "center",
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
Object {
"color": "#F38337",
"fontFamily": "Jost-Bold",
"fontSize": 27.857142857142858,
"paddingVertical": 21.428571428571427,
"textAlignVertical": "center",
"textTransform": "uppercase",
},
]
}
>
bleeding
</Text>
</View>
</View>
</View>
<View
onLayout={[Function]}
style={null}
>
<View
style={
Object {
"backgroundColor": "#E9F2ED",
"flexDirection": "row",
"justifyContent": "space-between",
"paddingVertical": 8.571428571428571,
}
}
>
<View
style={
Object {
"flex": 3,
"justifyContent": "center",
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
01. Jul 22
</Text>
</View>
<View
style={
Object {
"flex": 2,
"justifyContent": "center",
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
day{"count":31}
</Text>
</View>
<View
style={
Object {
"flex": 2,
"justifyContent": "center",
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
day{"count":5}
</Text>
</View>
</View>
<View
style={
Object {
"backgroundColor": "#888",
"height": 1,
"width": "100%",
}
}
/>
</View>
<View
onLayout={[Function]}
style={null}
>
<View
style={
Object {
"backgroundColor": "#E9F2ED",
"flexDirection": "row",
"justifyContent": "space-between",
"paddingVertical": 8.571428571428571,
}
}
>
<View
style={
Object {
"flex": 3,
"justifyContent": "center",
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
01. Jun 22
</Text>
</View>
<View
style={
Object {
"flex": 2,
"justifyContent": "center",
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
day{"count":31}
</Text>
</View>
<View
style={
Object {
"flex": 2,
"justifyContent": "center",
}
}
>
<Text
style={
Array [
Object {
"color": "#555",
"fontFamily": "Jost-Book",
"fontSize": 34.285714285714285,
},
undefined,
]
}
>
day{"count":5}
</Text>
</View>
</View>
</View>
</View>
</RCTScrollView>
</View>
`;
exports[`StatsTable screen when provided no data, renders nothing 1`] = `null`;
exports[`StatsTable screen when provided null, renders nothing 1`] = `null`;
exports[`StatsTable screen when provided undefined, renders nothing 1`] = `null`;
-58
View File
@@ -1,58 +0,0 @@
import React from 'react'
import { fireEvent, render } from '@testing-library/react-native'
import Stats from '../../components/stats'
jest.mock('../../components/common/AppHelp', () => 'AppHelp')
jest.mock('../../components/common/StatsOverview', () => 'StatsOverview')
jest.mock('../../components/common/StatsTable', () => 'StatsTable')
const mockGetAllCycleLengths = jest
.fn()
.mockImplementationOnce(() => [])
.mockImplementationOnce(() => [30, 31, 30])
.mockImplementationOnce(() => null)
.mockImplementationOnce(() => undefined)
.mockImplementationOnce(() => [30, 31, 30])
jest.mock('../../lib/cycle', () => ({
__esModule: true,
default: () => ({
getAllCycleLengths: mockGetAllCycleLengths,
}),
}))
describe('Stats screen', () => {
test('when provided no data, renders no_data text', async () => {
const { toJSON } = render(<Stats />)
expect(toJSON()).toMatchSnapshot()
})
test('when provided data, renders stats', async () => {
const { toJSON } = render(<Stats />)
expect(toJSON()).toMatchSnapshot()
})
test('when provided null, renders no_data text', async () => {
const { toJSON } = render(<Stats />)
expect(toJSON()).toMatchSnapshot()
})
test('when provided undefined, renders no_data text', async () => {
const { toJSON } = render(<Stats />)
expect(toJSON()).toMatchSnapshot()
})
test('when button is clicked, StatsTable is rendered', async () => {
const { getByText, findByTestId } = render(<Stats />)
const button = getByText('show_stats')
fireEvent(button, 'click')
await expect(findByTestId('statsTable')).toBeTruthy()
})
})
-1
View File
@@ -1 +0,0 @@
module.exports = 123
-8
View File
@@ -1,8 +0,0 @@
// Import Jest Native matchers
import '@testing-library/jest-native/extend-expect'
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (str, options) => str + (options ? JSON.stringify(options) : ''),
}),
}))
+18 -115
View File
@@ -2658,7 +2658,7 @@ character-reference-invalid@^1.0.0:
resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560"
integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==
chownr@^1.1.1, chownr@^1.1.4:
chownr@^1.1.1:
version "1.1.4"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
@@ -3855,13 +3855,6 @@ fs-extra@^8.1.0:
jsonfile "^4.0.0"
universalify "^0.1.0"
fs-minipass@^1.2.7:
version "1.2.7"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7"
integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==
dependencies:
minipass "^2.6.0"
fs-minipass@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb"
@@ -4001,7 +3994,7 @@ glob-parent@^5.0.0:
dependencies:
is-glob "^4.0.1"
glob@^7.0.0, glob@^7.0.3, glob@^7.1.3, glob@^7.1.4:
glob@^7.0.0, glob@^7.1.3, glob@^7.1.4:
version "7.1.7"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
@@ -5303,6 +5296,11 @@ jsesc@~0.5.0:
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==
jshashes@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/jshashes/-/jshashes-1.0.8.tgz#f60d837428383abf73ab022e1542e6614bd75514"
integrity sha512-btmQZ/w1rj8Lb6nEwvhjM7nBYoj54yaEFo2PWh3RkxZ8qNwuvOxvQYN/JxVuwoMmdIluL+XwYVJ+pEEZoSYybQ==
json-parse-better-errors@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
@@ -5963,14 +5961,6 @@ minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
minipass@^2.6.0, minipass@^2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6"
integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==
dependencies:
safe-buffer "^5.1.2"
yallist "^3.0.0"
minipass@^3.0.0:
version "3.1.6"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee"
@@ -5978,13 +5968,6 @@ minipass@^3.0.0:
dependencies:
yallist "^4.0.0"
minizlib@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d"
integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==
dependencies:
minipass "^2.9.0"
minizlib@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931"
@@ -6006,7 +5989,7 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3:
resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113"
integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.5:
mkdirp@^0.5.1:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
@@ -6091,11 +6074,6 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
ncp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"
integrity sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==
negotiator@0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd"
@@ -6173,40 +6151,6 @@ node-stream-zip@^1.9.1:
resolved "https://registry.yarnpkg.com/node-stream-zip/-/node-stream-zip-1.15.0.tgz#158adb88ed8004c6c49a396b50a6a5de3bca33ea"
integrity sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==
nodejs-mobile-gyp@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/nodejs-mobile-gyp/-/nodejs-mobile-gyp-0.3.1.tgz#e37357cc74b70a15b57c1ec4bd1d0fdd6b80e1e6"
integrity sha512-AcS4xbeWjOIfLQ+xZp0m7zEhd263v33O54OeJz/ObzpqvN1LXoph7ceeTQVrmp1YL0zSoUxX3s8AinotR8OgVg==
dependencies:
glob "^7.0.3"
graceful-fs "^4.1.2"
mkdirp "^0.5.0"
nopt "2 || 3"
npmlog "0 || 1 || 2 || 3 || 4"
osenv "0"
request "^2.87.0"
rimraf "2"
semver "~5.3.0"
tar "^4.4.8"
which "1"
nodejs-mobile-react-native@^0.8.2:
version "0.8.2"
resolved "https://registry.yarnpkg.com/nodejs-mobile-react-native/-/nodejs-mobile-react-native-0.8.2.tgz#bf3d18602d970419967212fd9d4a4c28f9953a18"
integrity sha512-+W0cYzZdA8SANe0/gi84NyOxoPE7ttwJeGr7r9DZvwek3xhEUhpiUk6JdxgrvjTx+J+jPXBcXbsCuLElp+JxHw==
dependencies:
mkdirp "^0.5.1"
ncp "^2.0.0"
nodejs-mobile-gyp "^0.3.1"
xcode "^2.0.0"
"nopt@2 || 3":
version "3.0.6"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
integrity sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==
dependencies:
abbrev "1"
nopt@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88"
@@ -6240,7 +6184,7 @@ npm-run-path@^4.0.0, npm-run-path@^4.0.1:
dependencies:
path-key "^3.0.0"
"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.1:
npmlog@^4.0.1:
version "4.1.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
@@ -6445,24 +6389,11 @@ ora@^3.4.0:
strip-ansi "^5.2.0"
wcwidth "^1.0.1"
os-homedir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==
os-tmpdir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==
osenv@0:
version "0.1.5"
resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==
dependencies:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"
p-finally@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
@@ -7254,7 +7185,7 @@ replace-ext@1.0.0:
resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb"
integrity sha512-vuNYXC7gG7IeVNBC1xUllqCcZKRbJoSPOBhnTEcAIiKCsbuef6zO3F0Rve3isPMMoNoQRWjQwbAgAjHUHniyEA==
request@^2.87.0, request@^2.88.0:
request@^2.88.0:
version "2.88.2"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3"
integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==
@@ -7356,13 +7287,6 @@ ret@~0.1.10:
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
rimraf@2, rimraf@^2.5.4:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
dependencies:
glob "^7.1.3"
rimraf@2.6.3, rimraf@~2.6.2:
version "2.6.3"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
@@ -7370,6 +7294,13 @@ rimraf@2.6.3, rimraf@~2.6.2:
dependencies:
glob "^7.1.3"
rimraf@^2.5.4:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
dependencies:
glob "^7.1.3"
rimraf@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
@@ -7392,11 +7323,6 @@ safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, s
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
safe-buffer@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
safe-regex@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
@@ -7464,11 +7390,6 @@ semver@^7.2.1, semver@^7.3.5:
dependencies:
lru-cache "^6.0.0"
semver@~5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
integrity sha512-mfmm3/H9+67MCVix1h+IXTpDwL6710LyHuk7+cWC9T1mE0qz4iHhh6r4hU2wrIT9iTsAAC2XQRvfblL028cpLw==
send@0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be"
@@ -8038,19 +7959,6 @@ tar-stream@^2.1.4:
inherits "^2.0.3"
readable-stream "^3.1.1"
tar@^4.4.8:
version "4.4.19"
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3"
integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==
dependencies:
chownr "^1.1.4"
fs-minipass "^1.2.7"
minipass "^2.9.0"
minizlib "^1.3.3"
mkdirp "^0.5.5"
safe-buffer "^5.2.1"
yallist "^3.1.1"
tar@^6.0.1:
version "6.1.11"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
@@ -8595,7 +8503,7 @@ which-typed-array@^1.1.2:
has-tostringtag "^1.0.0"
is-typed-array "^1.1.9"
which@1, which@^1.2.9:
which@^1.2.9:
version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
@@ -8743,11 +8651,6 @@ yallist@^2.1.2:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==
yallist@^3.0.0, yallist@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"