Merge branch 'feature/ios-launch' into 'master'

Feature/ios launch

See merge request bloodyhealth/drip!351
This commit is contained in:
Sofiya Tepikin
2021-05-02 16:31:18 +00:00
24 changed files with 683 additions and 1630 deletions
+19 -5
View File
@@ -1,16 +1,18 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { StyleSheet, View } from 'react-native'
import { Provider } from 'react-redux'
import nodejs from 'nodejs-mobile-react-native' 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'
import App from './app' import App from './app'
import PasswordPrompt from './password-prompt'
import License from './license'
import AppLoadingView from './common/app-loading' import AppLoadingView from './common/app-loading'
import AppStatusBar from './common/app-status-bar'
import License from './license'
import PasswordPrompt from './password-prompt'
import store from "../store" import store from "../store"
import { Provider } from 'react-redux'
export default class AppWrapper extends Component { export default class AppWrapper extends Component {
constructor() { constructor() {
@@ -84,7 +86,19 @@ export default class AppWrapper extends Component {
initialView = <App /> initialView = <App />
} }
return <Provider store={store}>{initialView}</Provider> return (
<Provider store={store}>
<View style={styles.container}>
<AppStatusBar />
{initialView}
</View>
</Provider>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
} }
} })
+18 -6
View File
@@ -1,6 +1,13 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { ActivityIndicator, FlatList, Dimensions, StyleSheet, View } from 'react-native' import {
ActivityIndicator,
Dimensions,
FlatList,
PixelRatio,
StyleSheet,
View
} from 'react-native'
import AppLoadingView from '../common/app-loading' import AppLoadingView from '../common/app-loading'
import AppPage from '../common/app-page' import AppPage from '../common/app-page'
@@ -22,9 +29,10 @@ import { makeColumnInfo, nfpLines } from '../helpers/chart'
import { import {
CHART_COLUMN_WIDTH, CHART_COLUMN_WIDTH,
SYMPTOMS, CHART_GRID_LINE_HORIZONTAL_WIDTH,
CHART_SYMPTOM_HEIGHT_RATIO, CHART_SYMPTOM_HEIGHT_RATIO,
CHART_XAXIS_HEIGHT_RATIO CHART_XAXIS_HEIGHT_RATIO,
SYMPTOMS
} from '../../config' } from '../../config'
import { shared } from '../../i18n/en/labels' import { shared } from '../../i18n/en/labels'
import { Colors, Spacing } from '../../styles' import { Colors, Spacing } from '../../styles'
@@ -105,9 +113,13 @@ class CycleChart extends Component {
this.xAxisHeight = height * 0.7 * CHART_XAXIS_HEIGHT_RATIO this.xAxisHeight = height * 0.7 * CHART_XAXIS_HEIGHT_RATIO
const remainingHeight = height * 0.7 - this.xAxisHeight const remainingHeight = height * 0.7 - this.xAxisHeight
this.symptomHeight = remainingHeight * CHART_SYMPTOM_HEIGHT_RATIO this.symptomHeight = PixelRatio.roundToNearestPixel(
this.symptomRowHeight = this.symptomRowSymptoms.length * remainingHeight
this.symptomHeight * CHART_SYMPTOM_HEIGHT_RATIO
)
this.symptomRowHeight = PixelRatio.roundToNearestPixel(
this.symptomRowSymptoms.length * this.symptomHeight
) + CHART_GRID_LINE_HORIZONTAL_WIDTH
this.columnHeight = remainingHeight - this.symptomRowHeight this.columnHeight = remainingHeight - this.symptomRowHeight
const chartHeight = this.shouldShowTemperatureColumn ? const chartHeight = this.shouldShowTemperatureColumn ?
height * 0.7 : (this.symptomRowHeight + this.xAxisHeight) height * 0.7 : (this.symptomRowHeight + this.xAxisHeight)
+3 -4
View File
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types'
import AppText from '../common/app-text' import AppText from '../common/app-text'
import { Sizes } from '../../styles' import { Sizes } from '../../styles'
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
@@ -28,16 +29,14 @@ Tick.propTypes = {
const text = { const text = {
lineHeight: Sizes.base, textAlign: 'right',
right: 4,
textAlign: 'right'
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
justifyContent: 'center', justifyContent: 'center',
position: 'absolute', position: 'absolute',
right: 0, right: 0,
width: 40 width: CHART_TICK_WIDTH
}, },
textBold: { textBold: {
fontSize: Sizes.base, fontSize: Sizes.base,
+29
View File
@@ -0,0 +1,29 @@
import React from 'react'
import { SafeAreaView, StatusBar, StyleSheet, View } from 'react-native'
import { Colors } from '../../styles'
import { STATUSBAR_HEIGHT } from '../../config'
const AppStatusBar = () => (
<View style={styles.statusBar}>
<SafeAreaView>
<StatusBar
backgroundColor={Colors.purple}
barStyle="light-content"
translucent
/>
</SafeAreaView>
</View>
)
const styles = StyleSheet.create({
container: {
flex: 1,
},
statusBar: {
backgroundColor: Colors.purple,
height: STATUSBAR_HEIGHT,
}
})
export default AppStatusBar
+1
View File
@@ -38,6 +38,7 @@ const styles = StyleSheet.create({
marginTop: Spacing.base, marginTop: Spacing.base,
minWidth: '80%', minWidth: '80%',
paddingHorizontal: Spacing.base, paddingHorizontal: Spacing.base,
paddingVertical: Spacing.tiny,
...Typography.mainText ...Typography.mainText
} }
}) })
+2 -2
View File
@@ -5,7 +5,7 @@ import { StyleSheet, TouchableOpacity } from 'react-native'
import AppIcon from './app-icon' import AppIcon from './app-icon'
import AppText from './app-text' import AppText from './app-text'
import { Colors, Fonts, Spacing } from '../../styles' import { Colors, Fonts, Sizes, Spacing } from '../../styles'
const Button = ({ const Button = ({
children, children,
@@ -52,7 +52,7 @@ const text = {
} }
const textSmall = { const textSmall = {
fontSize: Fonts.small, fontSize: Sizes.small,
padding: Spacing.small, padding: Spacing.small,
textTransform: 'uppercase' textTransform: 'uppercase'
} }
+7 -4
View File
@@ -4,28 +4,31 @@ import { StyleSheet, TouchableOpacity } from 'react-native'
import AppIcon from './app-icon' import AppIcon from './app-icon'
import { HIT_SLOP} from '../../config'
import { Colors, Sizes } from '../../styles' import { Colors, Sizes } from '../../styles'
const CloseIcon = ({ onClose, ...props }) => { const CloseIcon = ({ onClose, color, ...props }) => {
return ( return (
<TouchableOpacity <TouchableOpacity
hitSlop={HIT_SLOP}
onPress={onClose} onPress={onClose}
style={styles.container} style={styles.container}
{...props} {...props}
> >
<AppIcon name='cross' color={Colors.orange} /> <AppIcon name='cross' color={color ? color : Colors.orange} />
</TouchableOpacity> </TouchableOpacity>
) )
} }
CloseIcon.propTypes = { CloseIcon.propTypes = {
onClose: PropTypes.func.isRequired onClose: PropTypes.func.isRequired,
color: PropTypes.string
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
alignSelf: 'flex-start', alignSelf: 'flex-start',
marginBottom: Sizes.base marginBottom: Sizes.base,
} }
}) })
+2 -1
View File
@@ -1,5 +1,5 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { StyleSheet, View } from 'react-native' import { Platform, StyleSheet, View } from 'react-native'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { Keyboard } from 'react-native' import { Keyboard } from 'react-native'
import DateTimePicker from 'react-native-modal-datetime-picker' import DateTimePicker from 'react-native-modal-datetime-picker'
@@ -127,6 +127,7 @@ class Temperature extends Component {
mode="time" mode="time"
onConfirm={this.setTime} onConfirm={this.setTime}
onCancel={this.onCancelTimePicker} onCancel={this.onCancelTimePicker}
display={Platform.OS === "ios" ? "spinner" : "default"}
/> />
</Segment> </Segment>
</React.Fragment> </React.Fragment>
+12 -7
View File
@@ -1,7 +1,14 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { Modal, StyleSheet, TouchableOpacity, View } from 'react-native' import {
Modal,
Platform,
StyleSheet,
TouchableOpacity,
View
} from 'react-native'
import AppIcon from '../common/app-icon' import AppIcon from '../common/app-icon'
import CloseIcon from '../common/close-icon'
import MenuItem from './menu-item' import MenuItem from './menu-item'
import { Colors, Sizes } from '../../styles' import { Colors, Sizes } from '../../styles'
@@ -49,12 +56,9 @@ export default class HamburgerMenu extends Component {
style={styles.blackBackground} style={styles.blackBackground}
></TouchableOpacity> ></TouchableOpacity>
<View style={styles.menu}> <View style={styles.menu}>
<TouchableOpacity <View style={styles.iconContainer}>
onPress={this.toggleMenu} <CloseIcon color={'black'} onClose={() => this.toggleMenu()} />
style={styles.iconContainer} </View>
>
<AppIcon name='cross' color='black' />
</TouchableOpacity>
{settingsMenuItems.map((item) => ( {settingsMenuItems.map((item) => (
<MenuItem <MenuItem
item={item} item={item}
@@ -85,6 +89,7 @@ const styles = StyleSheet.create({
backgroundColor: 'white', backgroundColor: 'white',
height: '100%', height: '100%',
padding: Sizes.base, padding: Sizes.base,
paddingTop: Platform.OS === 'ios' ? Sizes.huge : Sizes.base,
position: 'absolute', position: 'absolute',
width: '60%', width: '60%',
}, },
+9 -3
View File
@@ -1,4 +1,4 @@
import { PixelRatio } from 'react-native' import { Dimensions, PixelRatio, Platform, StatusBar } from 'react-native'
export const ACTION_DELETE = 'delete' export const ACTION_DELETE = 'delete'
export const ACTION_EXPORT = 'export' export const ACTION_EXPORT = 'export'
@@ -16,16 +16,20 @@ export const SYMPTOMS = [
'note', 'note',
] ]
export const fontRatio = PixelRatio.getFontScale() const windowWidth = Dimensions.get('window').width
const factor = (windowWidth < 1000) && (Platform.OS === 'ios') ? 1.25 : 1
export const fontRatio = PixelRatio.getFontScale() * factor
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 = 6 export const CHART_DOT_RADIUS = 6
export const CHART_GRID_LINE_HORIZONTAL_WIDTH = 0.3 export const CHART_GRID_LINE_HORIZONTAL_WIDTH =
PixelRatio.roundToNearestPixel(0.3)
export const CHART_ICON_SIZE = 20 export const CHART_ICON_SIZE = 20
export const CHART_STROKE_WIDTH = 3 export const CHART_STROKE_WIDTH = 3
export const CHART_SYMPTOM_HEIGHT_RATIO = 0.08 export const CHART_SYMPTOM_HEIGHT_RATIO = 0.08
export const CHART_XAXIS_HEIGHT_RATIO = 0.1 export const CHART_XAXIS_HEIGHT_RATIO = 0.1
export const CHART_YAXIS_WIDTH = 32 export const CHART_YAXIS_WIDTH = 32
export const CHART_TICK_WIDTH = 44
export const TEMP_SCALE_MAX = 37.5 export const TEMP_SCALE_MAX = 37.5
export const TEMP_SCALE_MIN = 35.5 export const TEMP_SCALE_MIN = 35.5
@@ -35,3 +39,5 @@ export const TEMP_MIN = 35
export const TEMP_SLIDER_STEP = 0.5 export const TEMP_SLIDER_STEP = 0.5
export const HIT_SLOP = { top: 20, bottom: 20, left: 20, right: 20 } export const HIT_SLOP = { top: 20, bottom: 20, left: 20, right: 20 }
export const STATUSBAR_HEIGHT = StatusBar.currentHeight
+44
View File
@@ -0,0 +1,44 @@
platform :ios, '10.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'drip' do
# Pods for drip
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-ART', :path => '../node_modules/react-native/Libraries/ART'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'dripTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
use_frameworks!
end
+12 -13
View File
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@@ -22,6 +22,17 @@
<string>1</string> <string>1</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key> <key>UIRequiredDeviceCapabilities</key>
@@ -38,17 +49,5 @@
<false/> <false/>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
<string></string> <string></string>
<key>NSAppTransportSecurity</key>
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
</dict> </dict>
</plist> </plist>
File diff suppressed because it is too large Load Diff
@@ -1,129 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D2A28121D9B038B00D4039D"
BuildableName = "libReact.a"
BlueprintName = "React-tvOS"
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "drip-tvOS.app"
BlueprintName = "drip-tvOS"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
BuildableName = "drip-tvOSTests.xctest"
BlueprintName = "drip-tvOSTests"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
BuildableName = "drip-tvOSTests.xctest"
BlueprintName = "drip-tvOSTests"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "drip-tvOS.app"
BlueprintName = "drip-tvOS"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "drip-tvOS.app"
BlueprintName = "drip-tvOS"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "drip-tvOS.app"
BlueprintName = "drip-tvOS"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,129 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0620"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "libReact.a"
BlueprintName = "React"
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "drip.app"
BlueprintName = "drip"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "dripTests.xctest"
BlueprintName = "dripTests"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "dripTests.xctest"
BlueprintName = "dripTests"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "drip.app"
BlueprintName = "drip"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "drip.app"
BlueprintName = "drip"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "drip.app"
BlueprintName = "drip"
ReferencedContainer = "container:drip.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:drip.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
+2 -1
View File
@@ -6,8 +6,9 @@
*/ */
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <UserNotifications/UNUserNotificationCenter.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate> @interface AppDelegate : UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate>
@property (nonatomic, strong) UIWindow *window; @property (nonatomic, strong) UIWindow *window;
+16 -6
View File
@@ -10,6 +10,7 @@
#import <React/RCTBridge.h> #import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h> #import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h> #import <React/RCTRootView.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h> #import <RNCPushNotificationIOS.h>
@implementation AppDelegate @implementation AppDelegate
@@ -28,14 +29,20 @@
rootViewController.view = rootView; rootViewController.view = rootView;
self.window.rootViewController = rootViewController; self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
// Define UNUserNotificationCenter
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
return YES; return YES;
} }
// Required to register for notifications //Called when a notification is delivered to a foreground app.
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{ {
[RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings]; completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
} }
// Required for the register event. // Required for the register event.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{ {
@@ -52,12 +59,15 @@ fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{ {
[RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error]; [RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
} }
// Required for the localNotification event. // Required for localNotification event
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification - (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler
{ {
[RNCPushNotificationIOS didReceiveLocalNotification:notification]; [RNCPushNotificationIOS didReceiveNotificationResponse:response];
} }
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{ {
#if DEBUG #if DEBUG
@@ -2,37 +2,52 @@
"images" : [ "images" : [
{ {
"idiom" : "iphone", "idiom" : "iphone",
"size" : "29x29", "scale" : "2x",
"scale" : "2x" "size" : "20x20"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"size" : "29x29", "scale" : "3x",
"scale" : "3x" "size" : "20x20"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"size" : "40x40", "scale" : "2x",
"scale" : "2x" "size" : "29x29"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"size" : "40x40", "scale" : "3x",
"scale" : "3x" "size" : "29x29"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"size" : "60x60", "scale" : "2x",
"scale" : "2x" "size" : "40x40"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"size" : "60x60", "scale" : "3x",
"scale" : "3x" "size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
} }
], ],
"info" : { "info" : {
"version" : 1, "author" : "xcode",
"author" : "xcode" "version" : 1
} }
} }
+11 -1
View File
@@ -26,6 +26,8 @@
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key> <key>NSExceptionDomains</key>
<dict> <dict>
<key>localhost</key> <key>localhost</key>
@@ -36,9 +38,10 @@
</dict> </dict>
</dict> </dict>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
<string/> <string></string>
<key>UIAppFonts</key> <key>UIAppFonts</key>
<array> <array>
<string>Entypo.ttf</string>
<string>Glyphter.ttf</string> <string>Glyphter.ttf</string>
<string>Prompt-Light.ttf</string> <string>Prompt-Light.ttf</string>
<string>Prompt-Thin.ttf</string> <string>Prompt-Thin.ttf</string>
@@ -59,6 +62,13 @@
<string>OpenSans-Regular.ttf</string> <string>OpenSans-Regular.ttf</string>
<string>OpenSans-SemiBold.ttf</string> <string>OpenSans-SemiBold.ttf</string>
<string>OpenSans-LightItalic.ttf</string> <string>OpenSans-LightItalic.ttf</string>
<string>Jost-400-Book.otf</string>
<string>Jost-700-Bold.otf</string>
<string>Menu.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array> </array>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
+5 -1
View File
@@ -12,7 +12,7 @@
#import <React/RCTRootView.h> #import <React/RCTRootView.h>
#define TIMEOUT_SECONDS 600 #define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" #define TEXT_TO_LOOK_FOR @"Welcome to React"
@interface dripTests : XCTestCase @interface dripTests : XCTestCase
@@ -40,11 +40,13 @@
BOOL foundElement = NO; BOOL foundElement = NO;
__block NSString *redboxError = nil; __block NSString *redboxError = nil;
#ifdef DEBUG
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
if (level >= RCTLogLevelError) { if (level >= RCTLogLevelError) {
redboxError = message; redboxError = message;
} }
}); });
#endif
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
@@ -58,7 +60,9 @@
}]; }];
} }
#ifdef DEBUG
RCTSetLogFunction(RCTDefaultLogFunction); RCTSetLogFunction(RCTDefaultLogFunction);
#endif
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
+1
View File
@@ -30,6 +30,7 @@
"dependencies": { "dependencies": {
"@ptomasroos/react-native-multi-slider": "^2.2.0", "@ptomasroos/react-native-multi-slider": "^2.2.0",
"@react-native-community/datetimepicker": "^3.0.9", "@react-native-community/datetimepicker": "^3.0.9",
"@react-native-community/push-notification-ios": "^1.8.0",
"assert": "^1.4.1", "assert": "^1.4.1",
"csvtojson": "^2.0.8", "csvtojson": "^2.0.8",
"isobject": "^3.0.1", "isobject": "^3.0.1",
+9
View File
@@ -9,6 +9,12 @@ rm -rf android/app/build
echo "Removed all Xcode derived data..." echo "Removed all Xcode derived data..."
rm -rf ~/Library/Developer/Xcode/DerivedData rm -rf ~/Library/Developer/Xcode/DerivedData
echo "Removed iOS Pods data..."
rm -rf ios/Pods/*
echo "Removed Podfile.lock..."
rm Podfile.lock
echo "watchman watch-del-all..." echo "watchman watch-del-all..."
watchman watch-del-all watchman watch-del-all
@@ -18,6 +24,9 @@ rm -rf node_modules
echo "npm install..." echo "npm install..."
npm install npm install
echo "Pods install..."
cd ios && pod install && cd ..
echo "rm -rf $TMPDIR/react-*..." echo "rm -rf $TMPDIR/react-*..."
rm -rf $TMPDIR/react-* rm -rf $TMPDIR/react-*
+4 -2
View File
@@ -1,11 +1,13 @@
import { Platform } from 'react-native'
import { fontRatio } from '../config' import { fontRatio } from '../config'
import Colors from './colors' import Colors from './colors'
import Spacing from './spacing' import Spacing from './spacing'
export const fonts = { export const fonts = {
main: 'Jost-400-Book', main: Platform.OS === 'ios' ? 'Jost-Book' : 'Jost-400-Book',
bold : 'Jost-700-Bold', bold : Platform.OS === 'ios' ? 'Jost-Bold' : 'Jost-700-Bold',
} }
export const sizes = { export const sizes = {