Compare commits
83 Commits
chore/test
...
release
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f375530c8 | |||
| 5401789c46 | |||
| f6944328fb | |||
| f730b617cb | |||
| 668faf2534 | |||
| f304fee293 | |||
| 54b08c15bb | |||
| 6d51826dd6 | |||
| 5ff680a591 | |||
| 2cda2c38e9 | |||
| b638a5bd08 | |||
| 32cec10a79 | |||
| 2eca9ba097 | |||
| 573de7545e | |||
| d81dbac60c | |||
| 40fb65ca88 | |||
| ed7a5a341b | |||
| ca3cf16ff7 | |||
| fdbfef38f9 | |||
| 5c13e91fb3 | |||
| 2b235f4d10 | |||
| bcc7eaada9 | |||
| 714021465e | |||
| c3e4fd3f03 | |||
| e7f76bad33 | |||
| 9537e377e0 | |||
| f11eb3d1a1 | |||
| 5f83464649 | |||
| 6e2e03f39e | |||
| cc62e24229 | |||
| 1907a78dbf | |||
| cd24522b4d | |||
| 446638d6de | |||
| ae23ef2c58 | |||
| 38b9e8b31f | |||
| 84d657cabb | |||
| 4573b93921 | |||
| ab88a4c163 | |||
| baaf89c04e | |||
| d476f6c143 | |||
| b56e0818f3 | |||
| 1b5ffaf5d6 | |||
| f68cc2b49e | |||
| 27d430a465 | |||
| 28f52e2cea | |||
| 3f87f298fb | |||
| 585f32863d | |||
| 51e1c95e71 | |||
| 36c33c69b7 | |||
| 9dfe8b4b05 | |||
| b7d97f0589 | |||
| fd611db750 | |||
| 7b9293f7a2 | |||
| db1388c3c4 | |||
| 09d164b9fc | |||
| d78fbf74e3 | |||
| c9430439c5 | |||
| 08712f460e | |||
| 3447a0ea1e | |||
| b4d92d0d7b | |||
| d5f0e3532a | |||
| 8774d251de | |||
| 974d081f40 | |||
| 9f9eadfc46 | |||
| f5004f2d7a | |||
| afc177cb53 | |||
| 0ebadbc92a | |||
| 47b7021fa3 | |||
| c847270159 | |||
| d58c230eda | |||
| 0747ea8a5f | |||
| 0bba7afc6f | |||
| f957553026 | |||
| 0597540b88 | |||
| 75823ed750 | |||
| dd1c2cd96d | |||
| 06d346ee46 | |||
| d4bd576cc9 | |||
| 85b3a8b4b6 | |||
| 206d4b06fa | |||
| 2669738c9d | |||
| 1eadd1c5d6 | |||
| d6d333432c |
@@ -73,11 +73,6 @@ ios/Podfile.lock
|
|||||||
android/app/src/main/res/drawable-*
|
android/app/src/main/res/drawable-*
|
||||||
android/app/src/main/assets/*
|
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/*
|
.yarn/*
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ updates:
|
|||||||
- dependency-name: '*'
|
- dependency-name: '*'
|
||||||
update-types: ['version-update:semver-patch']
|
update-types: ['version-update:semver-patch']
|
||||||
- dependency-name: 'realm'
|
- dependency-name: 'realm'
|
||||||
- dependency-name: 'nodejs-mobile-react-native'
|
|
||||||
- dependency-name: 'react'
|
- dependency-name: 'react'
|
||||||
- dependency-name: 'react-native'
|
- dependency-name: 'react-native'
|
||||||
- dependency-name: 'react-native-push-notifications'
|
- dependency-name: 'react-native-push-notifications'
|
||||||
|
- dependency-name: '@babel/core'
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
## oh no a bug 🐛
|
||||||
|
|
||||||
|
### Description what has happened
|
||||||
|
|
||||||
|
Short overview how the bug manifests.
|
||||||
|
|
||||||
|
### which OS + version is your device
|
||||||
|
|
||||||
|
[ ] Android _number_
|
||||||
|
[ ] iOS _number_
|
||||||
|
|
||||||
|
### which drip version number are you using
|
||||||
|
|
||||||
|
_On your phone go to ➞ menu on the top right ➞ about, scroll to the very bottom and find the version number_
|
||||||
|
|
||||||
|
### how did it happen
|
||||||
|
|
||||||
|
_what triggered the bug/behavior, always/sometimes, is it reproducible(how)?_
|
||||||
|
|
||||||
|
### describe how it looks or add screenshot
|
||||||
|
|
||||||
|
feel free to attach a file 📎
|
||||||
|
|
||||||
|
### any idea to solve it
|
||||||
|
|
||||||
|
💡
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
## This has to be done 🪠
|
||||||
|
|
||||||
|
### Description what has to be done
|
||||||
|
|
||||||
|
Short overview
|
||||||
|
|
||||||
|
### is it urgent? ⏳
|
||||||
|
|
||||||
|
[ ] Yes
|
||||||
|
[ ] No
|
||||||
|
[ ] something in between
|
||||||
|
|
||||||
|
_Explain the urgency if possible, e.g. is it a security vulnerability for potentially everyone?_
|
||||||
|
|
||||||
|
### which OS
|
||||||
|
|
||||||
|
[ ] Android
|
||||||
|
[ ] iOS
|
||||||
|
|
||||||
|
### what shall be the ideal outcome 🎆
|
||||||
|
|
||||||
|
_You can e.g. specify here the version number for a library update_
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
## Yeah a feature idea 🧩
|
||||||
|
|
||||||
|
### what should this feature do or solve? 🪄
|
||||||
|
|
||||||
|
Please give a short overview so as many people as possible would be able to understand.
|
||||||
|
|
||||||
|
### what is particularly important to the people who would use this feature?
|
||||||
|
|
||||||
|
Do you have certain user groups in mind?
|
||||||
|
|
||||||
|
### Any idea where it shall be placed in the app?
|
||||||
|
|
||||||
|
### is it connected with or dependent on some other feature?
|
||||||
|
|
||||||
|
### any idea how it shall look (sketch?)
|
||||||
|
|
||||||
|
feel free to attach a file 📎
|
||||||
|
|
||||||
|
### what could be difficulties (with other components) 🪆
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
## Why this change?
|
## Why this change?
|
||||||
|
|
||||||
Closes ticket #
|
Closes #
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
|
|||||||
+70
-2
@@ -2,12 +2,80 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## v1.2311.14
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
- Make the app compatible with Android 13
|
||||||
|
- Update Android's targetSdkVersion to 33
|
||||||
|
- Update buildToolsVersion to 33.0.2
|
||||||
|
- Update Android Gradle plugin to 7.0.3
|
||||||
|
- Update Gradle to 7.3.3
|
||||||
|
- Update kotlinVersion to 1.3.40
|
||||||
|
- Chart: Improved readability
|
||||||
|
- Finer temperature lines and dots
|
||||||
|
- Enlarge screen space for temperature chart
|
||||||
|
- A very light grey background color for weekend days on the whole chart screen
|
||||||
|
- Reminders:
|
||||||
|
- Use new fork of react-native-push-notification: <https://github.com/github:bl00dymarie/react-native-push-notification> without google services
|
||||||
|
- Adding channels after breaking changes in react-native-push-notification
|
||||||
|
- Homescreen: date displayed in new format
|
||||||
|
- Minor changes in "about" section
|
||||||
|
- Updated dependencies:
|
||||||
|
- moment ^2.29.4,
|
||||||
|
- prop-types ^15.8.1,
|
||||||
|
- react v17.0.2,
|
||||||
|
- react-native v0.67.4,
|
||||||
|
- react-native-calendars ^1.1287.0,
|
||||||
|
- react-native-document-picker ^8.1.1,
|
||||||
|
- react-native-fs ^2.20.0,
|
||||||
|
- react-native-modal-datetime-picker v14.0.0,
|
||||||
|
- react-native-share ^7.9.0,
|
||||||
|
- react-native-vector-icons ^9.2.0,
|
||||||
|
- realm ^10.16.0,
|
||||||
|
- sympto v3.0.1
|
||||||
|
|
||||||
|
### Adds
|
||||||
|
|
||||||
|
- Stats: Show period details, including cycle start, cycle length and amount of days with bleeding
|
||||||
|
- Stats: Explainer text for standard deviation
|
||||||
|
- Settings: Privacy Policy
|
||||||
|
- App asks for permissions for notifications right at the start, which allows you to set reminders (this is a new requirement for Android 13)
|
||||||
|
- Buttons can now be displayed as row
|
||||||
|
|
||||||
|
- Added dependencies:
|
||||||
|
- @js-joda/core ^5.3.0,
|
||||||
|
- @react-native-async-storage/async-storage ^1.17.9,
|
||||||
|
- @react-native-community/art ^1.2.0,
|
||||||
|
- @react-native-community/datetimepicker ^6.3.1,
|
||||||
|
- @react-native-community/push-notification-ios ^1.11.0,
|
||||||
|
- i18next ^22.0.2,
|
||||||
|
- react-i18next ^12.0.0,
|
||||||
|
- jshashes ^1.0.8,
|
||||||
|
- react-native-permissions ^3.10.0,
|
||||||
|
- react-native-push-notification: github:bl00dymarie/react-native-push-notification,
|
||||||
|
- react-native-simple-toast ^1.1.3,
|
||||||
|
- react-native-size-matters ^0.4.0,
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Password: Disable setting empty passwords
|
||||||
|
- After updating the password the app will do a full restart
|
||||||
|
- Chart: Grid for symptoms
|
||||||
|
- Chart: Horizontal lines in temperature chart
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
- Partially implemented translations with react-i18next
|
||||||
|
|
||||||
## v1.2102.28
|
## v1.2102.28
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|
||||||
- Temperature range is now between 35 - 39°C and its default values are now set to 35.5 - 37.5°C
|
- Temperature range is now between 35 - 39°C and its default values are now set to 35.5 - 37.5°C
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Blocks invalid input of temperature value
|
- Blocks invalid input of temperature value
|
||||||
- Error message for incorrect password on login screen
|
- Error message for incorrect password on login screen
|
||||||
- Phase text on home screen for last fertile day
|
- Phase text on home screen for last fertile day
|
||||||
@@ -61,7 +129,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
### Adds
|
### Adds
|
||||||
|
|
||||||
- Allows chart not to show temperature part, when temperature is not tracked and corresponding refactoring
|
- Allows chart not to show temperature part, when temperature is not tracked and corresponding refactoring
|
||||||
- Detox support for e2e testing and addition of the e2e tests
|
- Detox support for e2e testing and addition of the e2e tests
|
||||||
- Introduces Redux global state (date and navigation are stored locally now)
|
- Introduces Redux global state (date and navigation are stored locally now)
|
||||||
- Introduces clear.sh script to the project automising clearing project caches and packages reinstallation
|
- Introduces clear.sh script to the project automising clearing project caches and packages reinstallation
|
||||||
|
|
||||||
@@ -80,7 +148,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
- Fixed adding notes to the future dates
|
- Fixed adding notes to the future dates
|
||||||
- Fixed app exiting with error when hitting back button on device
|
- Fixed app exiting with error when hitting back button on device
|
||||||
- Fixed Sex symptom showing on y axis of chart even though the contraception method was deleted
|
- Fixed Sex symptom showing on y axis of chart even though the contraception method was deleted
|
||||||
- Fixed of the clear.sh file name in package.json
|
- Fixed of the clear.sh file name in package.json
|
||||||
- Fixed of navigation from chart to the cycle day overview
|
- Fixed of navigation from chart to the cycle day overview
|
||||||
- Bug fix for maximum value of mucus not showing on chart
|
- Bug fix for maximum value of mucus not showing on chart
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ Install [Android Studio](https://developer.android.com/studio/) - you'll need it
|
|||||||
|
|
||||||
### 3.2 More requirements from Android Studio
|
### 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.3 Run the app on Android
|
||||||
|
|
||||||
@@ -201,7 +201,3 @@ More information about how the app calculates fertility status and bleeding pred
|
|||||||
react-native link
|
react-native link
|
||||||
|
|
||||||
5. You should be able to use the icon now within drip, e.g. in Cycle Day Overview and on the chart.
|
5. You should be able to use the icon now within drip, e.g. in Cycle Day Overview and on the chart.
|
||||||
|
|
||||||
## Translation
|
|
||||||
|
|
||||||
We are using [Weblate](https://weblate.org/) as translation software.
|
|
||||||
|
|||||||
@@ -134,10 +134,10 @@ android {
|
|||||||
applicationId "com.drip"
|
applicationId "com.drip"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 8
|
versionCode 25
|
||||||
versionName "1.2102.28"
|
versionName "1.2311.14"
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "x86", "arm64-v8a"
|
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
|
||||||
}
|
}
|
||||||
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
|
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
|
||||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||||
@@ -198,7 +198,7 @@ android {
|
|||||||
// For each separate APK per architecture, set a unique version code as described here:
|
// For each separate APK per architecture, set a unique version code as described here:
|
||||||
// https://developer.android.com/studio/build/configure-apk-splits.html
|
// https://developer.android.com/studio/build/configure-apk-splits.html
|
||||||
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
|
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
|
||||||
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
|
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
|
||||||
def abi = output.getFilter(OutputFile.ABI)
|
def abi = output.getFilter(OutputFile.ABI)
|
||||||
if (abi != null) { // null for the universal-debug, universal-release variants
|
if (abi != null) { // null for the universal-debug, universal-release variants
|
||||||
output.versionCodeOverride =
|
output.versionCodeOverride =
|
||||||
@@ -211,11 +211,12 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||||
//noinspection GradleDynamicVersion
|
//noinspection GradleDynamicVersion
|
||||||
implementation 'androidx.appcompat:appcompat:1.0.0'
|
implementation "androidx.appcompat:appcompat:1.0.0"
|
||||||
implementation 'androidx.annotation:annotation:1.1.0'
|
implementation "androidx.annotation:annotation:1.1.0"
|
||||||
|
implementation "androidx.work:work-runtime-ktx:2.7.1"
|
||||||
implementation "com.facebook.react:react-native:+" // From node_modules
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
||||||
|
|
||||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
|
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
|
||||||
|
|
||||||
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
|
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
|
||||||
exclude group:'com.facebook.fbjni'
|
exclude group:'com.facebook.fbjni'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,74 +5,81 @@
|
|||||||
>
|
>
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
|
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
||||||
|
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
|
||||||
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<uses-permission tools:node="remove" android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission tools:node="remove" android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission tools:node="remove" android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission tools:node="remove" android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
|
||||||
|
|
||||||
<permission
|
<permission
|
||||||
android:name="${applicationId}.permission.C2D_MESSAGE"
|
android:name="${applicationId}.permission.C2D_MESSAGE"
|
||||||
android:protectionLevel="signature" />
|
android:protectionLevel="signature" />
|
||||||
|
|
||||||
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
|
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
|
||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".MainApplication"
|
android:name=".MainApplication"
|
||||||
android:label="@string/app_name"
|
|
||||||
android:icon="@mipmap/ic_launcher"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
|
||||||
android:allowBackup="false"
|
|
||||||
android:theme="@style/AppTheme">
|
|
||||||
<activity
|
|
||||||
android:name=".MainActivity"
|
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:launchMode="singleTask"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:windowSoftInputMode="adjustResize"
|
android:allowBackup="false"
|
||||||
android:screenOrientation="sensorPortrait">
|
android:theme="@style/AppTheme">
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<meta-data
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
android:name="com.dieam.reactnativepushnotification.notification_foreground"
|
||||||
</intent-filter>
|
android:value="false" />
|
||||||
</activity>
|
<meta-data
|
||||||
<provider
|
android:name="com.dieam.reactnativepushnotification.notification_color"
|
||||||
|
android:resource="@color/purple" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.dieam.reactnativepushnotification.default_notification_channel_id"
|
||||||
|
android:value="..." />
|
||||||
|
|
||||||
|
<receiver
|
||||||
|
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions"
|
||||||
|
android:exported="false"
|
||||||
|
tools:ignore="MissingClass" />
|
||||||
|
<receiver
|
||||||
|
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher"
|
||||||
|
android:exported="false" />
|
||||||
|
<receiver
|
||||||
|
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver"
|
||||||
|
android:exported="false" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
|
||||||
|
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
android:screenOrientation="sensorPortrait">
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="com.drip.provider"
|
android:authorities="com.drip.provider"
|
||||||
android:grantUriPermissions="true"
|
android:grantUriPermissions="true"
|
||||||
android:exported="false">
|
android:exported="false" >
|
||||||
<meta-data
|
<meta-data
|
||||||
tools:replace="android:resource"
|
tools:replace="android:resource"
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
android:resource="@xml/filepaths" />
|
android:resource="@xml/filepaths" />
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground"
|
|
||||||
android:value="false"/>
|
|
||||||
<!-- Change the resource name to your App's accent color - or any other color you want -->
|
|
||||||
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
|
|
||||||
android:resource="@android:color/white"/> <!-- or @android:color/{name} to use a standard color -->
|
|
||||||
|
|
||||||
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" />
|
|
||||||
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
|
|
||||||
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
|
||||||
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
|
|
||||||
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
<service
|
|
||||||
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
|
|
||||||
android:exported="false" >
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
|
||||||
</intent-filter>
|
|
||||||
</service>
|
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -14,4 +14,5 @@
|
|||||||
<color name="grey">#A5A5A5</color>
|
<color name="grey">#A5A5A5</color>
|
||||||
<color name="orange">#F38337</color>
|
<color name="orange">#F38337</color>
|
||||||
<color name="purple">#3A2671</color>
|
<color name="purple">#3A2671</color>
|
||||||
|
<color name="turquoiseDark">#69CBC1</color>
|
||||||
</resources>
|
</resources>
|
||||||
+8
-11
@@ -5,13 +5,13 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
ext.kotlinVersion = "1.3.10"
|
ext.kotlinVersion = '1.3.40'
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:4.2.2")
|
classpath('com.android.tools.build:gradle:7.0.3')
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,12 +46,9 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
googlePlayServicesVersion = "+" // default: "+"
|
buildToolsVersion = "33.0.2"
|
||||||
firebaseMessagingVersion = "21.1.0" // default: "+"
|
minSdkVersion = 21
|
||||||
|
compileSdkVersion = 33
|
||||||
buildToolsVersion = "30.0.2"
|
targetSdkVersion = 33
|
||||||
minSdkVersion = 23
|
ndkVersion = "21.4.7075529"
|
||||||
compileSdkVersion = 30
|
|
||||||
targetSdkVersion = 30
|
|
||||||
ndkVersion = "21.4.7075529"
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -1,5 +1,6 @@
|
|||||||
|
#Wed Oct 11 14:45:21 CEST 2023
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
+3
-28
@@ -4,7 +4,9 @@ import PropTypes from 'prop-types'
|
|||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
|
||||||
import AppText from './common/app-text'
|
import AppText from './common/app-text'
|
||||||
|
import Asterisk from './common/Asterisk'
|
||||||
import Button from './common/button'
|
import Button from './common/button'
|
||||||
|
import Footnote from './common/Footnote'
|
||||||
|
|
||||||
import cycleModule from '../lib/cycle'
|
import cycleModule from '../lib/cycle'
|
||||||
import { getFertilityStatusForDay } from '../lib/sympto-adapter'
|
import { getFertilityStatusForDay } from '../lib/sympto-adapter'
|
||||||
@@ -69,26 +71,12 @@ const Home = ({ navigate, setDate }) => {
|
|||||||
<Button isCTA isSmall={false} onPress={navigateToCycleDayView}>
|
<Button isCTA isSmall={false} onPress={navigateToCycleDayView}>
|
||||||
{t('labels.home.addDataForToday')}
|
{t('labels.home.addDataForToday')}
|
||||||
</Button>
|
</Button>
|
||||||
{phase && (
|
{phase && <Footnote colorLabel="greyLight">{statusText}</Footnote>}
|
||||||
<View style={styles.asteriskLine}>
|
|
||||||
<Asterisk />
|
|
||||||
<AppText linkStyle={styles.whiteText} style={styles.greyText}>
|
|
||||||
{statusText}
|
|
||||||
</AppText>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const Asterisk = () => {
|
|
||||||
return <AppText style={styles.asterisk}>*</AppText>
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
asterisk: {
|
|
||||||
color: Colors.orange,
|
|
||||||
},
|
|
||||||
container: {
|
container: {
|
||||||
backgroundColor: Colors.purple,
|
backgroundColor: Colors.purple,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@@ -104,12 +92,6 @@ const styles = StyleSheet.create({
|
|||||||
marginBottom: Spacing.tiny,
|
marginBottom: Spacing.tiny,
|
||||||
marginTop: Spacing.small,
|
marginTop: Spacing.small,
|
||||||
},
|
},
|
||||||
asteriskLine: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
alignContent: 'flex-start',
|
|
||||||
marginBottom: Spacing.tiny,
|
|
||||||
marginTop: Spacing.small,
|
|
||||||
},
|
|
||||||
title: {
|
title: {
|
||||||
color: Colors.purpleLight,
|
color: Colors.purpleLight,
|
||||||
fontFamily: Fonts.bold,
|
fontFamily: Fonts.bold,
|
||||||
@@ -124,13 +106,6 @@ const styles = StyleSheet.create({
|
|||||||
color: 'white',
|
color: 'white',
|
||||||
fontSize: Sizes.subtitle,
|
fontSize: Sizes.subtitle,
|
||||||
},
|
},
|
||||||
whiteText: {
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
greyText: {
|
|
||||||
color: Colors.greyLight,
|
|
||||||
paddingLeft: Spacing.base,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
Home.propTypes = {
|
Home.propTypes = {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import nodejs from 'nodejs-mobile-react-native'
|
|
||||||
|
|
||||||
import { getLicenseFlag, saveEncryptionFlag } from '../local-storage'
|
import { getLicenseFlag, saveEncryptionFlag } from '../local-storage'
|
||||||
import { openDb } from '../db'
|
import { openDb } from '../db'
|
||||||
@@ -28,7 +27,6 @@ export default function AppWrapper() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
nodejs.start('main.js')
|
|
||||||
checkIsLicenseAccepted()
|
checkIsLicenseAccepted()
|
||||||
checkIsDbEncrypted()
|
checkIsDbEncrypted()
|
||||||
}, [])
|
}, [])
|
||||||
|
|||||||
@@ -6,16 +6,17 @@ import AppText from '../common/app-text'
|
|||||||
import CloseIcon from '../common/close-icon'
|
import CloseIcon from '../common/close-icon'
|
||||||
|
|
||||||
import { Containers, Spacing } from '../../styles'
|
import { Containers, Spacing } from '../../styles'
|
||||||
import { chart } from '../../i18n/en/labels'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const image = require('../../assets/swipe.png')
|
const image = require('../../assets/swipe.png')
|
||||||
|
|
||||||
const Tutorial = ({ onClose }) => {
|
const Tutorial = ({ onClose }) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Image resizeMode="contain" source={image} style={styles.image} />
|
<Image resizeMode="contain" source={image} style={styles.image} />
|
||||||
<View style={styles.textContainer}>
|
<View style={styles.textContainer}>
|
||||||
<AppText>{chart.tutorial}</AppText>
|
<AppText>{t('chart.tutorial')}</AppText>
|
||||||
</View>
|
</View>
|
||||||
<CloseIcon onClose={onClose} />
|
<CloseIcon onClose={onClose} />
|
||||||
</View>
|
</View>
|
||||||
@@ -4,15 +4,19 @@ import { StyleSheet, View } from 'react-native'
|
|||||||
|
|
||||||
import AppText from '../common/app-text'
|
import AppText from '../common/app-text'
|
||||||
|
|
||||||
import { Typography } from '../../styles'
|
import { Sizes, Typography } from '../../styles'
|
||||||
import { CHART_YAXIS_WIDTH } from '../../config'
|
import { CHART_YAXIS_WIDTH } from '../../config'
|
||||||
import { shared as labels } from '../../i18n/en/labels'
|
import { shared as labels } from '../../i18n/en/labels'
|
||||||
|
|
||||||
const ChartLegend = ({ height }) => {
|
const ChartLegend = ({ height }) => {
|
||||||
return (
|
return (
|
||||||
<View style={[styles.container, { height }]}>
|
<View style={[styles.container, { height }]}>
|
||||||
<AppText style={styles.textBold}>#</AppText>
|
<View style={[styles.singleLabelContainer, { height: height / 2 }]}>
|
||||||
<AppText style={styles.text}>{labels.date}</AppText>
|
<AppText style={styles.textBold}>#</AppText>
|
||||||
|
</View>
|
||||||
|
<View style={[styles.singleLabelContainer, { height: height / 2 }]}>
|
||||||
|
<AppText style={styles.text}>{labels.date}</AppText>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -27,8 +31,13 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
width: CHART_YAXIS_WIDTH,
|
width: CHART_YAXIS_WIDTH,
|
||||||
},
|
},
|
||||||
|
singleLabelContainer: {
|
||||||
|
justifyContent: 'space-around',
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
text: {
|
text: {
|
||||||
...Typography.label,
|
...Typography.label,
|
||||||
|
fontSize: Sizes.footnote,
|
||||||
},
|
},
|
||||||
textBold: {
|
textBold: {
|
||||||
...Typography.labelBold,
|
...Typography.labelBold,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import HorizontalGrid from './horizontal-grid'
|
|||||||
import MainGrid from './main-grid'
|
import MainGrid from './main-grid'
|
||||||
import NoData from './no-data'
|
import NoData from './no-data'
|
||||||
import NoTemperature from './no-temperature'
|
import NoTemperature from './no-temperature'
|
||||||
import Tutorial from './tutorial'
|
import Tutorial from './Tutorial'
|
||||||
import YAxis from './y-axis'
|
import YAxis from './y-axis'
|
||||||
|
|
||||||
import { getCycleDaysSortedByDate } from '../../db'
|
import { getCycleDaysSortedByDate } from '../../db'
|
||||||
@@ -29,11 +29,23 @@ const getSymptomsFromCycleDays = (cycleDays) =>
|
|||||||
SYMPTOMS.filter((symptom) => cycleDays.some((cycleDay) => cycleDay[symptom]))
|
SYMPTOMS.filter((symptom) => cycleDays.some((cycleDay) => cycleDay[symptom]))
|
||||||
|
|
||||||
const CycleChart = ({ navigate, setDate }) => {
|
const CycleChart = ({ navigate, setDate }) => {
|
||||||
const [shouldShowHint, setShouldShowHint] = useState(true)
|
const [shouldShowHint, setShouldShowHint] = useState(false)
|
||||||
|
|
||||||
useEffect(async () => {
|
useEffect(() => {
|
||||||
const flag = await getChartFlag()
|
let isMounted = true
|
||||||
setShouldShowHint(flag === 'true')
|
|
||||||
|
async function checkShouldShowHint() {
|
||||||
|
const flag = await getChartFlag()
|
||||||
|
if (isMounted) {
|
||||||
|
setShouldShowHint(flag === 'true')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
checkShouldShowHint()
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
isMounted = false
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const hideHint = () => {
|
const hideHint = () => {
|
||||||
|
|||||||
@@ -19,11 +19,20 @@ const CycleDayLabel = ({ height, date }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[styles.container, { height }]}>
|
<View style={[styles.container, { height }]}>
|
||||||
<AppText style={styles.textBold}>{cycleDayLabel}</AppText>
|
<View style={{ ...styles.labelRow, height: height / 2 }}>
|
||||||
<View style={styles.dateLabel}>
|
<AppText style={styles.textBold}>{cycleDayLabel}</AppText>
|
||||||
<AppText style={styles.text}>
|
</View>
|
||||||
{isFirstDayOfMonth ? momentDate.format('MMM') : dayOfMonth}
|
|
||||||
</AppText>
|
<View style={{ ...styles.labelRow, height: height / 2 }}>
|
||||||
|
{isFirstDayOfMonth && (
|
||||||
|
<AppText style={styles.textFootnote}>
|
||||||
|
{momentDate.format('MMM')}
|
||||||
|
</AppText>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!isFirstDayOfMonth && (
|
||||||
|
<AppText style={styles.textSmall}>{dayOfMonth}</AppText>
|
||||||
|
)}
|
||||||
{!isFirstDayOfMonth && (
|
{!isFirstDayOfMonth && (
|
||||||
<AppText style={styles.textLight}>
|
<AppText style={styles.textLight}>
|
||||||
{getOrdinalSuffix(dayOfMonth)}
|
{getOrdinalSuffix(dayOfMonth)}
|
||||||
@@ -45,17 +54,21 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
left: 4,
|
left: 4,
|
||||||
},
|
},
|
||||||
text: {
|
textSmall: {
|
||||||
...Typography.label,
|
...Typography.label,
|
||||||
fontSize: Sizes.small,
|
fontSize: Sizes.small,
|
||||||
},
|
},
|
||||||
|
textFootnote: {
|
||||||
|
...Typography.label,
|
||||||
|
fontSize: Sizes.footnote,
|
||||||
|
},
|
||||||
textBold: {
|
textBold: {
|
||||||
...Typography.labelBold,
|
...Typography.labelBold,
|
||||||
},
|
},
|
||||||
textLight: {
|
textLight: {
|
||||||
...Typography.labelLight,
|
...Typography.labelLight,
|
||||||
},
|
},
|
||||||
dateLabel: {
|
labelRow: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-around',
|
justifyContent: 'space-around',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { TouchableOpacity } from 'react-native'
|
import { TouchableOpacity } from 'react-native'
|
||||||
|
import moment from 'moment'
|
||||||
|
|
||||||
import { getCycleDay } from '../../db'
|
import { getCycleDay } from '../../db'
|
||||||
|
|
||||||
@@ -26,6 +27,8 @@ const DayColumn = ({
|
|||||||
symptomRowSymptoms,
|
symptomRowSymptoms,
|
||||||
xAxisHeight,
|
xAxisHeight,
|
||||||
}) => {
|
}) => {
|
||||||
|
const momentDate = moment(dateString)
|
||||||
|
const isWeekend = momentDate.day() == 0 || momentDate.day() == 6
|
||||||
const cycleDayData = getCycleDay(dateString)
|
const cycleDayData = getCycleDay(dateString)
|
||||||
let data = {}
|
let data = {}
|
||||||
|
|
||||||
@@ -73,6 +76,7 @@ const DayColumn = ({
|
|||||||
isVerticalLine={fhmAndLtl.drawFhmLine}
|
isVerticalLine={fhmAndLtl.drawFhmLine}
|
||||||
data={data && data.temperature}
|
data={data && data.temperature}
|
||||||
columnHeight={columnHeight}
|
columnHeight={columnHeight}
|
||||||
|
isWeekend={isWeekend}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -92,6 +96,7 @@ const DayColumn = ({
|
|||||||
isSymptomDataComplete={
|
isSymptomDataComplete={
|
||||||
hasSymptomData && isSymptomDataComplete(symptom, dateString)
|
hasSymptomData && isSymptomDataComplete(symptom, dateString)
|
||||||
}
|
}
|
||||||
|
isWeekend={isWeekend}
|
||||||
height={symptomHeight}
|
height={symptomHeight}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import { Colors } from '../../styles'
|
|||||||
import {
|
import {
|
||||||
CHART_COLUMN_WIDTH,
|
CHART_COLUMN_WIDTH,
|
||||||
CHART_COLUMN_MIDDLE,
|
CHART_COLUMN_MIDDLE,
|
||||||
CHART_DOT_RADIUS,
|
CHART_DOT_RADIUS_SYMPTOM,
|
||||||
|
CHART_DOT_RADIUS_TEMPERATURE,
|
||||||
CHART_STROKE_WIDTH,
|
CHART_STROKE_WIDTH,
|
||||||
} from '../../config'
|
} from '../../config'
|
||||||
|
|
||||||
@@ -35,9 +36,9 @@ const DotAndLine = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const dot = new Path()
|
const dot = new Path()
|
||||||
.moveTo(CHART_COLUMN_MIDDLE, y - CHART_DOT_RADIUS)
|
.moveTo(CHART_COLUMN_MIDDLE, y - CHART_DOT_RADIUS_TEMPERATURE)
|
||||||
.arc(0, CHART_DOT_RADIUS * 2, CHART_DOT_RADIUS)
|
.arc(0, CHART_DOT_RADIUS_TEMPERATURE * 2, CHART_DOT_RADIUS_TEMPERATURE)
|
||||||
.arc(0, CHART_DOT_RADIUS * -2, CHART_DOT_RADIUS)
|
.arc(0, CHART_DOT_RADIUS_TEMPERATURE * -2, CHART_DOT_RADIUS_TEMPERATURE)
|
||||||
const dotColor = exclude ? Colors.turquoise : Colors.turquoiseDark
|
const dotColor = exclude ? Colors.turquoise : Colors.turquoiseDark
|
||||||
const lineColorLeft = excludeLeftLine
|
const lineColorLeft = excludeLeftLine
|
||||||
? Colors.turquoise
|
? Colors.turquoise
|
||||||
@@ -58,13 +59,13 @@ const DotAndLine = ({
|
|||||||
d={lineRight}
|
d={lineRight}
|
||||||
stroke={lineColorRight}
|
stroke={lineColorRight}
|
||||||
strokeWidth={CHART_STROKE_WIDTH}
|
strokeWidth={CHART_STROKE_WIDTH}
|
||||||
key={y + CHART_DOT_RADIUS}
|
key={y + CHART_DOT_RADIUS_SYMPTOM}
|
||||||
/>
|
/>
|
||||||
<Shape
|
<Shape
|
||||||
d={dot}
|
d={dot}
|
||||||
stroke={dotColor}
|
stroke={dotColor}
|
||||||
strokeWidth={CHART_STROKE_WIDTH}
|
strokeWidth={CHART_STROKE_WIDTH}
|
||||||
fill="white"
|
fill={Colors.turquoiseDark}
|
||||||
key="dot"
|
key="dot"
|
||||||
/>
|
/>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { StyleSheet, View } from 'react-native'
|
|||||||
import { Colors, Containers } from '../../styles'
|
import { Colors, Containers } from '../../styles'
|
||||||
import {
|
import {
|
||||||
CHART_COLUMN_WIDTH,
|
CHART_COLUMN_WIDTH,
|
||||||
CHART_DOT_RADIUS,
|
CHART_DOT_RADIUS_SYMPTOM,
|
||||||
CHART_GRID_LINE_HORIZONTAL_WIDTH,
|
CHART_GRID_LINE_HORIZONTAL_WIDTH,
|
||||||
} from '../../config'
|
} from '../../config'
|
||||||
|
|
||||||
@@ -15,14 +15,31 @@ const SymptomCell = ({
|
|||||||
symptom,
|
symptom,
|
||||||
symptomValue,
|
symptomValue,
|
||||||
isSymptomDataComplete,
|
isSymptomDataComplete,
|
||||||
|
isWeekend,
|
||||||
}) => {
|
}) => {
|
||||||
const shouldDrawDot = symptomValue !== false
|
const shouldDrawDot = symptomValue !== false
|
||||||
|
// Determine the background color based on isWeekend prop
|
||||||
|
const backgroundColor = isWeekend ? Colors.greyVeryLight : 'white'
|
||||||
const styleCell =
|
const styleCell =
|
||||||
index !== 0
|
index !== 0
|
||||||
? [styles.cell, { height, width: CHART_COLUMN_WIDTH }]
|
? [
|
||||||
: [styles.cell, { height, width: CHART_COLUMN_WIDTH }, styles.topBorder]
|
styles.cell,
|
||||||
|
{
|
||||||
|
height,
|
||||||
|
width: CHART_COLUMN_WIDTH,
|
||||||
|
backgroundColor: backgroundColor,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
styles.cell,
|
||||||
|
{
|
||||||
|
height,
|
||||||
|
width: CHART_COLUMN_WIDTH,
|
||||||
|
backgroundColor: backgroundColor,
|
||||||
|
},
|
||||||
|
styles.topBorder,
|
||||||
|
]
|
||||||
let styleDot
|
let styleDot
|
||||||
|
|
||||||
if (shouldDrawDot) {
|
if (shouldDrawDot) {
|
||||||
const styleSymptom = Colors.iconColors[symptom]
|
const styleSymptom = Colors.iconColors[symptom]
|
||||||
const symptomColor = styleSymptom.shades[symptomValue]
|
const symptomColor = styleSymptom.shades[symptomValue]
|
||||||
@@ -47,11 +64,11 @@ SymptomCell.propTypes = {
|
|||||||
symptom: PropTypes.string,
|
symptom: PropTypes.string,
|
||||||
symptomValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
|
symptomValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
|
||||||
isSymptomDataComplete: PropTypes.bool,
|
isSymptomDataComplete: PropTypes.bool,
|
||||||
|
isWeekend: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
cell: {
|
cell: {
|
||||||
backgroundColor: 'white',
|
|
||||||
borderBottomColor: Colors.grey,
|
borderBottomColor: Colors.grey,
|
||||||
borderBottomWidth: CHART_GRID_LINE_HORIZONTAL_WIDTH,
|
borderBottomWidth: CHART_GRID_LINE_HORIZONTAL_WIDTH,
|
||||||
borderLeftColor: Colors.grey,
|
borderLeftColor: Colors.grey,
|
||||||
@@ -63,8 +80,8 @@ const styles = StyleSheet.create({
|
|||||||
borderTopWidth: CHART_GRID_LINE_HORIZONTAL_WIDTH,
|
borderTopWidth: CHART_GRID_LINE_HORIZONTAL_WIDTH,
|
||||||
},
|
},
|
||||||
dot: {
|
dot: {
|
||||||
width: CHART_DOT_RADIUS * 2,
|
width: CHART_DOT_RADIUS_SYMPTOM * 2,
|
||||||
height: CHART_DOT_RADIUS * 2,
|
height: CHART_DOT_RADIUS_SYMPTOM * 2,
|
||||||
borderRadius: 50,
|
borderRadius: 50,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { StyleSheet } from 'react-native'
|
import { Colors } from '../../styles'
|
||||||
|
|
||||||
import { Surface, Path } from '@react-native-community/art'
|
import { Surface, Path } from '@react-native-community/art'
|
||||||
|
|
||||||
@@ -14,14 +14,16 @@ const TemperatureColumn = ({
|
|||||||
isVerticalLine,
|
isVerticalLine,
|
||||||
data,
|
data,
|
||||||
columnHeight,
|
columnHeight,
|
||||||
|
isWeekend,
|
||||||
}) => {
|
}) => {
|
||||||
const x = CHART_STROKE_WIDTH / 2
|
const x = CHART_STROKE_WIDTH / 2
|
||||||
|
|
||||||
|
const backgroundColor = isWeekend ? Colors.greyVeryLight : 'white'
|
||||||
return (
|
return (
|
||||||
<Surface
|
<Surface
|
||||||
width={CHART_COLUMN_WIDTH}
|
width={CHART_COLUMN_WIDTH}
|
||||||
height={columnHeight}
|
height={columnHeight}
|
||||||
style={styles.container}
|
style={{ backgroundColor: backgroundColor }}
|
||||||
>
|
>
|
||||||
<ChartLine path={new Path().lineTo(0, columnHeight)} />
|
<ChartLine path={new Path().lineTo(0, columnHeight)} />
|
||||||
|
|
||||||
@@ -63,12 +65,7 @@ TemperatureColumn.propTypes = {
|
|||||||
isVerticalLine: PropTypes.bool,
|
isVerticalLine: PropTypes.bool,
|
||||||
data: PropTypes.object,
|
data: PropTypes.object,
|
||||||
columnHeight: PropTypes.number,
|
columnHeight: PropTypes.number,
|
||||||
|
isWeekend: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
backgroundColor: 'white',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export default TemperatureColumn
|
export default TemperatureColumn
|
||||||
|
|||||||
@@ -8,13 +8,15 @@ import { Sizes } from '../../styles'
|
|||||||
import { CHART_TICK_WIDTH } from '../../config'
|
import { CHART_TICK_WIDTH } from '../../config'
|
||||||
|
|
||||||
const Tick = ({ yPosition, height, isBold, shouldShowLabel, label }) => {
|
const Tick = ({ yPosition, height, isBold, shouldShowLabel, label }) => {
|
||||||
const top = yPosition - height / 2
|
const top = yPosition - height / 2 - 4
|
||||||
const containerStyle = [styles.container, { flexBasis: height, height, top }]
|
const containerStyle = [styles.container, { flexBasis: height, height, top }]
|
||||||
const textStyle = isBold ? styles.textBold : styles.textNormal
|
const textStyle = isBold ? styles.textBold : styles.textNormal
|
||||||
|
|
||||||
|
if (!shouldShowLabel) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={containerStyle}>
|
<View style={containerStyle}>
|
||||||
<AppText style={textStyle}>{shouldShowLabel && label}</AppText>
|
<AppText style={textStyle}>{label}</AppText>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -36,6 +38,7 @@ const styles = StyleSheet.create({
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: 0,
|
right: 0,
|
||||||
width: CHART_TICK_WIDTH,
|
width: CHART_TICK_WIDTH,
|
||||||
|
minHeight: Sizes.base + 2,
|
||||||
},
|
},
|
||||||
textBold: {
|
textBold: {
|
||||||
fontSize: Sizes.base,
|
fontSize: Sizes.base,
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
import { StyleSheet, Text, Linking } from 'react-native'
|
||||||
|
|
||||||
|
import { Colors, Typography } from '../../styles'
|
||||||
|
|
||||||
|
const AppLink = ({ children, url, ...props }) => {
|
||||||
|
return (
|
||||||
|
<Text style={styles.link} {...props} onPress={() => Linking.openURL(url)}>
|
||||||
|
{children}
|
||||||
|
</Text>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
AppLink.propTypes = {
|
||||||
|
children: PropTypes.node,
|
||||||
|
url: PropTypes.string,
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
link: {
|
||||||
|
...Typography.mainText,
|
||||||
|
color: Colors.purple,
|
||||||
|
textDecorationLine: 'underline',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export default AppLink
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -1,20 +1,33 @@
|
|||||||
import React from 'react'
|
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'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
const AppModal = ({ children, onClose }) => {
|
import CloseIcon from './close-icon'
|
||||||
return (
|
|
||||||
<Modal
|
import { Sizes, Spacing } from '../../styles'
|
||||||
animationType="fade"
|
|
||||||
onRequestClose={onClose}
|
const AppModal = ({ children, onClose }) => (
|
||||||
transparent={true}
|
<Modal
|
||||||
visible={true}
|
animationType="fade"
|
||||||
>
|
onRequestClose={onClose}
|
||||||
<TouchableOpacity onPress={onClose} style={styles.blackBackground} />
|
transparent={true}
|
||||||
|
visible={true}
|
||||||
|
>
|
||||||
|
<TouchableOpacity onPress={onClose} style={styles.blackBackground} />
|
||||||
|
<View style={styles.modalWindow}>
|
||||||
|
<View style={styles.headerContainer}>
|
||||||
|
<CloseIcon onClose={onClose} />
|
||||||
|
</View>
|
||||||
{children}
|
{children}
|
||||||
</Modal>
|
</View>
|
||||||
)
|
</Modal>
|
||||||
}
|
)
|
||||||
|
|
||||||
AppModal.propTypes = {
|
AppModal.propTypes = {
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
@@ -27,6 +40,28 @@ const styles = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
opacity: 0.5,
|
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
|
export default AppModal
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { ScrollView, StyleSheet, View } from 'react-native'
|
|||||||
|
|
||||||
import AppText from '../common/app-text'
|
import AppText from '../common/app-text'
|
||||||
|
|
||||||
import { Colors, Typography } from '../../styles'
|
import { Colors, Containers, Typography } from '../../styles'
|
||||||
|
|
||||||
const AppPage = ({
|
const AppPage = ({
|
||||||
children,
|
children,
|
||||||
@@ -35,10 +35,7 @@ AppPage.propTypes = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: { ...Containers.pageContainer },
|
||||||
backgroundColor: Colors.turquoiseLight,
|
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
scrollView: {
|
scrollView: {
|
||||||
backgroundColor: Colors.turquoiseLight,
|
backgroundColor: Colors.turquoiseLight,
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
|
|||||||
@@ -1,30 +1,15 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { KeyboardAvoidingView, StyleSheet, TextInput } from 'react-native'
|
import { StyleSheet, TextInput } from 'react-native'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import { Colors, Spacing, Typography } from '../../styles'
|
import { Colors, Spacing, Typography } from '../../styles'
|
||||||
|
|
||||||
const AppTextInput = ({ style, isKeyboardOffset, ...props }) => {
|
const AppTextInput = ({ style, ...props }) => (
|
||||||
const behavior = isKeyboardOffset ? 'padding' : 'height'
|
<TextInput style={[styles.input, style]} {...props} />
|
||||||
const keyboardVerticalOffset = isKeyboardOffset ? 300 : 0
|
)
|
||||||
|
|
||||||
return (
|
|
||||||
<KeyboardAvoidingView
|
|
||||||
behavior={behavior}
|
|
||||||
keyboardVerticalOffset={keyboardVerticalOffset}
|
|
||||||
>
|
|
||||||
<TextInput style={[styles.input, style]} {...props} />
|
|
||||||
</KeyboardAvoidingView>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
AppTextInput.propTypes = {
|
AppTextInput.propTypes = {
|
||||||
style: PropTypes.object,
|
style: PropTypes.object,
|
||||||
isKeyboardOffset: PropTypes.bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
AppTextInput.defultProps = {
|
|
||||||
isKeyboardOffset: true,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
|||||||
@@ -2,24 +2,18 @@ import React from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { StyleSheet, Text } from 'react-native'
|
import { StyleSheet, Text } from 'react-native'
|
||||||
|
|
||||||
import Link from './link'
|
|
||||||
|
|
||||||
import { Colors, Typography } from '../../styles'
|
import { Colors, Typography } from '../../styles'
|
||||||
|
|
||||||
const AppText = ({ children, linkStyle, style, ...props }) => {
|
const AppText = ({ children, style, ...props }) => {
|
||||||
// we parse for links in case the text contains any
|
|
||||||
return (
|
return (
|
||||||
<Link style={linkStyle}>
|
<Text style={[styles.text, style]} {...props}>
|
||||||
<Text style={[styles.text, style]} {...props}>
|
{children}
|
||||||
{children}
|
</Text>
|
||||||
</Text>
|
|
||||||
</Link>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
AppText.propTypes = {
|
AppText.propTypes = {
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
linkStyle: PropTypes.object,
|
|
||||||
style: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
|
style: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import Hyperlink from 'react-native-hyperlink'
|
|
||||||
import { StyleSheet } from 'react-native'
|
|
||||||
|
|
||||||
import { Colors, Typography } from '../../styles'
|
|
||||||
|
|
||||||
import links from '../../i18n/en/links'
|
|
||||||
|
|
||||||
const Link = ({ children, style }) => {
|
|
||||||
return (
|
|
||||||
<Hyperlink
|
|
||||||
linkStyle={[styles.link, style]}
|
|
||||||
linkText={replaceUrlWithText}
|
|
||||||
linkDefault
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Hyperlink>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Link.propTypes = {
|
|
||||||
children: PropTypes.node,
|
|
||||||
style: PropTypes.object,
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
link: {
|
|
||||||
color: Colors.purple,
|
|
||||||
textDecorationLine: 'underline',
|
|
||||||
...Typography.mainText,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
function replaceUrlWithText(url) {
|
|
||||||
const link = Object.values(links).find((l) => l.url === url)
|
|
||||||
return (link && link.text) || url
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Link
|
|
||||||
@@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native'
|
|||||||
|
|
||||||
import AppText from './app-text'
|
import AppText from './app-text'
|
||||||
|
|
||||||
import { Colors, Spacing, Typography } from '../../styles'
|
import { Colors, Containers, Spacing, Typography } from '../../styles'
|
||||||
|
|
||||||
const Segment = ({ children, last, title }) => {
|
const Segment = ({ children, last, title }) => {
|
||||||
const containerStyle = last ? styles.containerLast : styles.container
|
const containerStyle = last ? styles.containerLast : styles.container
|
||||||
@@ -25,21 +25,16 @@ Segment.propTypes = {
|
|||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
const segmentContainer = {
|
|
||||||
marginHorizontal: Spacing.base,
|
|
||||||
marginBottom: Spacing.base,
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
borderStyle: 'solid',
|
borderStyle: 'solid',
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: Colors.greyLight,
|
borderBottomColor: Colors.greyLight,
|
||||||
paddingBottom: Spacing.base,
|
paddingBottom: Spacing.base,
|
||||||
...segmentContainer,
|
...Containers.segmentContainer,
|
||||||
},
|
},
|
||||||
containerLast: {
|
containerLast: {
|
||||||
...segmentContainer,
|
...Containers.segmentContainer,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
...Typography.subtitle,
|
...Typography.subtitle,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import SymptomEditView from './symptom-edit-view'
|
|||||||
import { isDateInFuture } from '../helpers/cycle-day'
|
import { isDateInFuture } from '../helpers/cycle-day'
|
||||||
|
|
||||||
import { Colors, Sizes, Spacing } from '../../styles'
|
import { Colors, Sizes, Spacing } from '../../styles'
|
||||||
import { headerTitles as symptomTitles } from '../../i18n/en/labels'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const SymptomBox = ({
|
const SymptomBox = ({
|
||||||
date,
|
date,
|
||||||
@@ -20,6 +20,7 @@ const SymptomBox = ({
|
|||||||
editedSymptom,
|
editedSymptom,
|
||||||
setEditedSymptom,
|
setEditedSymptom,
|
||||||
}) => {
|
}) => {
|
||||||
|
const { t } = useTranslation(null, { keyPrefix: 'cycleDay.symptomBox' })
|
||||||
const isSymptomEdited = editedSymptom === symptom
|
const isSymptomEdited = editedSymptom === symptom
|
||||||
const isSymptomDisabled = isDateInFuture(date) && symptom !== 'note'
|
const isSymptomDisabled = isDateInFuture(date) && symptom !== 'note'
|
||||||
const isExcluded = symptomData !== null ? symptomData.exclude : false
|
const isExcluded = symptomData !== null ? symptomData.exclude : false
|
||||||
@@ -61,9 +62,7 @@ const SymptomBox = ({
|
|||||||
size={Sizes.icon}
|
size={Sizes.icon}
|
||||||
/>
|
/>
|
||||||
<View style={styles.textContainer}>
|
<View style={styles.textContainer}>
|
||||||
<AppText style={symptomNameStyle}>
|
<AppText style={symptomNameStyle}>{t(symptom)}</AppText>
|
||||||
{symptomTitles[symptom].toLowerCase()}
|
|
||||||
</AppText>
|
|
||||||
{symptomDataToDisplay && (
|
{symptomDataToDisplay && (
|
||||||
<AppText style={textStyle} numberOfLines={4}>
|
<AppText style={textStyle} numberOfLines={4}>
|
||||||
{symptomDataToDisplay}
|
{symptomDataToDisplay}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
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 AppModal from '../common/app-modal'
|
||||||
import AppSwitch from '../common/app-switch'
|
import AppSwitch from '../common/app-switch'
|
||||||
import AppText from '../common/app-text'
|
import AppText from '../common/app-text'
|
||||||
import AppTextInput from '../common/app-text-input'
|
import AppTextInput from '../common/app-text-input'
|
||||||
import Button from '../common/button'
|
import Button from '../common/button'
|
||||||
import CloseIcon from '../common/close-icon'
|
|
||||||
import Segment from '../common/segment'
|
import Segment from '../common/segment'
|
||||||
import SelectBoxGroup from './select-box-group'
|
import SelectBoxGroup from './select-box-group'
|
||||||
import SelectTabGroup from './select-tab-group'
|
import SelectTabGroup from './select-tab-group'
|
||||||
@@ -109,103 +108,104 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
|
|||||||
}
|
}
|
||||||
const iconName = shouldShowInfo ? 'chevron-up' : 'chevron-down'
|
const iconName = shouldShowInfo ? 'chevron-up' : 'chevron-down'
|
||||||
const noteText = symptom === 'note' ? data.value : data.note
|
const noteText = symptom === 'note' ? data.value : data.note
|
||||||
|
const inputProps = {
|
||||||
|
multiline: true,
|
||||||
|
numberOfLines: 3,
|
||||||
|
scrollEnabled: false,
|
||||||
|
style: styles.input,
|
||||||
|
textAlignVertical: 'top',
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppModal onClose={onSave}>
|
<AppModal onClose={onSave}>
|
||||||
<View style={styles.modalWindow}>
|
<ScrollView
|
||||||
<View style={styles.headerContainer}>
|
contentContainerStyle={styles.modalContainer}
|
||||||
<CloseIcon onClose={onSave} />
|
keyboardDismissMode="on-drag"
|
||||||
</View>
|
>
|
||||||
<ScrollView
|
{symptom === 'temperature' && (
|
||||||
contentContainerStyle={styles.modalContainer}
|
<Temperature
|
||||||
keyboardDismissMode="on-drag"
|
date={date}
|
||||||
>
|
data={data}
|
||||||
{symptom === 'temperature' && (
|
save={(value, field) => onSaveTemperature(value, field)}
|
||||||
<Temperature
|
/>
|
||||||
date={date}
|
)}
|
||||||
data={data}
|
{shouldShow(symptomConfig.selectTabGroups) &&
|
||||||
save={(value, field) => onSaveTemperature(value, field)}
|
symtomPage[symptom].selectTabGroups.map((group) => {
|
||||||
/>
|
return (
|
||||||
)}
|
<Segment key={group.key} style={styles.segmentBorder}>
|
||||||
{shouldShow(symptomConfig.selectTabGroups) &&
|
<AppText style={styles.title}>{group.title}</AppText>
|
||||||
symtomPage[symptom].selectTabGroups.map((group) => {
|
<SelectTabGroup
|
||||||
return (
|
activeButton={data[group.key]}
|
||||||
<Segment key={group.key} style={styles.segmentBorder}>
|
buttons={group.options}
|
||||||
<AppText style={styles.title}>{group.title}</AppText>
|
onSelect={(value) => onSelectTab(group, value)}
|
||||||
<SelectTabGroup
|
/>
|
||||||
activeButton={data[group.key]}
|
</Segment>
|
||||||
buttons={group.options}
|
)
|
||||||
onSelect={(value) => onSelectTab(group, value)}
|
})}
|
||||||
/>
|
{shouldShow(symptomConfig.selectBoxGroups) &&
|
||||||
</Segment>
|
symtomPage[symptom].selectBoxGroups.map((group) => {
|
||||||
)
|
const isOtherSelected =
|
||||||
})}
|
data['other'] !== null &&
|
||||||
{shouldShow(symptomConfig.selectBoxGroups) &&
|
data['other'] !== false &&
|
||||||
symtomPage[symptom].selectBoxGroups.map((group) => {
|
Object.keys(group.options).includes('other')
|
||||||
const isOtherSelected =
|
|
||||||
data['other'] !== null &&
|
|
||||||
data['other'] !== false &&
|
|
||||||
Object.keys(group.options).includes('other')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Segment key={group.key} style={styles.segmentBorder}>
|
<Segment key={group.key} style={styles.segmentBorder}>
|
||||||
<AppText style={styles.title}>{group.title}</AppText>
|
<AppText style={styles.title}>{group.title}</AppText>
|
||||||
<SelectBoxGroup
|
<SelectBoxGroup
|
||||||
labels={group.options}
|
labels={group.options}
|
||||||
onSelect={(value) => onSelectBox(value)}
|
onSelect={(value) => onSelectBox(value)}
|
||||||
optionsState={data}
|
optionsState={data}
|
||||||
|
/>
|
||||||
|
{isOtherSelected && (
|
||||||
|
<AppTextInput
|
||||||
|
{...inputProps}
|
||||||
|
placeholder={sharedLabels.enter}
|
||||||
|
value={data.note}
|
||||||
|
onChangeText={(value) => onSelectBoxNote(value)}
|
||||||
/>
|
/>
|
||||||
{isOtherSelected && (
|
)}
|
||||||
<AppTextInput
|
</Segment>
|
||||||
multiline={true}
|
)
|
||||||
placeholder={sharedLabels.enter}
|
})}
|
||||||
value={data.note}
|
{shouldShow(symptomConfig.excludeText) && (
|
||||||
onChangeText={(value) => onSelectBoxNote(value)}
|
<Segment style={styles.segmentBorder}>
|
||||||
/>
|
<AppSwitch
|
||||||
)}
|
onToggle={onExcludeToggle}
|
||||||
</Segment>
|
text={symtomPage[symptom].excludeText}
|
||||||
)
|
value={data.exclude}
|
||||||
})}
|
/>
|
||||||
{shouldShow(symptomConfig.excludeText) && (
|
</Segment>
|
||||||
<Segment style={styles.segmentBorder}>
|
)}
|
||||||
<AppSwitch
|
{shouldShow(symptomConfig.note) && (
|
||||||
onToggle={onExcludeToggle}
|
<Segment style={styles.segmentBorder}>
|
||||||
text={symtomPage[symptom].excludeText}
|
<AppText>{symtomPage[symptom].note}</AppText>
|
||||||
value={data.exclude}
|
<AppTextInput
|
||||||
/>
|
{...inputProps}
|
||||||
</Segment>
|
onChangeText={onEditNote}
|
||||||
)}
|
placeholder={sharedLabels.enter}
|
||||||
{shouldShow(symptomConfig.note) && (
|
testID="noteInput"
|
||||||
<Segment style={styles.segmentBorder}>
|
value={noteText !== null ? noteText : ''}
|
||||||
<AppText>{symtomPage[symptom].note}</AppText>
|
/>
|
||||||
<AppTextInput
|
</Segment>
|
||||||
multiline={true}
|
)}
|
||||||
numberOfLines={3}
|
<View style={styles.buttonsContainer}>
|
||||||
onChangeText={onEditNote}
|
<Button iconName={iconName} isSmall onPress={onPressLearnMore}>
|
||||||
placeholder={sharedLabels.enter}
|
{sharedLabels.learnMore}
|
||||||
testID="noteInput"
|
</Button>
|
||||||
value={noteText !== null ? noteText : ''}
|
<Button isSmall onPress={onRemove}>
|
||||||
/>
|
{sharedLabels.remove}
|
||||||
</Segment>
|
</Button>
|
||||||
)}
|
<Button isCTA isSmall onPress={onSave}>
|
||||||
<View style={styles.buttonsContainer}>
|
{sharedLabels.save}
|
||||||
<Button iconName={iconName} isSmall onPress={onPressLearnMore}>
|
</Button>
|
||||||
{sharedLabels.learnMore}
|
</View>
|
||||||
</Button>
|
{shouldShowInfo && (
|
||||||
<Button isSmall onPress={onRemove}>
|
<Segment last style={styles.segmentBorder}>
|
||||||
{sharedLabels.remove}
|
<AppText>{info[symptom].text}</AppText>
|
||||||
</Button>
|
</Segment>
|
||||||
<Button isCTA isSmall onPress={onSave}>
|
)}
|
||||||
{sharedLabels.save}
|
</ScrollView>
|
||||||
</Button>
|
|
||||||
</View>
|
|
||||||
{shouldShowInfo && (
|
|
||||||
<Segment last style={styles.segmentBorder}>
|
|
||||||
<AppText>{info[symptom].text}</AppText>
|
|
||||||
</Segment>
|
|
||||||
)}
|
|
||||||
</ScrollView>
|
|
||||||
</View>
|
|
||||||
</AppModal>
|
</AppModal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -223,29 +223,12 @@ const styles = StyleSheet.create({
|
|||||||
paddingHorizontal: Spacing.base,
|
paddingHorizontal: Spacing.base,
|
||||||
paddingBottom: Spacing.base,
|
paddingBottom: Spacing.base,
|
||||||
},
|
},
|
||||||
headerContainer: {
|
input: {
|
||||||
flexDirection: 'row',
|
height: Sizes.base * 5,
|
||||||
justifyContent: 'flex-end',
|
|
||||||
paddingTop: Spacing.base,
|
|
||||||
paddingHorizontal: Spacing.base,
|
|
||||||
position: 'absolute',
|
|
||||||
width: '100%',
|
|
||||||
zIndex: 3, // works on ios
|
|
||||||
elevation: 3, // works on android
|
|
||||||
},
|
},
|
||||||
modalContainer: {
|
modalContainer: {
|
||||||
paddingHorizontal: Spacing.base,
|
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: {
|
segmentBorder: {
|
||||||
borderBottomColor: Colors.greyLight,
|
borderBottomColor: Colors.greyLight,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,28 +7,28 @@ import {
|
|||||||
View,
|
View,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
import AppText from '../common/app-text'
|
||||||
|
|
||||||
import AppIcon from '../common/app-icon'
|
import AppIcon from '../common/app-icon'
|
||||||
import CloseIcon from '../common/close-icon'
|
import CloseIcon from '../common/close-icon'
|
||||||
import MenuItem from './menu-item'
|
|
||||||
|
|
||||||
import { Colors, Sizes } from '../../styles'
|
import { Colors, Sizes, Typography } from '../../styles'
|
||||||
import settingsLabels from '../../i18n/en/settings'
|
|
||||||
import { HIT_SLOP } from '../../config'
|
import { HIT_SLOP } from '../../config'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
const { menuItems } = settingsLabels
|
|
||||||
|
|
||||||
const settingsMenuItems = [
|
const settingsMenuItems = [
|
||||||
{ name: menuItems.settings, component: 'SettingsMenu' },
|
{ labelKey: 'settings', componentName: 'SettingsMenu' },
|
||||||
{ name: menuItems.about, component: 'About' },
|
{ labelKey: 'about', componentName: 'About' },
|
||||||
{ name: menuItems.license, component: 'License' },
|
{ labelKey: 'license', componentName: 'License' },
|
||||||
{ name: menuItems.privacyPolicy, component: 'PrivacyPolicy' },
|
{ labelKey: 'privacyPolicy', componentName: 'PrivacyPolicy' },
|
||||||
]
|
]
|
||||||
|
|
||||||
const HamburgerMenu = ({ navigate }) => {
|
const HamburgerMenu = ({ navigate }) => {
|
||||||
const [isOpen, setIsOpen] = useState(false)
|
const [isOpen, setIsOpen] = useState(false)
|
||||||
const closeMenu = () => setIsOpen(false)
|
const closeMenu = () => setIsOpen(false)
|
||||||
|
|
||||||
|
const { t } = useTranslation(null, { keyPrefix: 'hamburgerMenu.menuMain' })
|
||||||
|
|
||||||
if (!isOpen)
|
if (!isOpen)
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={() => setIsOpen(true)} hitSlop={HIT_SLOP}>
|
<TouchableOpacity onPress={() => setIsOpen(true)} hitSlop={HIT_SLOP}>
|
||||||
@@ -36,23 +36,25 @@ const HamburgerMenu = ({ navigate }) => {
|
|||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
function onPress(componentName) {
|
||||||
|
closeMenu()
|
||||||
|
navigate(componentName)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal animationType="fade" onRequestClose={closeMenu} transparent={true}>
|
<Modal animationType="fade" onRequestClose={closeMenu} transparent>
|
||||||
<TouchableOpacity
|
<TouchableOpacity onPress={closeMenu} style={styles.blackBackground} />
|
||||||
onPress={closeMenu}
|
|
||||||
style={styles.blackBackground}
|
|
||||||
></TouchableOpacity>
|
|
||||||
<View style={styles.menu}>
|
<View style={styles.menu}>
|
||||||
<View style={styles.iconContainer}>
|
<View style={styles.iconContainer}>
|
||||||
<CloseIcon color={'black'} onClose={closeMenu} />
|
<CloseIcon color={'black'} onClose={closeMenu} />
|
||||||
</View>
|
</View>
|
||||||
{settingsMenuItems.map((item) => (
|
{settingsMenuItems.map(({ labelKey, componentName }) => (
|
||||||
<MenuItem
|
<TouchableOpacity
|
||||||
item={item}
|
onPress={() => onPress(componentName)}
|
||||||
key={item.name}
|
key={labelKey}
|
||||||
closeMenu={closeMenu}
|
>
|
||||||
navigate={navigate}
|
<AppText style={styles.menuItem}>{t(labelKey)}</AppText>
|
||||||
/>
|
</TouchableOpacity>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
</Modal>
|
</Modal>
|
||||||
@@ -84,4 +86,5 @@ const styles = StyleSheet.create({
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
width: '60%',
|
width: '60%',
|
||||||
},
|
},
|
||||||
|
menuItem: Typography.subtitle,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -22,3 +22,18 @@ export function dateToTitle(dateString) {
|
|||||||
? labels.today
|
? labels.today
|
||||||
: moment(dateString).format('ddd DD. MMM YY')
|
: moment(dateString).format('ddd DD. MMM YY')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function humanizeDate(dateString) {
|
||||||
|
if (!dateString) return ''
|
||||||
|
|
||||||
|
const today = LocalDate.now()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const dateToDisplay = LocalDate.parse(dateString)
|
||||||
|
return today.equals(dateToDisplay)
|
||||||
|
? labels.today
|
||||||
|
: moment(dateString).format('DD. MMM YY')
|
||||||
|
} catch (e) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,20 +6,23 @@ import MenuItem from './menu-item'
|
|||||||
|
|
||||||
import { Containers } from '../../styles'
|
import { Containers } from '../../styles'
|
||||||
import { pages } from '../pages'
|
import { pages } from '../pages'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const Menu = ({ currentPage, navigate }) => {
|
const Menu = ({ currentPage, navigate }) => {
|
||||||
const menuItems = pages.filter((page) => page.isInMenu)
|
const menuItems = pages.filter((page) => page.isInMenu)
|
||||||
|
|
||||||
|
const { t } = useTranslation(null, { keyPrefix: 'bottomMenu' })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
{menuItems.map(({ icon, label, component }) => {
|
{menuItems.map(({ icon, labelKey, component }) => {
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
isActive={component === currentPage}
|
isActive={component === currentPage}
|
||||||
onPress={() => navigate(component)}
|
onPress={() => navigate(component)}
|
||||||
icon={icon}
|
icon={icon}
|
||||||
key={label}
|
key={labelKey}
|
||||||
label={label}
|
label={t(labelKey)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
+3
-15
@@ -1,75 +1,63 @@
|
|||||||
import settingsViews from './settings'
|
import settingsViews from './settings'
|
||||||
|
|
||||||
import settingsLabels from '../i18n/en/settings'
|
|
||||||
const labels = settingsLabels.menuItems
|
|
||||||
|
|
||||||
export const pages = [
|
export const pages = [
|
||||||
{
|
{
|
||||||
component: 'Home',
|
component: 'Home',
|
||||||
icon: 'home',
|
icon: 'home',
|
||||||
label: 'Home',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Calendar',
|
component: 'Calendar',
|
||||||
icon: 'calendar',
|
icon: 'calendar',
|
||||||
isInMenu: true,
|
isInMenu: true,
|
||||||
label: 'Calendar',
|
labelKey: 'calendar',
|
||||||
parent: 'Home',
|
parent: 'Home',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Chart',
|
component: 'Chart',
|
||||||
icon: 'chart',
|
icon: 'chart',
|
||||||
isInMenu: true,
|
isInMenu: true,
|
||||||
label: 'Chart',
|
labelKey: 'chart',
|
||||||
parent: 'Home',
|
parent: 'Home',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Stats',
|
component: 'Stats',
|
||||||
icon: 'statistics',
|
icon: 'statistics',
|
||||||
isInMenu: true,
|
isInMenu: true,
|
||||||
label: 'Stats',
|
labelKey: 'stats',
|
||||||
parent: 'Home',
|
parent: 'Home',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
children: Object.keys(settingsViews),
|
children: Object.keys(settingsViews),
|
||||||
component: 'SettingsMenu',
|
component: 'SettingsMenu',
|
||||||
icon: 'settings',
|
icon: 'settings',
|
||||||
label: 'Settings',
|
|
||||||
parent: 'Home',
|
parent: 'Home',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Reminders',
|
component: 'Reminders',
|
||||||
label: labels.reminders.name,
|
|
||||||
parent: 'SettingsMenu',
|
parent: 'SettingsMenu',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'NfpSettings',
|
component: 'NfpSettings',
|
||||||
label: labels.nfpSettings.name,
|
|
||||||
parent: 'SettingsMenu',
|
parent: 'SettingsMenu',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'DataManagement',
|
component: 'DataManagement',
|
||||||
label: labels.dataManagement.name,
|
|
||||||
parent: 'SettingsMenu',
|
parent: 'SettingsMenu',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Password',
|
component: 'Password',
|
||||||
label: labels.password.name,
|
|
||||||
parent: 'SettingsMenu',
|
parent: 'SettingsMenu',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'About',
|
component: 'About',
|
||||||
label: 'About',
|
|
||||||
parent: 'SettingsMenu',
|
parent: 'SettingsMenu',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'License',
|
component: 'License',
|
||||||
label: 'License',
|
|
||||||
parent: 'SettingsMenu',
|
parent: 'SettingsMenu',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'PrivacyPolicy',
|
component: 'PrivacyPolicy',
|
||||||
label: 'PrivacyPolicy',
|
|
||||||
parent: 'SettingsMenu',
|
parent: 'SettingsMenu',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Alert, StyleSheet, View } from 'react-native'
|
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 AppPage from './common/app-page'
|
||||||
import AppTextInput from './common/app-text-input'
|
import AppTextInput from './common/app-text-input'
|
||||||
@@ -9,7 +9,7 @@ import Button from './common/button'
|
|||||||
import Header from './header'
|
import Header from './header'
|
||||||
|
|
||||||
import { saveEncryptionFlag } from '../local-storage'
|
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 { passwordPrompt as labels, shared } from '../i18n/en/labels'
|
||||||
import { Containers, Spacing } from '../styles'
|
import { Containers, Spacing } from '../styles'
|
||||||
|
|
||||||
@@ -17,9 +17,10 @@ const cancelButton = { text: shared.cancel, style: 'cancel' }
|
|||||||
|
|
||||||
const PasswordPrompt = ({ enableShowApp }) => {
|
const PasswordPrompt = ({ enableShowApp }) => {
|
||||||
const [password, setPassword] = useState(null)
|
const [password, setPassword] = useState(null)
|
||||||
const unlockApp = () => requestHash('check-pw', password)
|
|
||||||
const isPasswordEntered = Boolean(password)
|
const isPasswordEntered = Boolean(password)
|
||||||
const passHashToDb = async (hash) => {
|
|
||||||
|
const unlockApp = async () => {
|
||||||
|
const hash = new SHA512().hex(password)
|
||||||
const connected = await openDb(hash)
|
const connected = await openDb(hash)
|
||||||
|
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
@@ -31,16 +32,9 @@ const PasswordPrompt = ({ enableShowApp }) => {
|
|||||||
])
|
])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
enableShowApp()
|
enableShowApp()
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const listener = nodejs.channel.addListener('check-pw', passHashToDb, this)
|
|
||||||
|
|
||||||
return () => listener.remove()
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const onDeleteDataConfirmation = async () => {
|
const onDeleteDataConfirmation = async () => {
|
||||||
await deleteDbAndOpenNew()
|
await deleteDbAndOpenNew()
|
||||||
await saveEncryptionFlag(false)
|
await saveEncryptionFlag(false)
|
||||||
@@ -68,22 +62,23 @@ const PasswordPrompt = ({ enableShowApp }) => {
|
|||||||
<>
|
<>
|
||||||
<Header isStatic />
|
<Header isStatic />
|
||||||
<AppPage contentContainerStyle={styles.contentContainer}>
|
<AppPage contentContainerStyle={styles.contentContainer}>
|
||||||
<AppTextInput
|
<KeyboardAvoidingView behavior="padding" keyboardVerticalOffset={150}>
|
||||||
isKeyboardOffset={false}
|
<AppTextInput
|
||||||
onChangeText={setPassword}
|
onChangeText={setPassword}
|
||||||
secureTextEntry={true}
|
secureTextEntry={true}
|
||||||
placeholder={labels.enterPassword}
|
placeholder={labels.enterPassword}
|
||||||
/>
|
/>
|
||||||
<View style={styles.containerButtons}>
|
<View style={styles.containerButtons}>
|
||||||
<Button onPress={onConfirmDeletion}>{labels.forgotPassword}</Button>
|
<Button onPress={onConfirmDeletion}>{labels.forgotPassword}</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={!isPasswordEntered}
|
disabled={!isPasswordEntered}
|
||||||
isCTA={isPasswordEntered}
|
isCTA={isPasswordEntered}
|
||||||
onPress={unlockApp}
|
onPress={unlockApp}
|
||||||
>
|
>
|
||||||
{labels.title}
|
{labels.title}
|
||||||
</Button>
|
</Button>
|
||||||
</View>
|
</View>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
</AppPage>
|
</AppPage>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { Platform, Linking } from 'react-native'
|
|||||||
|
|
||||||
import AppPage from '../common/app-page'
|
import AppPage from '../common/app-page'
|
||||||
import AppText from '../common/app-text'
|
import AppText from '../common/app-text'
|
||||||
|
import AppLink from '../common/AppLink'
|
||||||
import Segment from '../common/segment'
|
import Segment from '../common/segment'
|
||||||
import Button from '../common/button'
|
import Button from '../common/button'
|
||||||
import ButtonRow from '../common/button-row'
|
import ButtonRow from '../common/button-row'
|
||||||
@@ -11,7 +12,7 @@ import links from '../../i18n/en/links'
|
|||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const AboutSection = () => {
|
const AboutSection = () => {
|
||||||
const { t } = useTranslation(null, { keyPrefix: 'settings.about' })
|
const { t } = useTranslation(null, { keyPrefix: 'hamburgerMenu.about' })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppPage title={t('title')}>
|
<AppPage title={t('title')}>
|
||||||
@@ -35,13 +36,15 @@ const AboutSection = () => {
|
|||||||
</Segment>
|
</Segment>
|
||||||
<Segment title={t('credits.title')}>
|
<Segment title={t('credits.title')}>
|
||||||
<AppText>
|
<AppText>
|
||||||
{t('credits.text', {
|
{t('credits.text')}{' '}
|
||||||
smashicons: links.smashicons.url,
|
<AppLink url={links.flaticon.url}>flaticon</AppLink>.{' '}
|
||||||
pause08: links.pause08.url,
|
</AppText>
|
||||||
kazachek: links.kazachek.url,
|
<AppText>
|
||||||
freepik: links.freepik.url,
|
{t('credits.madeBy')}{' '}
|
||||||
flaticon: links.flaticon.url,
|
<AppLink url={links.smashicons.url}>smashicons</AppLink>,{' '}
|
||||||
})}
|
<AppLink url={links.pause08.url}>pause08</AppLink>,{' '}
|
||||||
|
<AppLink url={links.kazachek.url}>kazachek</AppLink>,{' '}
|
||||||
|
<AppLink url={links.freepik.url}>freepik</AppLink>.
|
||||||
</AppText>
|
</AppText>
|
||||||
</Segment>
|
</Segment>
|
||||||
<Segment title={t('donate.title')}>
|
<Segment title={t('donate.title')}>
|
||||||
@@ -4,16 +4,18 @@ import { useTranslation } from 'react-i18next'
|
|||||||
|
|
||||||
import AppPage from '../common/app-page'
|
import AppPage from '../common/app-page'
|
||||||
import AppText from '../common/app-text'
|
import AppText from '../common/app-text'
|
||||||
|
import AppLink from '../common/AppLink'
|
||||||
import Segment from '../common/segment'
|
import Segment from '../common/segment'
|
||||||
|
|
||||||
const License = ({ children }) => {
|
const License = ({ children }) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation(null, { keyPrefix: 'hamburgerMenu.license' })
|
||||||
const currentYear = new Date().getFullYear()
|
const currentYear = new Date().getFullYear()
|
||||||
|
const link = 'https://www.gnu.org/licenses/gpl-3.0.html'
|
||||||
return (
|
return (
|
||||||
<AppPage title={t('settings.license.title')}>
|
<AppPage title={t('title')}>
|
||||||
<Segment last>
|
<Segment last>
|
||||||
<AppText>{t('settings.license.text', { currentYear })}</AppText>
|
<AppText>{t('text', { currentYear })}</AppText>
|
||||||
|
<AppLink url={link}>{link}</AppLink>
|
||||||
{children}
|
{children}
|
||||||
</Segment>
|
</Segment>
|
||||||
</AppPage>
|
</AppPage>
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Alert, StyleSheet, View } from 'react-native'
|
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 AppTextInput from '../../common/app-text-input'
|
||||||
import Button from '../../common/button'
|
import Button from '../../common/button'
|
||||||
|
|
||||||
import { requestHash, openDb } from '../../../db'
|
import { openDb } from '../../../db'
|
||||||
import { Containers } from '../../../styles'
|
import { Containers } from '../../../styles'
|
||||||
import settings from '../../../i18n/en/settings'
|
import settings from '../../../i18n/en/settings'
|
||||||
import { shared } from '../../../i18n/en/labels'
|
import { shared } from '../../../i18n/en/labels'
|
||||||
@@ -14,7 +14,8 @@ import { shared } from '../../../i18n/en/labels'
|
|||||||
const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
|
const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
|
||||||
const [password, setPassword] = useState(null)
|
const [password, setPassword] = useState(null)
|
||||||
|
|
||||||
const checkPassword = async (hash) => {
|
const checkPassword = async () => {
|
||||||
|
const hash = new SHA512().hex(password)
|
||||||
try {
|
try {
|
||||||
await openDb(hash)
|
await openDb(hash)
|
||||||
onSuccess()
|
onSuccess()
|
||||||
@@ -23,15 +24,6 @@ const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const listener = nodejs.channel.addListener(
|
|
||||||
'password-check',
|
|
||||||
checkPassword,
|
|
||||||
this
|
|
||||||
)
|
|
||||||
return () => listener.remove()
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const onIncorrectPassword = () => {
|
const onIncorrectPassword = () => {
|
||||||
Alert.alert(shared.incorrectPassword, shared.incorrectPasswordMessage, [
|
Alert.alert(shared.incorrectPassword, shared.incorrectPasswordMessage, [
|
||||||
{
|
{
|
||||||
@@ -45,15 +37,11 @@ const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
const initPasswordCheck = () => {
|
|
||||||
requestHash('password-check', password)
|
|
||||||
}
|
|
||||||
|
|
||||||
const labels = settings.passwordSettings
|
const labels = settings.passwordSettings
|
||||||
const isPassword = password !== null
|
const isPassword = password !== null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<KeyboardAvoidingView behavior="padding" keyboardVerticalOffset={150}>
|
||||||
<AppTextInput
|
<AppTextInput
|
||||||
onChangeText={setPassword}
|
onChangeText={setPassword}
|
||||||
placeholder={labels.enterCurrent}
|
placeholder={labels.enterCurrent}
|
||||||
@@ -65,12 +53,12 @@ const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
|
|||||||
<Button
|
<Button
|
||||||
disabled={!isPassword}
|
disabled={!isPassword}
|
||||||
isCTA={isPassword}
|
isCTA={isPassword}
|
||||||
onPress={initPasswordCheck}
|
onPress={checkPassword}
|
||||||
>
|
>
|
||||||
{shared.confirmToProceed}
|
{shared.confirmToProceed}
|
||||||
</Button>
|
</Button>
|
||||||
</View>
|
</View>
|
||||||
</>
|
</KeyboardAvoidingView>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-27
@@ -6,40 +6,23 @@ import AppText from '../../common/app-text'
|
|||||||
import Button from '../../common/button'
|
import Button from '../../common/button'
|
||||||
import Segment from '../../common/segment'
|
import Segment from '../../common/segment'
|
||||||
|
|
||||||
import { openImportDialog, getFileContent, importData } from './import-dialog'
|
|
||||||
import openShareDialogAndExport from './export-dialog'
|
import openShareDialogAndExport from './export-dialog'
|
||||||
import DeleteData from './delete-data'
|
import DeleteData from './delete-data'
|
||||||
|
|
||||||
import labels from '../../../i18n/en/settings'
|
import labels from '../../../i18n/en/settings'
|
||||||
import { ACTION_DELETE, ACTION_EXPORT, ACTION_IMPORT } from '../../../config'
|
import ImportData from './ImportData'
|
||||||
|
|
||||||
const DataManagement = () => {
|
const DataManagement = () => {
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
const [currentAction, setCurrentAction] = useState(null)
|
const [isDeletingData, setIsDeletingData] = useState(false)
|
||||||
|
|
||||||
const startImportFlow = async (shouldDeleteExistingData) => {
|
|
||||||
setIsLoading(true)
|
|
||||||
const fileContent = await getFileContent()
|
|
||||||
if (fileContent) {
|
|
||||||
await importData(shouldDeleteExistingData, fileContent)
|
|
||||||
}
|
|
||||||
setIsLoading(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
const startExport = () => {
|
const startExport = () => {
|
||||||
setCurrentAction(ACTION_EXPORT)
|
setIsDeletingData(false)
|
||||||
openShareDialogAndExport()
|
openShareDialogAndExport()
|
||||||
}
|
}
|
||||||
|
|
||||||
const startImport = () => {
|
|
||||||
setCurrentAction(ACTION_IMPORT)
|
|
||||||
openImportDialog(startImportFlow)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isLoading) return <AppLoadingView />
|
if (isLoading) return <AppLoadingView />
|
||||||
|
|
||||||
const isDeletingData = currentAction === ACTION_DELETE
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppPage>
|
<AppPage>
|
||||||
<Segment title={labels.export.button}>
|
<Segment title={labels.export.button}>
|
||||||
@@ -48,17 +31,15 @@ const DataManagement = () => {
|
|||||||
{labels.export.button}
|
{labels.export.button}
|
||||||
</Button>
|
</Button>
|
||||||
</Segment>
|
</Segment>
|
||||||
<Segment title={labels.import.button}>
|
<ImportData
|
||||||
<AppText>{labels.import.segmentExplainer}</AppText>
|
resetIsDeletingData={() => setIsDeletingData(false)}
|
||||||
<Button isCTA onPress={startImport}>
|
setIsLoading={setIsLoading}
|
||||||
{labels.import.button}
|
/>
|
||||||
</Button>
|
|
||||||
</Segment>
|
|
||||||
<Segment title={labels.deleteSegment.title} last>
|
<Segment title={labels.deleteSegment.title} last>
|
||||||
<AppText>{labels.deleteSegment.explainer}</AppText>
|
<AppText>{labels.deleteSegment.explainer}</AppText>
|
||||||
<DeleteData
|
<DeleteData
|
||||||
isDeletingData={isDeletingData}
|
isDeletingData={isDeletingData}
|
||||||
onStartDeletion={() => setCurrentAction(ACTION_DELETE)}
|
onStartDeletion={() => setIsDeletingData(true)}
|
||||||
/>
|
/>
|
||||||
</Segment>
|
</Segment>
|
||||||
</AppPage>
|
</AppPage>
|
||||||
@@ -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('error.couldNotOpenFile'))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function importData(shouldDeleteExistingData) {
|
||||||
|
const fileContent = await getFileContent()
|
||||||
|
if (!fileContent) return
|
||||||
|
|
||||||
|
try {
|
||||||
|
await importCsv(fileContent, shouldDeleteExistingData)
|
||||||
|
Alert.alert(t('success.title'), t('success.message'))
|
||||||
|
} catch (err) {
|
||||||
|
showImportErrorAlert(err.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openImportDialog() {
|
||||||
|
resetIsDeletingData()
|
||||||
|
Alert.alert(t('dialog.title'), t('dialog.message'), [
|
||||||
|
{
|
||||||
|
text: t('dialog.cancel'),
|
||||||
|
style: 'cancel',
|
||||||
|
onPress: () => {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t('dialog.delete'),
|
||||||
|
onPress: () => startImport(true),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t('dialog.replace'),
|
||||||
|
onPress: () => startImport(false),
|
||||||
|
},
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
function showImportErrorAlert(message) {
|
||||||
|
const errorMessage = t('error.noDataImported', { message })
|
||||||
|
alertError(errorMessage)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Segment title={t('button')}>
|
||||||
|
<AppText>{t('segmentExplainer')}</AppText>
|
||||||
|
<Button isCTA onPress={openImportDialog}>
|
||||||
|
{t('button')}
|
||||||
|
</Button>
|
||||||
|
</Segment>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
ImportData.propTypes = {
|
||||||
|
resetIsDeletingData: PropTypes.func.isRequired,
|
||||||
|
setIsLoading: PropTypes.func.isRequired,
|
||||||
|
}
|
||||||
@@ -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,8 +1,8 @@
|
|||||||
import Reminders from './reminders/reminders'
|
import Reminders from './reminders/reminders'
|
||||||
import NfpSettings from './nfp-settings'
|
import NfpSettings from './nfp-settings'
|
||||||
import DataManagement from './data-management'
|
import DataManagement from './data-management/DataManagement'
|
||||||
import Password from './password'
|
import Password from './password'
|
||||||
import About from './about'
|
import About from './About'
|
||||||
import License from './License'
|
import License from './License'
|
||||||
import PrivacyPolicy from './privacy-policy'
|
import PrivacyPolicy from './privacy-policy'
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,22 @@ import AppText from '../common/app-text'
|
|||||||
import Segment from '../common/segment'
|
import Segment from '../common/segment'
|
||||||
|
|
||||||
import { Colors, Containers, Sizes } from '../../styles'
|
import { Colors, Containers, Sizes } from '../../styles'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const MenuItem = ({ item, last, navigate }) => {
|
const MenuItem = ({ item, last, navigate }) => {
|
||||||
|
const { t } = useTranslation(null, {
|
||||||
|
keyPrefix: 'hamburgerMenu.settings.menuItem',
|
||||||
|
})
|
||||||
return (
|
return (
|
||||||
<Segment last={last}>
|
<Segment last={last}>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.container}
|
style={styles.container}
|
||||||
key={item.name}
|
key={item.label}
|
||||||
onPress={() => navigate(item.component)}
|
onPress={() => navigate(item.componentName)}
|
||||||
>
|
>
|
||||||
<View>
|
<View>
|
||||||
<AppText style={styles.title}>{item.name}</AppText>
|
<AppText style={styles.title}>{t(`${item.label}.name`)}</AppText>
|
||||||
{item.text.length > 0 && <AppText>{item.text}</AppText>}
|
{!!item.label && <AppText>{t(`${item.label}.text`)}</AppText>}
|
||||||
</View>
|
</View>
|
||||||
<AppIcon name="chevron-right" color={Colors.orange} />
|
<AppIcon name="chevron-right" color={Colors.orange} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -1,35 +1,24 @@
|
|||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { StyleSheet } from 'react-native'
|
import { KeyboardAvoidingView, StyleSheet } from 'react-native'
|
||||||
import nodejs from 'nodejs-mobile-react-native'
|
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
import { SHA512 } from 'jshashes'
|
||||||
|
|
||||||
import AppText from '../../common/app-text'
|
import AppText from '../../common/app-text'
|
||||||
import AppTextInput from '../../common/app-text-input'
|
import AppTextInput from '../../common/app-text-input'
|
||||||
import Button from '../../common/button'
|
import Button from '../../common/button'
|
||||||
|
|
||||||
import { requestHash } from '../../../db'
|
|
||||||
import { Colors, Spacing } from '../../../styles'
|
import { Colors, Spacing } from '../../../styles'
|
||||||
import settings from '../../../i18n/en/settings'
|
import settings from '../../../i18n/en/settings'
|
||||||
|
|
||||||
const LISTENER_TYPE = 'create-or-change-pw'
|
|
||||||
|
|
||||||
const EnterNewPassword = ({ changeEncryptionAndRestart }) => {
|
const EnterNewPassword = ({ changeEncryptionAndRestart }) => {
|
||||||
const [password, setPassword] = useState('')
|
const [password, setPassword] = useState('')
|
||||||
const [passwordConfirmation, setPasswordConfirmation] = useState('')
|
const [passwordConfirmation, setPasswordConfirmation] = useState('')
|
||||||
const [shouldShowErrorMessage, setShouldShowErrorMessage] = useState(false)
|
const [shouldShowErrorMessage, setShouldShowErrorMessage] = useState(false)
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const listener = nodejs.channel.addListener(
|
|
||||||
LISTENER_TYPE,
|
|
||||||
changeEncryptionAndRestart,
|
|
||||||
this
|
|
||||||
)
|
|
||||||
return () => listener.remove()
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const savePassword = () => {
|
const savePassword = () => {
|
||||||
if (comparePasswords()) {
|
if (comparePasswords()) {
|
||||||
requestHash(LISTENER_TYPE, password)
|
const hash = new SHA512().hex(password)
|
||||||
|
changeEncryptionAndRestart(hash)
|
||||||
} else {
|
} else {
|
||||||
setShouldShowErrorMessage(true)
|
setShouldShowErrorMessage(true)
|
||||||
}
|
}
|
||||||
@@ -41,9 +30,8 @@ const EnterNewPassword = ({ changeEncryptionAndRestart }) => {
|
|||||||
const isButtonActive = password.length > 0 && passwordConfirmation.length > 0
|
const isButtonActive = password.length > 0 && passwordConfirmation.length > 0
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<KeyboardAvoidingView behavior="padding" keyboardVerticalOffset={150}>
|
||||||
<AppTextInput
|
<AppTextInput
|
||||||
isKeyboardOffset={false}
|
|
||||||
onChangeText={setPassword}
|
onChangeText={setPassword}
|
||||||
placeholder={labels.enterNew}
|
placeholder={labels.enterNew}
|
||||||
textContentType="password"
|
textContentType="password"
|
||||||
@@ -51,7 +39,6 @@ const EnterNewPassword = ({ changeEncryptionAndRestart }) => {
|
|||||||
secureTextEntry={true}
|
secureTextEntry={true}
|
||||||
/>
|
/>
|
||||||
<AppTextInput
|
<AppTextInput
|
||||||
isKeyboardOffset={false}
|
|
||||||
onChangeText={setPasswordConfirmation}
|
onChangeText={setPasswordConfirmation}
|
||||||
placeholder={labels.confirmPassword}
|
placeholder={labels.confirmPassword}
|
||||||
textContentType="password"
|
textContentType="password"
|
||||||
@@ -68,7 +55,7 @@ const EnterNewPassword = ({ changeEncryptionAndRestart }) => {
|
|||||||
>
|
>
|
||||||
{labels.savePassword}
|
{labels.savePassword}
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</KeyboardAvoidingView>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ import Segment from '../common/segment'
|
|||||||
import { Colors, Sizes } from '../../styles'
|
import { Colors, Sizes } from '../../styles'
|
||||||
|
|
||||||
const PrivacyPolicy = () => {
|
const PrivacyPolicy = () => {
|
||||||
const { t } = useTranslation(null, { keyPrefix: 'settings.privacyPolicy' })
|
const { t } = useTranslation(null, {
|
||||||
|
keyPrefix: 'hamburgerMenu.privacyPolicy',
|
||||||
|
})
|
||||||
const sections = ['intro', 'dataUse', 'permissions', 'transparency']
|
const sections = ['intro', 'dataUse', 'permissions', 'transparency']
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -4,21 +4,21 @@ import PropTypes from 'prop-types'
|
|||||||
import AppPage from '../common/app-page'
|
import AppPage from '../common/app-page'
|
||||||
import MenuItem from './menu-item'
|
import MenuItem from './menu-item'
|
||||||
|
|
||||||
import settingsLabels from '../../i18n/en/settings'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const { menuItems } = settingsLabels
|
const menuItems = [
|
||||||
const menu = [
|
{ label: 'reminders', componentName: 'Reminders' },
|
||||||
{ ...menuItems.reminders, component: 'Reminders' },
|
{ label: 'nfpSettings', componentName: 'NfpSettings' },
|
||||||
{ ...menuItems.nfpSettings, component: 'NfpSettings' },
|
{ label: 'dataManagement', componentName: 'DataManagement' },
|
||||||
{ ...menuItems.dataManagement, component: 'DataManagement' },
|
{ label: 'password', componentName: 'Password' },
|
||||||
{ ...menuItems.password, component: 'Password' },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const SettingsMenu = ({ navigate }) => {
|
const SettingsMenu = ({ navigate }) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
<AppPage title={settingsLabels.title}>
|
<AppPage title={t('hamburgerMenu.settings.title')}>
|
||||||
{menu.map((menuItem, i) => {
|
{menuItems.map((menuItem, i) => {
|
||||||
const last = menu.length === i + 1
|
const last = menuItems.length === i + 1
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MenuItem item={menuItem} key={i} last={last} navigate={navigate} />
|
<MenuItem item={menuItem} key={i} last={last} navigate={navigate} />
|
||||||
|
|||||||
@@ -1,113 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import { ImageBackground, View } from 'react-native'
|
|
||||||
import { ScaledSheet } from 'react-native-size-matters'
|
|
||||||
|
|
||||||
import AppPage from './common/app-page'
|
|
||||||
import AppText from './common/app-text'
|
|
||||||
import Segment from './common/segment'
|
|
||||||
import Table from './common/table'
|
|
||||||
|
|
||||||
import cycleModule from '../lib/cycle'
|
|
||||||
import {getCycleLengthStats as getCycleInfo} from '../lib/cycle-length'
|
|
||||||
import {stats as labels} from '../i18n/en/labels'
|
|
||||||
|
|
||||||
import { Sizes, Spacing, Typography } from '../styles'
|
|
||||||
|
|
||||||
const image = require('../assets/cycle-icon.png')
|
|
||||||
|
|
||||||
const Stats = () => {
|
|
||||||
const cycleLengths = cycleModule().getAllCycleLengths()
|
|
||||||
const numberOfCycles = cycleLengths.length
|
|
||||||
const hasAtLeastOneCycle = numberOfCycles >= 1
|
|
||||||
const cycleData = hasAtLeastOneCycle ? getCycleInfo(cycleLengths)
|
|
||||||
: { minimum: '—', maximum: '—', stdDeviation: '—' }
|
|
||||||
const statsData = [
|
|
||||||
[cycleData.minimum, labels.minLabel],
|
|
||||||
[cycleData.maximum, labels.maxLabel],
|
|
||||||
[cycleData.stdDeviation ? cycleData.stdDeviation : '—', labels.stdLabel],
|
|
||||||
[numberOfCycles, labels.basisOfStatsEnd]
|
|
||||||
]
|
|
||||||
|
|
||||||
return (
|
|
||||||
<AppPage contentContainerStyle={styles.pageContainer}>
|
|
||||||
<Segment last style={styles.pageContainer}>
|
|
||||||
<AppText>{labels.cycleLengthExplainer}</AppText>
|
|
||||||
{!hasAtLeastOneCycle && <AppText>{labels.emptyStats}</AppText>}
|
|
||||||
{hasAtLeastOneCycle &&
|
|
||||||
<View style={styles.container}>
|
|
||||||
<View style={styles.columnLeft}>
|
|
||||||
<ImageBackground
|
|
||||||
source={image}
|
|
||||||
imageStyle={styles.image}
|
|
||||||
style={styles.imageContainter}
|
|
||||||
>
|
|
||||||
<AppText
|
|
||||||
numberOfLines={1}
|
|
||||||
ellipsizeMode="clip"
|
|
||||||
style={styles.accentPurpleGiant}
|
|
||||||
>
|
|
||||||
{cycleData.mean}
|
|
||||||
</AppText>
|
|
||||||
<AppText style={styles.accentPurpleHuge}>
|
|
||||||
{labels.daysLabel}
|
|
||||||
</AppText>
|
|
||||||
</ImageBackground>
|
|
||||||
<AppText style={styles.accentOrange}>
|
|
||||||
{labels.averageLabel}
|
|
||||||
</AppText>
|
|
||||||
</View>
|
|
||||||
<View style={styles.columnRight}>
|
|
||||||
<Table tableContent={statsData} />
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
}
|
|
||||||
</Segment>
|
|
||||||
</AppPage>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const column = {
|
|
||||||
flexDirection: 'column',
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = ScaledSheet.create({
|
|
||||||
accentOrange: {
|
|
||||||
...Typography.accentOrange,
|
|
||||||
fontSize: Sizes.small,
|
|
||||||
},
|
|
||||||
accentPurpleGiant: {
|
|
||||||
...Typography.accentPurpleGiant,
|
|
||||||
marginTop: Spacing.base * (-2),
|
|
||||||
},
|
|
||||||
accentPurpleHuge: {
|
|
||||||
...Typography.accentPurpleHuge,
|
|
||||||
marginTop: Spacing.base * (-1),
|
|
||||||
},
|
|
||||||
container: {
|
|
||||||
alignItems: 'center',
|
|
||||||
flexDirection: 'row',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
paddingTop: Spacing.base
|
|
||||||
},
|
|
||||||
columnLeft: {
|
|
||||||
...column,
|
|
||||||
flex: 2,
|
|
||||||
},
|
|
||||||
columnRight: {
|
|
||||||
...column,
|
|
||||||
flex: 3,
|
|
||||||
paddingTop: Spacing.small,
|
|
||||||
},
|
|
||||||
image: {
|
|
||||||
resizeMode: 'contain',
|
|
||||||
},
|
|
||||||
imageContainter: {
|
|
||||||
paddingTop: Spacing.large * 2.5,
|
|
||||||
marginBottom: Spacing.large,
|
|
||||||
},
|
|
||||||
pageContainer: {
|
|
||||||
marginTop: Spacing.base * 2,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
export default Stats
|
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { FlatList, StyleSheet, View } from 'react-native'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
import AppModal from '../common/app-modal'
|
||||||
|
import AppText from '../common/app-text'
|
||||||
|
|
||||||
|
import cycleModule from '../../lib/cycle'
|
||||||
|
import { Spacing, Typography, Colors } from '../../styles'
|
||||||
|
import { humanizeDate } from '../helpers/format-date'
|
||||||
|
|
||||||
|
const Item = ({ data }) => {
|
||||||
|
const { t } = useTranslation(null, { keyPrefix: 'plurals' })
|
||||||
|
|
||||||
|
if (!data) return false
|
||||||
|
|
||||||
|
const { date, cycleLength, bleedingLength } = data
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={styles.row}>
|
||||||
|
<View style={styles.accentCell}>
|
||||||
|
<AppText>{humanizeDate(date)}</AppText>
|
||||||
|
</View>
|
||||||
|
<View style={styles.cell}>
|
||||||
|
<AppText>{t('day', { count: cycleLength })}</AppText>
|
||||||
|
</View>
|
||||||
|
<View style={styles.cell}>
|
||||||
|
<AppText>{t('day', { count: bleedingLength })}</AppText>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Item.propTypes = {
|
||||||
|
data: PropTypes.object.isRequired,
|
||||||
|
}
|
||||||
|
|
||||||
|
const PeriodDetailsModal = ({ onClose }) => {
|
||||||
|
const renderItem = ({ item }) => <Item data={item} />
|
||||||
|
const data = cycleModule().getStats()
|
||||||
|
|
||||||
|
if (!data || data.length === 0) return false
|
||||||
|
|
||||||
|
return (
|
||||||
|
<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>
|
||||||
|
</AppModal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
PeriodDetailsModal.propTypes = {
|
||||||
|
onClose: PropTypes.func,
|
||||||
|
}
|
||||||
|
|
||||||
|
const ItemDivider = () => <View style={styles.divider} />
|
||||||
|
|
||||||
|
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({
|
||||||
|
divider: {
|
||||||
|
height: 1,
|
||||||
|
width: '100%',
|
||||||
|
backgroundColor: Colors.grey,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
...Typography.accentOrange,
|
||||||
|
paddingVertical: Spacing.small,
|
||||||
|
},
|
||||||
|
headerDivider: {
|
||||||
|
borderBottomColor: Colors.purple,
|
||||||
|
borderBottomWidth: 2,
|
||||||
|
},
|
||||||
|
row: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
paddingVertical: Spacing.tiny,
|
||||||
|
backgroundColor: 'white',
|
||||||
|
},
|
||||||
|
cell: {
|
||||||
|
flex: 2,
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
accentCell: {
|
||||||
|
flex: 3,
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
container: {
|
||||||
|
minHeight: '40%',
|
||||||
|
minWidth: '95%',
|
||||||
|
paddingHorizontal: Spacing.base,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export default PeriodDetailsModal
|
||||||
@@ -2,25 +2,25 @@ import React from 'react'
|
|||||||
import { StyleSheet, View } from 'react-native'
|
import { StyleSheet, View } from 'react-native'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import AppText from './app-text'
|
import AppText from '../common/app-text'
|
||||||
|
|
||||||
import { Sizes, Spacing, Typography } from '../../styles'
|
import { Sizes, Spacing, Typography } from '../../styles'
|
||||||
|
|
||||||
const Table = ({ tableContent }) => {
|
const StatsOverview = ({ data }) => {
|
||||||
return tableContent.map((rowContent, i) => (
|
return data.map((rowContent, i) => <Row key={i} rowContent={rowContent} />)
|
||||||
<Row key={i} rowContent={rowContent} />
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Table.propTypes = {
|
StatsOverview.propTypes = {
|
||||||
tableContent: PropTypes.array.isRequired,
|
data: PropTypes.array.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Row = ({ rowContent }) => {
|
const Row = ({ rowContent }) => {
|
||||||
|
const isStandardDeviation = rowContent[1].includes('deviation')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.row}>
|
<View style={styles.row}>
|
||||||
<Cell content={rowContent[0]} isLeft />
|
<Cell content={rowContent[0]} isLeft />
|
||||||
<Cell content={rowContent[1]} />
|
<Cell content={rowContent[1]} hasAsterisk={isStandardDeviation} />
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ Row.propTypes = {
|
|||||||
rowContent: PropTypes.array.isRequired,
|
rowContent: PropTypes.array.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Cell = ({ content, isLeft }) => {
|
const Cell = ({ content, isLeft, hasAsterisk }) => {
|
||||||
const styleContainer = isLeft ? styles.cellLeft : styles.cellRight
|
const styleContainer = isLeft ? styles.cellLeft : styles.cellRight
|
||||||
const styleText = isLeft ? styles.accentPurpleBig : styles.accentOrange
|
const styleText = isLeft ? styles.accentPurpleBig : styles.accentOrange
|
||||||
const numberOfLines = isLeft ? 1 : 2
|
const numberOfLines = isLeft ? 1 : 2
|
||||||
@@ -43,6 +43,7 @@ const Cell = ({ content, isLeft }) => {
|
|||||||
style={styleText}
|
style={styleText}
|
||||||
>
|
>
|
||||||
{content}
|
{content}
|
||||||
|
{hasAsterisk && <AppText style={styles.accentOrange}>*</AppText>}
|
||||||
</AppText>
|
</AppText>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
@@ -51,6 +52,7 @@ const Cell = ({ content, isLeft }) => {
|
|||||||
Cell.propTypes = {
|
Cell.propTypes = {
|
||||||
content: PropTypes.node.isRequired,
|
content: PropTypes.node.isRequired,
|
||||||
isLeft: PropTypes.bool,
|
isLeft: PropTypes.bool,
|
||||||
|
hasAsterisk: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
@@ -65,18 +67,11 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
cellLeft: {
|
cellLeft: {
|
||||||
alignItems: 'flex-end',
|
alignItems: 'flex-end',
|
||||||
flex: 5,
|
flex: 3,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
cellRight: {
|
cellRight: { flex: 5 },
|
||||||
flex: 5,
|
row: { flexDirection: 'row' },
|
||||||
justifyContent: 'center',
|
|
||||||
},
|
|
||||||
row: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
marginBottom: Spacing.tiny,
|
|
||||||
marginLeft: Spacing.tiny,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export default Table
|
export default StatsOverview
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
import React, { useState } from 'react'
|
||||||
|
import { ImageBackground, SafeAreaView, ScrollView, View } from 'react-native'
|
||||||
|
import { ScaledSheet } from 'react-native-size-matters'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
|
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 { Containers, Sizes, Spacing, Typography } from '../../styles'
|
||||||
|
|
||||||
|
const image = require('../../assets/cycle-icon.png')
|
||||||
|
|
||||||
|
const Stats = () => {
|
||||||
|
const [isStatsVisible, setIsStatsVisible] = useState(false)
|
||||||
|
|
||||||
|
const { t } = useTranslation(null, { keyPrefix: 'stats' })
|
||||||
|
|
||||||
|
const cycleLengths = cycleModule().getAllCycleLengths()
|
||||||
|
const numberOfCycles = cycleLengths.length
|
||||||
|
const cycleData =
|
||||||
|
numberOfCycles > 0
|
||||||
|
? getCycleInfo(cycleLengths)
|
||||||
|
: { minimum: '—', maximum: '—', stdDeviation: '—' }
|
||||||
|
const standardDeviation = cycleData.stdDeviation
|
||||||
|
? cycleData.stdDeviation
|
||||||
|
: '—'
|
||||||
|
const statsData = [
|
||||||
|
[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('intro')}</AppText>
|
||||||
|
{numberOfCycles === 0 ? (
|
||||||
|
<AppText>{t('noData')}</AppText>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<View style={styles.container}>
|
||||||
|
<View style={styles.columnLeft}>
|
||||||
|
<ImageBackground
|
||||||
|
source={image}
|
||||||
|
imageStyle={styles.image}
|
||||||
|
style={styles.imageContainter}
|
||||||
|
>
|
||||||
|
<AppText
|
||||||
|
numberOfLines={1}
|
||||||
|
ellipsizeMode="clip"
|
||||||
|
style={styles.accentPurpleGiant}
|
||||||
|
>
|
||||||
|
{cycleData.mean}
|
||||||
|
</AppText>
|
||||||
|
<AppText style={styles.accentPurpleHuge}>
|
||||||
|
{t('overview.days')}
|
||||||
|
</AppText>
|
||||||
|
</ImageBackground>
|
||||||
|
<AppText style={styles.accentOrange}>
|
||||||
|
{t('overview.average')}
|
||||||
|
</AppText>
|
||||||
|
</View>
|
||||||
|
<View style={styles.columnRight}>
|
||||||
|
<StatsOverview data={statsData} />
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Button isCTA onPress={() => setIsStatsVisible(true)}>
|
||||||
|
{t('showStats')}
|
||||||
|
</Button>
|
||||||
|
{isStatsVisible && (
|
||||||
|
<PeriodDetailsModal onClose={() => setIsStatsVisible(false)} />
|
||||||
|
)}
|
||||||
|
<Footnote>{t('footnote')}</Footnote>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</ScrollView>
|
||||||
|
</SafeAreaView>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const column = {
|
||||||
|
flexDirection: 'column',
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = ScaledSheet.create({
|
||||||
|
accentOrange: {
|
||||||
|
...Typography.accentOrange,
|
||||||
|
fontSize: Sizes.small,
|
||||||
|
},
|
||||||
|
accentPurpleGiant: {
|
||||||
|
...Typography.accentPurpleGiant,
|
||||||
|
marginTop: Spacing.base * -2,
|
||||||
|
},
|
||||||
|
accentPurpleHuge: {
|
||||||
|
...Typography.accentPurpleHuge,
|
||||||
|
marginTop: Spacing.base * -1,
|
||||||
|
},
|
||||||
|
container: {
|
||||||
|
alignItems: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
columnLeft: {
|
||||||
|
...column,
|
||||||
|
flex: 3,
|
||||||
|
},
|
||||||
|
columnRight: {
|
||||||
|
...column,
|
||||||
|
flex: 5,
|
||||||
|
paddingTop: Spacing.small,
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
resizeMode: 'contain',
|
||||||
|
},
|
||||||
|
imageContainter: {
|
||||||
|
paddingTop: Spacing.large * 2.5,
|
||||||
|
marginBottom: Spacing.large,
|
||||||
|
},
|
||||||
|
overviewContainer: {
|
||||||
|
paddingHorizontal: Spacing.base,
|
||||||
|
paddingTop: Spacing.base,
|
||||||
|
},
|
||||||
|
pageContainer: {
|
||||||
|
...Containers.pageContainer,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export default Stats
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
import { PixelRatio, StatusBar } from 'react-native'
|
import { PixelRatio, StatusBar } from 'react-native'
|
||||||
import { scale, verticalScale } from 'react-native-size-matters'
|
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 = [
|
export const SYMPTOMS = [
|
||||||
'bleeding',
|
'bleeding',
|
||||||
'temperature',
|
'temperature',
|
||||||
@@ -19,12 +15,13 @@ export const SYMPTOMS = [
|
|||||||
|
|
||||||
export const CHART_COLUMN_WIDTH = 32
|
export const CHART_COLUMN_WIDTH = 32
|
||||||
export const CHART_COLUMN_MIDDLE = CHART_COLUMN_WIDTH / 2
|
export const CHART_COLUMN_MIDDLE = CHART_COLUMN_WIDTH / 2
|
||||||
export const CHART_DOT_RADIUS = scale(6)
|
export const CHART_DOT_RADIUS_SYMPTOM = scale(6)
|
||||||
|
export const CHART_DOT_RADIUS_TEMPERATURE = scale(4)
|
||||||
export const CHART_GRID_LINE_HORIZONTAL_WIDTH =
|
export const CHART_GRID_LINE_HORIZONTAL_WIDTH =
|
||||||
PixelRatio.roundToNearestPixel(0.3)
|
PixelRatio.roundToNearestPixel(0.3)
|
||||||
export const CHART_ICON_SIZE = scale(20)
|
export const CHART_ICON_SIZE = scale(20)
|
||||||
export const CHART_STROKE_WIDTH = scale(3)
|
export const CHART_STROKE_WIDTH = scale(1.5)
|
||||||
export const CHART_SYMPTOM_HEIGHT_RATIO = scale(0.08)
|
export const CHART_SYMPTOM_HEIGHT_RATIO = scale(0.06)
|
||||||
export const CHART_XAXIS_HEIGHT_RATIO = scale(0.1)
|
export const CHART_XAXIS_HEIGHT_RATIO = scale(0.1)
|
||||||
export const CHART_YAXIS_WIDTH = scale(32)
|
export const CHART_YAXIS_WIDTH = scale(32)
|
||||||
export const CHART_TICK_WIDTH = scale(44)
|
export const CHART_TICK_WIDTH = scale(44)
|
||||||
@@ -40,7 +37,7 @@ export const HIT_SLOP = {
|
|||||||
top: verticalScale(20),
|
top: verticalScale(20),
|
||||||
bottom: verticalScale(20),
|
bottom: verticalScale(20),
|
||||||
left: scale(20),
|
left: scale(20),
|
||||||
right: scale(20)
|
right: scale(20),
|
||||||
}
|
}
|
||||||
|
|
||||||
export const STATUSBAR_HEIGHT = StatusBar.currentHeight
|
export const STATUSBAR_HEIGHT = StatusBar.currentHeight
|
||||||
|
|||||||
-11
@@ -1,6 +1,5 @@
|
|||||||
import Realm from 'realm'
|
import Realm from 'realm'
|
||||||
import { LocalDate, ChronoUnit } from '@js-joda/core'
|
import { LocalDate, ChronoUnit } from '@js-joda/core'
|
||||||
import nodejs from 'nodejs-mobile-react-native'
|
|
||||||
import fs from 'react-native-fs'
|
import fs from 'react-native-fs'
|
||||||
|
|
||||||
import schemas from './schemas'
|
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) {
|
export async function changeDbEncryption(hash) {
|
||||||
let key
|
let key
|
||||||
if (hash) key = hashToInt8Array(hash)
|
if (hash) key = hashToInt8Array(hash)
|
||||||
|
|||||||
+98
-3
@@ -1,4 +1,25 @@
|
|||||||
{
|
{
|
||||||
|
"bottomMenu": {
|
||||||
|
"calendar": "Calendar",
|
||||||
|
"chart": "Chart",
|
||||||
|
"stats": "Stats"
|
||||||
|
},
|
||||||
|
"chart": {
|
||||||
|
"tutorial": "You can swipe the chart to view more dates."
|
||||||
|
},
|
||||||
|
"cycleDay": {
|
||||||
|
"symptomBox": {
|
||||||
|
"bleeding": "bleeding",
|
||||||
|
"temperature": "temperature",
|
||||||
|
"mucus": "cervical mucus",
|
||||||
|
"cervix": "cervix",
|
||||||
|
"note": "note",
|
||||||
|
"desire": "desire",
|
||||||
|
"sex": "sex",
|
||||||
|
"pain": "pain",
|
||||||
|
"mood": "mood"
|
||||||
|
}
|
||||||
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"bleedingPrediction": {
|
"bleedingPrediction": {
|
||||||
"noPrediction": "As soon as you have tracked 3 menstrual cycles, drip. will make predictions for the next ones."
|
"noPrediction": "As soon as you have tracked 3 menstrual cycles, drip. will make predictions for the next ones."
|
||||||
@@ -13,11 +34,12 @@
|
|||||||
"ok": "OK"
|
"ok": "OK"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"settings": {
|
"hamburgerMenu": {
|
||||||
"about": {
|
"about": {
|
||||||
"credits": {
|
"credits": {
|
||||||
"title": "Credits",
|
"title": "Credits",
|
||||||
"text": "We love the drip. team. Thanks and lots of <3 to all of our condriputors. Thanks to Paula Härtel for the symptom tracking icons. All the other icons are made by {{smashicons}}, {{pause08}}, {{kazachek}} & {{freepik}} from {{flaticon}}."
|
"text": "We love the drip. team. Thanks and lots of <3 to all of our condriputors. Thanks to Paula Härtel for the symptom tracking icons. All the other icons from:",
|
||||||
|
"madeBy": "Made by:"
|
||||||
},
|
},
|
||||||
"donate": {
|
"donate": {
|
||||||
"button": "Donate here",
|
"button": "Donate here",
|
||||||
@@ -38,7 +60,13 @@
|
|||||||
},
|
},
|
||||||
"license": {
|
"license": {
|
||||||
"title": "drip. an open-source cycle tracking app",
|
"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: https://www.gnu.org/licenses/gpl-3.0.html."
|
"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": {
|
"privacyPolicy": {
|
||||||
"title": "Privacy Policy",
|
"title": "Privacy Policy",
|
||||||
@@ -58,6 +86,73 @@
|
|||||||
"title": "Transparency",
|
"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!"
|
"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": {
|
||||||
|
"import": {
|
||||||
|
"button": "Import data",
|
||||||
|
"dialog": {
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"delete": "Import and delete existing",
|
||||||
|
"message": "There are two options for the import:\n\n1. Keep existing cycle days and replace only the ones in the import file.\n\n2. Delete all existing cycle days and import cycle days from file",
|
||||||
|
"replace": "Import and replace",
|
||||||
|
"title": "Keep existing data?"
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"couldNotOpenFile": "Could not open file",
|
||||||
|
"futureEdit": "Future dates may only contain a note, no other symptoms",
|
||||||
|
"incorrectColumns": "Expected CSV column titles to be {{incorrectColumns}}",
|
||||||
|
"noDataImported": "{{message}}\n\nNo data was imported or changed"
|
||||||
|
},
|
||||||
|
"segmentExplainer": "Import data in CSV format",
|
||||||
|
"success": {
|
||||||
|
"message": "Data successfully imported",
|
||||||
|
"title": "Success"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"menuItem": {
|
||||||
|
"dataManagement": {
|
||||||
|
"name": "Data",
|
||||||
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
import labels from './settings'
|
|
||||||
const settingsTitles = labels.menuItems
|
|
||||||
|
|
||||||
export const home = {
|
export const home = {
|
||||||
unknown: '?',
|
unknown: '?',
|
||||||
phase: (n) => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`,
|
phase: (n) => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const chart = {
|
|
||||||
tutorial: 'You can swipe the chart to view more dates.',
|
|
||||||
}
|
|
||||||
|
|
||||||
export const shared = {
|
export const shared = {
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
save: 'Save',
|
save: 'Save',
|
||||||
@@ -33,30 +26,6 @@ export const shared = {
|
|||||||
learnMore: 'Learn more',
|
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 = {
|
export const stats = {
|
||||||
cycleLengthExplainer: 'Basic statistics about the length of your cycles.',
|
cycleLengthExplainer: 'Basic statistics about the length of your cycles.',
|
||||||
emptyStats: 'At least one completed cycle is needed to display stats.',
|
emptyStats: 'At least one completed cycle is needed to display stats.',
|
||||||
|
|||||||
@@ -1,29 +1,6 @@
|
|||||||
import links from './links'
|
import links from './links'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Settings',
|
|
||||||
menuItems: {
|
|
||||||
reminders: {
|
|
||||||
name: 'Reminders',
|
|
||||||
text: 'turn on/off reminders',
|
|
||||||
},
|
|
||||||
nfpSettings: {
|
|
||||||
name: 'NFP settings',
|
|
||||||
text: 'define how you want to use NFP',
|
|
||||||
},
|
|
||||||
dataManagement: {
|
|
||||||
name: 'Data',
|
|
||||||
text: 'import, export or delete your data',
|
|
||||||
},
|
|
||||||
password: {
|
|
||||||
name: 'Password',
|
|
||||||
text: '',
|
|
||||||
},
|
|
||||||
about: 'About',
|
|
||||||
license: 'License',
|
|
||||||
settings: 'Settings',
|
|
||||||
privacyPolicy: 'Privacy Policy',
|
|
||||||
},
|
|
||||||
export: {
|
export: {
|
||||||
errors: {
|
errors: {
|
||||||
noData: 'There is no data to export',
|
noData: 'There is no data to export',
|
||||||
@@ -36,24 +13,6 @@ export default {
|
|||||||
segmentExplainer:
|
segmentExplainer:
|
||||||
'Export data in CSV format for backup or so you can use it elsewhere',
|
'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: {
|
deleteSegment: {
|
||||||
title: 'Delete app data',
|
title: 'Delete app data',
|
||||||
explainer: 'Delete app data from this phone',
|
explainer: 'Delete app data from this phone',
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ i18n
|
|||||||
compatibilityJSON: 'v3', // TODO: migrate json to v4 and afterwards remove it
|
compatibilityJSON: 'v3', // TODO: migrate json to v4 and afterwards remove it
|
||||||
resources,
|
resources,
|
||||||
fallbackLng: 'en',
|
fallbackLng: 'en',
|
||||||
debug: true,
|
|
||||||
|
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false, // not needed for react as it escapes by default
|
escapeValue: false, // not needed for react as it escapes by default
|
||||||
|
|||||||
@@ -36,12 +36,9 @@
|
|||||||
54DFE73D25D94DED0025C3FC /* cycle-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 54DFE73C25D94DED0025C3FC /* cycle-icon.png */; };
|
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 */; };
|
54DFE73E25D94DED0025C3FC /* cycle-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 54DFE73C25D94DED0025C3FC /* cycle-icon.png */; };
|
||||||
54E1D49923E7588F003FA37B /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54E1D49823E7588F003FA37B /* JavaScriptCore.framework */; };
|
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 */; };
|
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 */; };
|
BD7041F2826E4A2CBE6CB87D /* RealmJSTests.xctest in Frameworks */ = {isa = PBXBuildFile; fileRef = F79F72C5390646E0A06AAE68 /* RealmJSTests.xctest */; };
|
||||||
D91133DCE120440893E2FD2E /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CD8C8B91E0A747B3883A0D56 /* libz.tbd */; };
|
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 */; };
|
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 */; };
|
FAC423E577F555F66C9891E4 /* libPods-drip-dripTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F33CCAAB670FD0D98C5C72DF /* libPods-drip-dripTests.a */; };
|
||||||
/* End PBXBuildFile section */
|
/* 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>"; };
|
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>"; };
|
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; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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; };
|
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>"; };
|
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>"; };
|
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; };
|
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; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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; };
|
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>"; };
|
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; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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 */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -137,7 +130,6 @@
|
|||||||
62F2A4645AC84CDC9506FF27 /* libc++.tbd in Frameworks */,
|
62F2A4645AC84CDC9506FF27 /* libc++.tbd in Frameworks */,
|
||||||
D91133DCE120440893E2FD2E /* libz.tbd in Frameworks */,
|
D91133DCE120440893E2FD2E /* libz.tbd in Frameworks */,
|
||||||
BD7041F2826E4A2CBE6CB87D /* RealmJSTests.xctest in Frameworks */,
|
BD7041F2826E4A2CBE6CB87D /* RealmJSTests.xctest in Frameworks */,
|
||||||
5C4C9DDE2824847500B72CBE /* NodeMobile.framework in Frameworks */,
|
|
||||||
E545887DBE87912F11770AB9 /* libPods-drip.a in Frameworks */,
|
E545887DBE87912F11770AB9 /* libPods-drip.a in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@@ -204,7 +196,6 @@
|
|||||||
2D16E6891FA4F8E400B85C8A /* libReact.a */,
|
2D16E6891FA4F8E400B85C8A /* libReact.a */,
|
||||||
9AEBF0735214455AAEDF56D5 /* libc++.tbd */,
|
9AEBF0735214455AAEDF56D5 /* libc++.tbd */,
|
||||||
CD8C8B91E0A747B3883A0D56 /* libz.tbd */,
|
CD8C8B91E0A747B3883A0D56 /* libz.tbd */,
|
||||||
C225FC4966694B9FBD32E946 /* NodeMobile.framework */,
|
|
||||||
6B7C2A0A7AAA83BBEFBD0B6A /* libPods-drip-tvOS.a */,
|
6B7C2A0A7AAA83BBEFBD0B6A /* libPods-drip-tvOS.a */,
|
||||||
E086AB579387F878A2CBCFEB /* libPods-drip-tvOSTests.a */,
|
E086AB579387F878A2CBCFEB /* libPods-drip-tvOSTests.a */,
|
||||||
699D3B3789FC2E5185CB9894 /* libPods-drip.a */,
|
699D3B3789FC2E5185CB9894 /* libPods-drip.a */,
|
||||||
@@ -222,7 +213,6 @@
|
|||||||
D211D71BE5A8436A978770A9 /* libRNDocumentPicker.a */,
|
D211D71BE5A8436A978770A9 /* libRNDocumentPicker.a */,
|
||||||
84CCEBD3B2C44758853BC941 /* libRNFS.a */,
|
84CCEBD3B2C44758853BC941 /* libRNFS.a */,
|
||||||
AB636AA0286D45CE9B23B2C3 /* libRCTRestart.a */,
|
AB636AA0286D45CE9B23B2C3 /* libRCTRestart.a */,
|
||||||
F992F2D99E614DD79FAD6565 /* libRNNodeJsMobile.a */,
|
|
||||||
90224CB4571D41C4969E9722 /* libGCDWebServers.a */,
|
90224CB4571D41C4969E9722 /* libGCDWebServers.a */,
|
||||||
F710D85E391D4094816E1B62 /* libRealmJS.a */,
|
F710D85E391D4094816E1B62 /* libRealmJS.a */,
|
||||||
F79F72C5390646E0A06AAE68 /* RealmJSTests.xctest */,
|
F79F72C5390646E0A06AAE68 /* RealmJSTests.xctest */,
|
||||||
@@ -267,8 +257,6 @@
|
|||||||
00E356EF1AD99517003FC87E /* dripTests */,
|
00E356EF1AD99517003FC87E /* dripTests */,
|
||||||
83CBBA001A601CBA00E9B192 /* Products */,
|
83CBBA001A601CBA00E9B192 /* Products */,
|
||||||
2D16E6871FA4F8E400B85C8A /* Frameworks */,
|
2D16E6871FA4F8E400B85C8A /* Frameworks */,
|
||||||
6466AE2461BE4FA88B8372F0 /* nodejs-project */,
|
|
||||||
36F1B55D0DEE47AA9AF4BBDD /* builtin_modules */,
|
|
||||||
42C7F9942202468200F22656 /* Recovered References */,
|
42C7F9942202468200F22656 /* Recovered References */,
|
||||||
6817ABC38854EEB6D3EE933A /* Pods */,
|
6817ABC38854EEB6D3EE933A /* Pods */,
|
||||||
006C39A0B9774387BC5ACA43 /* Resources */,
|
006C39A0B9774387BC5ACA43 /* Resources */,
|
||||||
@@ -298,7 +286,6 @@
|
|||||||
00E356EA1AD99517003FC87E /* Sources */,
|
00E356EA1AD99517003FC87E /* Sources */,
|
||||||
00E356EB1AD99517003FC87E /* Frameworks */,
|
00E356EB1AD99517003FC87E /* Frameworks */,
|
||||||
00E356EC1AD99517003FC87E /* Resources */,
|
00E356EC1AD99517003FC87E /* Resources */,
|
||||||
22A5D3F7F84BDF2020F07B0E /* [CP] Embed Pods Frameworks */,
|
|
||||||
46313D848A7A3E69E5ED05E7 /* [CP] Copy Pods Resources */,
|
46313D848A7A3E69E5ED05E7 /* [CP] Copy Pods Resources */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
@@ -320,14 +307,6 @@
|
|||||||
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
||||||
13B07F8E1A680F5B00A75B9A /* Resources */,
|
13B07F8E1A680F5B00A75B9A /* Resources */,
|
||||||
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
|
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 */,
|
616E70055A3365D214C7B201 /* [CP] Copy Pods Resources */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
@@ -412,8 +391,6 @@
|
|||||||
54DFE73A25D94D6E0025C3FC /* swipe.png in Resources */,
|
54DFE73A25D94D6E0025C3FC /* swipe.png in Resources */,
|
||||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
||||||
5472A44A25BB7806005E81DE /* drip-home-icons.ttf 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 */,
|
5472A45225BB7807005E81DE /* Jost-700-Bold.otf in Resources */,
|
||||||
5472A44E25BB7807005E81DE /* Prompt-ExtraLight.ttf in Resources */,
|
5472A44E25BB7807005E81DE /* Prompt-ExtraLight.ttf in Resources */,
|
||||||
);
|
);
|
||||||
@@ -436,34 +413,6 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.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 */ = {
|
46313D848A7A3E69E5ED05E7 /* [CP] Copy Pods Resources */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@@ -564,20 +513,6 @@
|
|||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-drip/Pods-drip-resources.sh\"\n";
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-drip/Pods-drip-resources.sh\"\n";
|
||||||
showEnvVarsInLog = 0;
|
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 */ = {
|
852A2E0CD5D0F561CE2927A3 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
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";
|
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;
|
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 */ = {
|
CD68B565C5F4A7A674494D02 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
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";
|
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;
|
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 */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
@@ -737,8 +596,6 @@
|
|||||||
ENABLE_BITCODE = "$(inherited)";
|
ENABLE_BITCODE = "$(inherited)";
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"\"../node_modules/nodejs-mobile-react-native/ios\"",
|
|
||||||
"\"../node_modules/nodejs-mobile-react-native/ios\"",
|
|
||||||
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
|
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
|
||||||
);
|
);
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
@@ -753,7 +610,6 @@
|
|||||||
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
|
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
|
||||||
"$(SRCROOT)/../node_modules/react-native-fs/**",
|
"$(SRCROOT)/../node_modules/react-native-fs/**",
|
||||||
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
|
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
|
||||||
"$(SRCROOT)/../node_modules/nodejs-mobile-react-native/ios/**",
|
|
||||||
"$(SRCROOT)/../node_modules/realm/src/**",
|
"$(SRCROOT)/../node_modules/realm/src/**",
|
||||||
);
|
);
|
||||||
INFOPLIST_FILE = dripTests/Info.plist;
|
INFOPLIST_FILE = dripTests/Info.plist;
|
||||||
@@ -785,8 +641,6 @@
|
|||||||
ENABLE_BITCODE = "$(inherited)";
|
ENABLE_BITCODE = "$(inherited)";
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"\"../node_modules/nodejs-mobile-react-native/ios\"",
|
|
||||||
"\"../node_modules/nodejs-mobile-react-native/ios\"",
|
|
||||||
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
|
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
|
||||||
);
|
);
|
||||||
HEADER_SEARCH_PATHS = (
|
HEADER_SEARCH_PATHS = (
|
||||||
@@ -797,7 +651,6 @@
|
|||||||
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
|
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
|
||||||
"$(SRCROOT)/../node_modules/react-native-fs/**",
|
"$(SRCROOT)/../node_modules/react-native-fs/**",
|
||||||
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
|
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
|
||||||
"$(SRCROOT)/../node_modules/nodejs-mobile-react-native/ios/**",
|
|
||||||
"$(SRCROOT)/../node_modules/realm/src/**",
|
"$(SRCROOT)/../node_modules/realm/src/**",
|
||||||
);
|
);
|
||||||
INFOPLIST_FILE = dripTests/Info.plist;
|
INFOPLIST_FILE = dripTests/Info.plist;
|
||||||
@@ -832,10 +685,7 @@
|
|||||||
ENABLE_BITCODE = "$(inherited)";
|
ENABLE_BITCODE = "$(inherited)";
|
||||||
EXCLUDED_ARCHS = "";
|
EXCLUDED_ARCHS = "";
|
||||||
"EXCLUDED_ARCHS[sdk=*]" = "";
|
"EXCLUDED_ARCHS[sdk=*]" = "";
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||||
"$(inherited)",
|
|
||||||
"\"../node_modules/nodejs-mobile-react-native/ios\"",
|
|
||||||
);
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
"COCOAPODS=1",
|
"COCOAPODS=1",
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@@ -848,7 +698,6 @@
|
|||||||
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
|
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
|
||||||
"$(SRCROOT)/../node_modules/react-native-fs/**",
|
"$(SRCROOT)/../node_modules/react-native-fs/**",
|
||||||
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
|
"$(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/@react-native-community/push-notification-ios/ios",
|
||||||
"$(SRCROOT)/../node_modules/realm/src/**",
|
"$(SRCROOT)/../node_modules/realm/src/**",
|
||||||
);
|
);
|
||||||
@@ -883,7 +732,6 @@
|
|||||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RealmJS\"",
|
"\"${PODS_CONFIGURATION_BUILD_DIR}/RealmJS\"",
|
||||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga\"",
|
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga\"",
|
||||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/glog\"",
|
"\"${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-document-picker\"",
|
||||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-restart\"",
|
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-restart\"",
|
||||||
"\"${PODS_ROOT}/../../node_modules/realm/vendor/realm-ios\"",
|
"\"${PODS_ROOT}/../../node_modules/realm/vendor/realm-ios\"",
|
||||||
@@ -915,10 +763,7 @@
|
|||||||
DEVELOPMENT_TEAM = 6AD72X6W26;
|
DEVELOPMENT_TEAM = 6AD72X6W26;
|
||||||
ENABLE_BITCODE = "$(inherited)";
|
ENABLE_BITCODE = "$(inherited)";
|
||||||
EXCLUDED_ARCHS = "";
|
EXCLUDED_ARCHS = "";
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||||
"$(inherited)",
|
|
||||||
"\"../node_modules/nodejs-mobile-react-native/ios\"",
|
|
||||||
);
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
"COCOAPODS=1",
|
"COCOAPODS=1",
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@@ -931,7 +776,6 @@
|
|||||||
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
|
"$(SRCROOT)/../node_modules/react-native-document-picker/ios/RNDocumentPicker",
|
||||||
"$(SRCROOT)/../node_modules/react-native-fs/**",
|
"$(SRCROOT)/../node_modules/react-native-fs/**",
|
||||||
"$(SRCROOT)/../node_modules/react-native-restart/ios/RCTRestart/**",
|
"$(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/@react-native-community/push-notification-ios/ios",
|
||||||
"$(SRCROOT)/../node_modules/realm/src/**",
|
"$(SRCROOT)/../node_modules/realm/src/**",
|
||||||
);
|
);
|
||||||
@@ -966,7 +810,6 @@
|
|||||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/RealmJS\"",
|
"\"${PODS_CONFIGURATION_BUILD_DIR}/RealmJS\"",
|
||||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga\"",
|
"\"${PODS_CONFIGURATION_BUILD_DIR}/Yoga\"",
|
||||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/glog\"",
|
"\"${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-document-picker\"",
|
||||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-restart\"",
|
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-restart\"",
|
||||||
"\"${PODS_ROOT}/../../node_modules/realm/vendor/realm-ios\"",
|
"\"${PODS_ROOT}/../../node_modules/realm/vendor/realm-ios\"",
|
||||||
|
|||||||
@@ -5,4 +5,8 @@ module.exports = {
|
|||||||
transformIgnorePatterns: [
|
transformIgnorePatterns: [
|
||||||
'node_modules/(?!((jest-)?react-native(-.*)?|@react-native(-community)?)/)',
|
'node_modules/(?!((jest-)?react-native(-.*)?|@react-native(-community)?)/)',
|
||||||
],
|
],
|
||||||
|
watchPlugins: [
|
||||||
|
'jest-watch-typeahead/filename',
|
||||||
|
'jest-watch-typeahead/testname',
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default function config(opts) {
|
|||||||
bleedingDaysSortedByDate = require('../db').getBleedingDaysSortedByDate()
|
bleedingDaysSortedByDate = require('../db').getBleedingDaysSortedByDate()
|
||||||
cycleStartsSortedByDate = require('../db').getCycleStartsSortedByDate()
|
cycleStartsSortedByDate = require('../db').getCycleStartsSortedByDate()
|
||||||
cycleDaysSortedByDate = require('../db').getCycleDaysSortedByDate()
|
cycleDaysSortedByDate = require('../db').getCycleDaysSortedByDate()
|
||||||
|
|
||||||
maxBreakInBleeding = 1
|
maxBreakInBleeding = 1
|
||||||
maxCycleLength = 99
|
maxCycleLength = 99
|
||||||
minCyclesForPrediction = 3
|
minCyclesForPrediction = 3
|
||||||
@@ -222,6 +223,19 @@ export default function config(opts) {
|
|||||||
return predictedMenses
|
return predictedMenses
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getStats = () =>
|
||||||
|
cycleStartsSortedByDate.map((day, i) => {
|
||||||
|
const today = getTodayDate()
|
||||||
|
const cycleLength =
|
||||||
|
i === 0 ? getCycleDayNumber(today) : getAllCycleLengths()[i - 1]
|
||||||
|
|
||||||
|
return {
|
||||||
|
date: day.date,
|
||||||
|
cycleLength,
|
||||||
|
bleedingLength: ++getMensesDaysRightAfter(day).length,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getCycleDayNumber,
|
getCycleDayNumber,
|
||||||
getCycleForDay,
|
getCycleForDay,
|
||||||
@@ -232,5 +246,6 @@ export default function config(opts) {
|
|||||||
isMensesStart,
|
isMensesStart,
|
||||||
getMensesDaysRightAfter,
|
getMensesDaysRightAfter,
|
||||||
getCycleByStartDay,
|
getCycleByStartDay,
|
||||||
|
getStats,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
import getColumnNamesForCsv from './get-csv-column-names'
|
import getColumnNamesForCsv from './get-csv-column-names'
|
||||||
import replaceWithNullIfAllPropertiesAreNull from './replace-with-null'
|
import replaceWithNullIfAllPropertiesAreNull from './replace-with-null'
|
||||||
import { LocalDate } from '@js-joda/core'
|
import { LocalDate } from '@js-joda/core'
|
||||||
import labels from '../../i18n/en/settings'
|
import i18next from 'i18next'
|
||||||
|
|
||||||
export default async function importCsv(csv, deleteFirst) {
|
export default async function importCsv(csv, deleteFirst) {
|
||||||
const parseFuncs = {
|
const parseFuncs = {
|
||||||
@@ -46,7 +46,10 @@ export default async function importCsv(csv, deleteFirst) {
|
|||||||
|
|
||||||
const cycleDays = await csvParser(config)
|
const cycleDays = await csvParser(config)
|
||||||
.fromString(csv)
|
.fromString(csv)
|
||||||
.on('header', validateHeaders)
|
.on('header', (headers) => validateHeaders(headers))
|
||||||
|
.on('error', (error) => {
|
||||||
|
throw error
|
||||||
|
})
|
||||||
|
|
||||||
//remove symptoms where all fields are null
|
//remove symptoms where all fields are null
|
||||||
putNullForEmptySymptoms(cycleDays)
|
putNullForEmptySymptoms(cycleDays)
|
||||||
@@ -67,8 +70,11 @@ function validateHeaders(headers) {
|
|||||||
return expectedHeaders.indexOf(header) > -1
|
return expectedHeaders.indexOf(header) > -1
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
const msg = `Expected CSV column titles to be ${expectedHeaders.join()}`
|
throw new Error(
|
||||||
throw new Error(msg)
|
i18next.t('hamburgerMenu.settings.data.import.error.incorrectColumns', {
|
||||||
|
incorrectColumns: expectedHeaders.join(),
|
||||||
|
})
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +98,9 @@ function throwIfFutureData(cycleDays) {
|
|||||||
day.date > today &&
|
day.date > today &&
|
||||||
Object.keys(day).some((symptom) => symptom != 'date' && symptom != 'note')
|
Object.keys(day).some((symptom) => symptom != 'date' && symptom != 'note')
|
||||||
) {
|
) {
|
||||||
throw new Error(labels.import.errors.futureEdit)
|
throw new Error(
|
||||||
|
i18next.t('hamburgerMenu.settings.data.import.error.futureEdit')
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -1,17 +1,16 @@
|
|||||||
export default function (feeling, texture) {
|
export default function getSensiplanMucus(feeling, texture) {
|
||||||
|
|
||||||
if (typeof feeling != 'number' || typeof texture != 'number') return null
|
if (typeof feeling != 'number' || typeof texture != 'number') return null
|
||||||
|
|
||||||
const feelingMapping = {
|
const feelingMapping = {
|
||||||
0: 0,
|
0: 0,
|
||||||
1: 1,
|
1: 1,
|
||||||
2: 2,
|
2: 2,
|
||||||
3: 4
|
3: 4,
|
||||||
}
|
}
|
||||||
const textureMapping = {
|
const textureMapping = {
|
||||||
0: 0,
|
0: 0,
|
||||||
1: 3,
|
1: 3,
|
||||||
2: 4
|
2: 4,
|
||||||
}
|
}
|
||||||
const nfpFeelingValue = feelingMapping[feeling]
|
const nfpFeelingValue = feelingMapping[feeling]
|
||||||
const nfpTextureValue = textureMapping[texture]
|
const nfpTextureValue = textureMapping[texture]
|
||||||
|
|||||||
+21
-7
@@ -1,8 +1,10 @@
|
|||||||
|
import { Platform } from 'react-native'
|
||||||
import {
|
import {
|
||||||
tempReminderObservable,
|
tempReminderObservable,
|
||||||
periodReminderObservable,
|
periodReminderObservable,
|
||||||
} from '../local-storage'
|
} from '../local-storage'
|
||||||
import Notification from 'react-native-push-notification'
|
import * as PN from 'react-native-push-notification'
|
||||||
|
import { requestNotifications } from 'react-native-permissions'
|
||||||
import Moment from 'moment'
|
import Moment from 'moment'
|
||||||
import { LocalDate } from '@js-joda/core'
|
import { LocalDate } from '@js-joda/core'
|
||||||
|
|
||||||
@@ -12,7 +14,16 @@ import cycleModule from './cycle'
|
|||||||
import nothingChanged from '../db/db-unchanged'
|
import nothingChanged from '../db/db-unchanged'
|
||||||
|
|
||||||
export default function setupNotifications(navigate, setDate) {
|
export default function setupNotifications(navigate, setDate) {
|
||||||
Notification.configure({
|
requestNotifications()
|
||||||
|
const PushNotification = Platform.OS === 'ios' ? PN : PN.default
|
||||||
|
|
||||||
|
PushNotification.createChannel({
|
||||||
|
channelId: 'drip-channel-id', // (required)
|
||||||
|
channelName: 'drip reminder', // (required)
|
||||||
|
playSound: false, // (optional) default: true
|
||||||
|
})
|
||||||
|
|
||||||
|
PushNotification.configure({
|
||||||
onNotification: (notification) => {
|
onNotification: (notification) => {
|
||||||
// https://github.com/zo0r/react-native-push-notification/issues/966#issuecomment-479069106
|
// https://github.com/zo0r/react-native-push-notification/issues/966#issuecomment-479069106
|
||||||
if (notification.data?.id === '1' || notification.id === '1') {
|
if (notification.data?.id === '1' || notification.id === '1') {
|
||||||
@@ -26,7 +37,7 @@ export default function setupNotifications(navigate, setDate) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
tempReminderObservable((reminder) => {
|
tempReminderObservable((reminder) => {
|
||||||
Notification.cancelLocalNotifications({ id: '1' })
|
PushNotification.cancelLocalNotification({ id: '1' })
|
||||||
if (reminder.enabled) {
|
if (reminder.enabled) {
|
||||||
const [hours, minutes] = reminder.time.split(':')
|
const [hours, minutes] = reminder.time.split(':')
|
||||||
let target = new Moment()
|
let target = new Moment()
|
||||||
@@ -38,31 +49,33 @@ export default function setupNotifications(navigate, setDate) {
|
|||||||
target = target.add(1, 'd')
|
target = target.add(1, 'd')
|
||||||
}
|
}
|
||||||
|
|
||||||
Notification.localNotificationSchedule({
|
PushNotification.localNotificationSchedule({
|
||||||
id: '1',
|
id: '1',
|
||||||
userInfo: { id: '1' },
|
userInfo: { id: '1' },
|
||||||
message: labels.tempReminder.notification,
|
message: labels.tempReminder.notification,
|
||||||
date: target.toDate(),
|
date: target.toDate(),
|
||||||
vibrate: false,
|
vibrate: false,
|
||||||
repeatType: 'day',
|
repeatType: 'day',
|
||||||
|
channelId: 'drip-channel-id',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, false)
|
}, false)
|
||||||
|
|
||||||
periodReminderObservable((reminder) => {
|
periodReminderObservable((reminder) => {
|
||||||
Notification.cancelLocalNotifications({ id: '2' })
|
PushNotification.cancelLocalNotification({ id: '2' })
|
||||||
if (reminder.enabled) setupPeriodReminder()
|
if (reminder.enabled) setupPeriodReminder()
|
||||||
}, false)
|
}, false)
|
||||||
|
|
||||||
getBleedingDaysSortedByDate().addListener((_, changes) => {
|
getBleedingDaysSortedByDate().addListener((_, changes) => {
|
||||||
// the listener fires on setup, so we check if there were actually any changes
|
// the listener fires on setup, so we check if there were actually any changes
|
||||||
if (nothingChanged(changes)) return
|
if (nothingChanged(changes)) return
|
||||||
Notification.cancelLocalNotifications({ id: '2' })
|
PushNotification.cancelLocalNotification({ id: '2' })
|
||||||
if (periodReminderObservable.value.enabled) setupPeriodReminder()
|
if (periodReminderObservable.value.enabled) setupPeriodReminder()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupPeriodReminder() {
|
function setupPeriodReminder() {
|
||||||
|
const PushNotification = Platform.OS === 'ios' ? PN : PN.default
|
||||||
const bleedingPrediction = cycleModule().getPredictedMenses()
|
const bleedingPrediction = cycleModule().getPredictedMenses()
|
||||||
if (bleedingPrediction.length > 0) {
|
if (bleedingPrediction.length > 0) {
|
||||||
const predictedBleedingStart = Moment(
|
const predictedBleedingStart = Moment(
|
||||||
@@ -80,12 +93,13 @@ function setupPeriodReminder() {
|
|||||||
// period is likely to start in 3 to 3 + (length of prediction - 1) days
|
// period is likely to start in 3 to 3 + (length of prediction - 1) days
|
||||||
const daysToEndOfPrediction = bleedingPrediction[0].length + 2
|
const daysToEndOfPrediction = bleedingPrediction[0].length + 2
|
||||||
|
|
||||||
Notification.localNotificationSchedule({
|
PushNotification.localNotificationSchedule({
|
||||||
id: '2',
|
id: '2',
|
||||||
userInfo: { id: '2' },
|
userInfo: { id: '2' },
|
||||||
message: labels.periodReminder.notification(daysToEndOfPrediction),
|
message: labels.periodReminder.notification(daysToEndOfPrediction),
|
||||||
date: reminderDate.toDate(),
|
date: reminderDate.toDate(),
|
||||||
vibrate: false,
|
vibrate: false,
|
||||||
|
channelId: 'drip-channel-id',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"
|
|
||||||
}
|
|
||||||
+15
-15
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "drip.",
|
"name": "drip.",
|
||||||
"version": "1.2208.11",
|
"version": "1.2311.14",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Julia Friesel <julia.friesel@gmail.com>",
|
"Julia Friesel <julia.friesel@gmail.com>",
|
||||||
"Marie Kochsiek",
|
"Marie Kochsiek",
|
||||||
@@ -34,23 +34,23 @@
|
|||||||
"@react-native-async-storage/async-storage": "^1.17.9",
|
"@react-native-async-storage/async-storage": "^1.17.9",
|
||||||
"@react-native-community/art": "^1.2.0",
|
"@react-native-community/art": "^1.2.0",
|
||||||
"@react-native-community/datetimepicker": "^6.3.1",
|
"@react-native-community/datetimepicker": "^6.3.1",
|
||||||
"@react-native-community/push-notification-ios": "^1.8.0",
|
"@react-native-community/push-notification-ios": "^1.11.0",
|
||||||
"csvtojson": "^2.0.8",
|
"csvtojson": "^2.0.8",
|
||||||
"i18next": "^21.9.0",
|
"i18next": "^22.0.2",
|
||||||
|
"jshashes": "^1.0.8",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"nodejs-mobile-react-native": "^0.8.2",
|
|
||||||
"object-path": "^0.11.4",
|
"object-path": "^0.11.4",
|
||||||
"obv": "0.0.1",
|
"obv": "0.0.1",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-i18next": "^11.18.3",
|
"react-i18next": "^12.0.0",
|
||||||
"react-native": "0.67.4",
|
"react-native": "0.67.4",
|
||||||
"react-native-calendars": "^1.1287.0",
|
"react-native-calendars": "^1.1287.0",
|
||||||
"react-native-document-picker": "^8.1.1",
|
"react-native-document-picker": "^8.1.1",
|
||||||
"react-native-fs": "^2.20.0",
|
"react-native-fs": "^2.20.0",
|
||||||
"react-native-hyperlink": "0.0.19",
|
|
||||||
"react-native-modal-datetime-picker": "14.0.0",
|
"react-native-modal-datetime-picker": "14.0.0",
|
||||||
"react-native-push-notification": "3.2.1",
|
"react-native-permissions": "^3.10.0",
|
||||||
|
"react-native-push-notification": "github:bl00dymarie/react-native-push-notification",
|
||||||
"react-native-share": "^7.9.0",
|
"react-native-share": "^7.9.0",
|
||||||
"react-native-simple-toast": "^1.1.3",
|
"react-native-simple-toast": "^1.1.3",
|
||||||
"react-native-size-matters": "^0.4.0",
|
"react-native-size-matters": "^0.4.0",
|
||||||
@@ -59,18 +59,18 @@
|
|||||||
"sympto": "3.0.1"
|
"sympto": "3.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.12.9",
|
"@babel/core": "^7.20.2",
|
||||||
"@babel/eslint-parser": "^7.16.3",
|
"@babel/eslint-parser": "^7.19.1",
|
||||||
"@babel/preset-react": "^7.16.0",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/runtime": "^7.12.5",
|
"@babel/runtime": "^7.12.5",
|
||||||
"@testing-library/jest-native": "^4.0.12",
|
"@testing-library/jest-native": "^4.0.12",
|
||||||
"@testing-library/react-native": "^11.1.0",
|
"@testing-library/react-native": "^11.1.0",
|
||||||
"basic-changelog": "gitlab:bloodyhealth/basic-changelog",
|
"eslint": "^7.32.0",
|
||||||
"eslint": "7.14.0",
|
"eslint-plugin-react": "^7.31.10",
|
||||||
"eslint-plugin-react": "^7.8.2",
|
|
||||||
"husky": "^8.0.0",
|
"husky": "^8.0.0",
|
||||||
"jest": "^28.1.3",
|
"jest": "^29.1.2",
|
||||||
"jetifier": "^1.6.6",
|
"jest-watch-typeahead": "^2.2.0",
|
||||||
|
"jetifier": "^2.0.0",
|
||||||
"metro-react-native-babel-preset": "^0.66.2",
|
"metro-react-native-babel-preset": "^0.66.2",
|
||||||
"prettier": "2.4.0",
|
"prettier": "2.4.0",
|
||||||
"pretty-quick": "^3.1.1",
|
"pretty-quick": "^3.1.1",
|
||||||
|
|||||||
@@ -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\/.*/
|
|
||||||
])
|
|
||||||
},
|
|
||||||
}
|
|
||||||
+18
-10
@@ -1,7 +1,14 @@
|
|||||||
const redColor = '#c3000d'
|
const redColor = '#c3000d'
|
||||||
export const shadesOfRed = ['#e7999e', '#db666d', '#cf323d', '#c3000d'] // light to dark
|
export const shadesOfRed = ['#e7999e', '#db666d', '#cf323d', '#c3000d'] // light to dark
|
||||||
const violetColor = '#6a7b98'
|
const violetColor = '#6a7b98'
|
||||||
const shadesOfViolet = ['#e3e7ed', '#c8cfdc', '#acb8cb', '#91a0ba', '#7689a9', violetColor] // light to dark
|
const shadesOfViolet = [
|
||||||
|
'#e3e7ed',
|
||||||
|
'#c8cfdc',
|
||||||
|
'#acb8cb',
|
||||||
|
'#91a0ba',
|
||||||
|
'#7689a9',
|
||||||
|
violetColor,
|
||||||
|
] // light to dark
|
||||||
const yellowColor = '#dbb40c'
|
const yellowColor = '#dbb40c'
|
||||||
const shadesOfYellow = ['#f0e19d', '#e9d26d', '#e2c33c', yellowColor] // light to dark
|
const shadesOfYellow = ['#f0e19d', '#e9d26d', '#e2c33c', yellowColor] // light to dark
|
||||||
const magentaColor = '#6f2565'
|
const magentaColor = '#6f2565'
|
||||||
@@ -16,6 +23,7 @@ export default {
|
|||||||
greyDark: '#555',
|
greyDark: '#555',
|
||||||
grey: '#888',
|
grey: '#888',
|
||||||
greyLight: '#CCC',
|
greyLight: '#CCC',
|
||||||
|
greyVeryLight: '#F4F4F4',
|
||||||
orange: '#F38337',
|
orange: '#F38337',
|
||||||
purple: '#3A2671',
|
purple: '#3A2671',
|
||||||
purpleLight: '#938EB2',
|
purpleLight: '#938EB2',
|
||||||
@@ -23,37 +31,37 @@ export default {
|
|||||||
turquoise: '#CFECEA',
|
turquoise: '#CFECEA',
|
||||||
turquoiseLight: '#E9F2ED',
|
turquoiseLight: '#E9F2ED',
|
||||||
iconColors: {
|
iconColors: {
|
||||||
'bleeding': {
|
bleeding: {
|
||||||
color: redColor,
|
color: redColor,
|
||||||
shades: shadesOfRed,
|
shades: shadesOfRed,
|
||||||
},
|
},
|
||||||
'mucus': {
|
mucus: {
|
||||||
color: violetColor,
|
color: violetColor,
|
||||||
shades: shadesOfViolet,
|
shades: shadesOfViolet,
|
||||||
},
|
},
|
||||||
'cervix': {
|
cervix: {
|
||||||
color: yellowColor,
|
color: yellowColor,
|
||||||
shades: shadesOfYellow,
|
shades: shadesOfYellow,
|
||||||
},
|
},
|
||||||
'sex': {
|
sex: {
|
||||||
color: magentaColor,
|
color: magentaColor,
|
||||||
shades: shadesOfMagenta,
|
shades: shadesOfMagenta,
|
||||||
},
|
},
|
||||||
'desire': {
|
desire: {
|
||||||
color: pinkColor,
|
color: pinkColor,
|
||||||
shades: shadesOfPink,
|
shades: shadesOfPink,
|
||||||
},
|
},
|
||||||
'pain': {
|
pain: {
|
||||||
color: lightGreenColor,
|
color: lightGreenColor,
|
||||||
shades: [lightGreenColor],
|
shades: [lightGreenColor],
|
||||||
},
|
},
|
||||||
'mood': {
|
mood: {
|
||||||
color: orangeColor,
|
color: orangeColor,
|
||||||
shades: [orangeColor],
|
shades: [orangeColor],
|
||||||
},
|
},
|
||||||
'note': {
|
note: {
|
||||||
color: mintColor,
|
color: mintColor,
|
||||||
shades: [mintColor],
|
shades: [mintColor],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-6
@@ -9,7 +9,7 @@ export default {
|
|||||||
marginTop: Spacing.small,
|
marginTop: Spacing.small,
|
||||||
marginRight: Spacing.small,
|
marginRight: Spacing.small,
|
||||||
paddingHorizontal: Spacing.small,
|
paddingHorizontal: Spacing.small,
|
||||||
paddingVertical: Spacing.tiny
|
paddingVertical: Spacing.tiny,
|
||||||
},
|
},
|
||||||
boxActive: {
|
boxActive: {
|
||||||
backgroundColor: Colors.orange,
|
backgroundColor: Colors.orange,
|
||||||
@@ -17,17 +17,25 @@ export default {
|
|||||||
centerItems: {
|
centerItems: {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center'
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
pageContainer: {
|
||||||
|
backgroundColor: Colors.turquoiseLight,
|
||||||
|
flex: 1,
|
||||||
},
|
},
|
||||||
rowContainer: {
|
rowContainer: {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between'
|
justifyContent: 'space-between',
|
||||||
},
|
},
|
||||||
selectGroupContainer: {
|
selectGroupContainer: {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
marginVertical: Spacing.small
|
marginVertical: Spacing.small,
|
||||||
}
|
},
|
||||||
}
|
segmentContainer: {
|
||||||
|
marginHorizontal: Spacing.base,
|
||||||
|
marginBottom: Spacing.base,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import AcceptLicense from '../components/AcceptLicense'
|
||||||
|
|
||||||
|
import { saveLicenseFlag } from '../local-storage'
|
||||||
|
import { render, screen, fireEvent } from './test-utils'
|
||||||
|
|
||||||
|
jest.mock('../local-storage', () => ({
|
||||||
|
saveLicenseFlag: jest.fn(() => Promise.resolve()),
|
||||||
|
}))
|
||||||
|
|
||||||
|
describe('AcceptLicense', () => {
|
||||||
|
test('should accept license when clicking ok button', async () => {
|
||||||
|
const mockedSetLicense = jest.fn()
|
||||||
|
render(<AcceptLicense setLicense={mockedSetLicense} />)
|
||||||
|
|
||||||
|
const okButton = screen.getByText('OK')
|
||||||
|
|
||||||
|
fireEvent(okButton, 'click')
|
||||||
|
|
||||||
|
await expect(saveLicenseFlag).toHaveBeenCalled()
|
||||||
|
expect(mockedSetLicense).toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
|
||||||
|
test('should render cancel button', async () => {
|
||||||
|
render(<AcceptLicense setLicense={jest.fn()} />)
|
||||||
|
|
||||||
|
screen.getByText('Cancel')
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import License from '../components/settings/License'
|
||||||
|
import { render, screen } from './test-utils'
|
||||||
|
|
||||||
|
describe('License screen', () => {
|
||||||
|
test('should display license text with correct year', async () => {
|
||||||
|
render(<License />)
|
||||||
|
const year = new Date().getFullYear().toString()
|
||||||
|
|
||||||
|
screen.getByText(year, { exact: false })
|
||||||
|
})
|
||||||
|
|
||||||
|
test('should match the snapshot', async () => {
|
||||||
|
const licenseScreen = render(<License />)
|
||||||
|
|
||||||
|
expect(licenseScreen).toMatchSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`License screen should match the snapshot 1`] = `
|
||||||
|
<View
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
"backgroundColor": "#E9F2ED",
|
||||||
|
"flex": 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<RCTScrollView
|
||||||
|
contentContainerStyle={
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backgroundColor": "#E9F2ED",
|
||||||
|
"flexGrow": 1,
|
||||||
|
},
|
||||||
|
undefined,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"color": "#555",
|
||||||
|
"fontFamily": "Jost-Book",
|
||||||
|
"fontSize": 34.285714285714285,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alignSelf": "center",
|
||||||
|
"color": "#3A2671",
|
||||||
|
"fontFamily": "Jost-Bold",
|
||||||
|
"fontSize": 51.42857142857143,
|
||||||
|
"fontWeight": "700",
|
||||||
|
"marginHorizontal": 34.285714285714285,
|
||||||
|
"marginVertical": 42.857142857142854,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
>
|
||||||
|
drip. an open-source cycle tracking app
|
||||||
|
</Text>
|
||||||
|
<View
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
"marginBottom": 34.285714285714285,
|
||||||
|
"marginHorizontal": 34.285714285714285,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"color": "#555",
|
||||||
|
"fontFamily": "Jost-Book",
|
||||||
|
"fontSize": 34.285714285714285,
|
||||||
|
},
|
||||||
|
undefined,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Copyright (C) 2023 Heart of Code e.V.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
|
||||||
|
</Text>
|
||||||
|
<Text
|
||||||
|
onPress={[Function]}
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
"color": "#3A2671",
|
||||||
|
"fontFamily": "Jost-Book",
|
||||||
|
"fontSize": 34.285714285714285,
|
||||||
|
"textDecorationLine": "underline",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
https://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</RCTScrollView>
|
||||||
|
</View>
|
||||||
|
`;
|
||||||
@@ -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()
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`Footnote component when children are present, renders them 1`] = `
|
||||||
|
<View
|
||||||
|
style={
|
||||||
|
{
|
||||||
|
"alignContent": "flex-start",
|
||||||
|
"flexDirection": "row",
|
||||||
|
"marginBottom": 8.571428571428571,
|
||||||
|
"marginTop": 34.285714285714285,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"color": "#555",
|
||||||
|
"fontFamily": "Jost-Book",
|
||||||
|
"fontSize": 34.285714285714285,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "#F38337",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
>
|
||||||
|
*
|
||||||
|
</Text>
|
||||||
|
<Text
|
||||||
|
linkStyle={
|
||||||
|
{
|
||||||
|
"color": "white",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
style={
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"color": "#555",
|
||||||
|
"fontFamily": "Jost-Book",
|
||||||
|
"fontSize": 34.285714285714285,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "#555",
|
||||||
|
"paddingLeft": 21.428571428571427,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Some footnote text
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`Footnote component when no children, renders nothing 1`] = `null`;
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { humanizeDate } from '../../components/helpers/format-date'
|
||||||
|
|
||||||
|
describe('humanizeDate', () => {
|
||||||
|
test('if receives null, returns empty string', () => {
|
||||||
|
const result = humanizeDate(null)
|
||||||
|
|
||||||
|
expect(result).toEqual('')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('if receives undefined, returns empty string', () => {
|
||||||
|
const result = humanizeDate(undefined)
|
||||||
|
|
||||||
|
expect(result).toEqual('')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('if receives incorrectly formatted date, returns empty string', () => {
|
||||||
|
const result = humanizeDate('abc')
|
||||||
|
|
||||||
|
expect(result).toEqual('')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('if receives correct date string, returns date in humanized format', () => {
|
||||||
|
const result = humanizeDate('2022-01-07')
|
||||||
|
|
||||||
|
expect(result).toEqual('07. Jan 22')
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { render } from '@testing-library/react-native'
|
||||||
|
import '../i18n/i18n'
|
||||||
|
|
||||||
|
const customRender = (ui, options) => render(ui, { ...options })
|
||||||
|
|
||||||
|
// re-export everything
|
||||||
|
export * from '@testing-library/react-native'
|
||||||
|
|
||||||
|
// override render method
|
||||||
|
export { customRender as render }
|
||||||
@@ -50,14 +50,8 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pkgJSON = JSON.parse(fs.readFileSync('./package.json'))
|
const pkgJSON = JSON.parse(fs.readFileSync('./package.json'))
|
||||||
const pkgLockJSON = JSON.parse(fs.readFileSync('./package-lock.json'))
|
|
||||||
pkgJSON.version = nextVersion
|
pkgJSON.version = nextVersion
|
||||||
pkgLockJSON.version = nextVersion
|
|
||||||
fs.writeFileSync('./package.json', JSON.stringify(pkgJSON, null, 2))
|
fs.writeFileSync('./package.json', JSON.stringify(pkgJSON, null, 2))
|
||||||
fs.writeFileSync(
|
|
||||||
'./package-lock.json',
|
|
||||||
JSON.stringify(pkgLockJSON, null, 2)
|
|
||||||
)
|
|
||||||
|
|
||||||
await ReactNativeVersion.version(
|
await ReactNativeVersion.version(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user