Merge branch 'feature/ios-launch' into 'master'
Feature/ios launch See merge request bloodyhealth/drip!351
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import React, { Component } from 'react'
|
||||
import { StyleSheet, View } from 'react-native'
|
||||
import { Provider } from 'react-redux'
|
||||
import nodejs from 'nodejs-mobile-react-native'
|
||||
|
||||
import { getLicenseFlag, saveEncryptionFlag } from '../local-storage'
|
||||
import { openDb } from '../db'
|
||||
|
||||
import App from './app'
|
||||
import PasswordPrompt from './password-prompt'
|
||||
import License from './license'
|
||||
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 { Provider } from 'react-redux'
|
||||
|
||||
export default class AppWrapper extends Component {
|
||||
constructor() {
|
||||
@@ -84,7 +86,19 @@ export default class AppWrapper extends Component {
|
||||
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,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import React, { Component } from 'react'
|
||||
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 AppPage from '../common/app-page'
|
||||
@@ -22,9 +29,10 @@ import { makeColumnInfo, nfpLines } from '../helpers/chart'
|
||||
|
||||
import {
|
||||
CHART_COLUMN_WIDTH,
|
||||
SYMPTOMS,
|
||||
CHART_GRID_LINE_HORIZONTAL_WIDTH,
|
||||
CHART_SYMPTOM_HEIGHT_RATIO,
|
||||
CHART_XAXIS_HEIGHT_RATIO
|
||||
CHART_XAXIS_HEIGHT_RATIO,
|
||||
SYMPTOMS
|
||||
} from '../../config'
|
||||
import { shared } from '../../i18n/en/labels'
|
||||
import { Colors, Spacing } from '../../styles'
|
||||
@@ -105,9 +113,13 @@ class CycleChart extends Component {
|
||||
|
||||
this.xAxisHeight = height * 0.7 * CHART_XAXIS_HEIGHT_RATIO
|
||||
const remainingHeight = height * 0.7 - this.xAxisHeight
|
||||
this.symptomHeight = remainingHeight * CHART_SYMPTOM_HEIGHT_RATIO
|
||||
this.symptomRowHeight = this.symptomRowSymptoms.length *
|
||||
this.symptomHeight
|
||||
this.symptomHeight = PixelRatio.roundToNearestPixel(
|
||||
remainingHeight
|
||||
* CHART_SYMPTOM_HEIGHT_RATIO
|
||||
)
|
||||
this.symptomRowHeight = PixelRatio.roundToNearestPixel(
|
||||
this.symptomRowSymptoms.length * this.symptomHeight
|
||||
) + CHART_GRID_LINE_HORIZONTAL_WIDTH
|
||||
this.columnHeight = remainingHeight - this.symptomRowHeight
|
||||
const chartHeight = this.shouldShowTemperatureColumn ?
|
||||
height * 0.7 : (this.symptomRowHeight + this.xAxisHeight)
|
||||
|
||||
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types'
|
||||
import AppText from '../common/app-text'
|
||||
|
||||
import { Sizes } from '../../styles'
|
||||
import { CHART_TICK_WIDTH } from '../../config'
|
||||
|
||||
const Tick = ({ yPosition, height, isBold, shouldShowLabel, label }) => {
|
||||
const top = yPosition - height / 2
|
||||
@@ -28,16 +29,14 @@ Tick.propTypes = {
|
||||
|
||||
|
||||
const text = {
|
||||
lineHeight: Sizes.base,
|
||||
right: 4,
|
||||
textAlign: 'right'
|
||||
textAlign: 'right',
|
||||
}
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
justifyContent: 'center',
|
||||
position: 'absolute',
|
||||
right: 0,
|
||||
width: 40
|
||||
width: CHART_TICK_WIDTH
|
||||
},
|
||||
textBold: {
|
||||
fontSize: Sizes.base,
|
||||
|
||||
@@ -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
|
||||
@@ -38,6 +38,7 @@ const styles = StyleSheet.create({
|
||||
marginTop: Spacing.base,
|
||||
minWidth: '80%',
|
||||
paddingHorizontal: Spacing.base,
|
||||
paddingVertical: Spacing.tiny,
|
||||
...Typography.mainText
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@ import { StyleSheet, TouchableOpacity } from 'react-native'
|
||||
import AppIcon from './app-icon'
|
||||
import AppText from './app-text'
|
||||
|
||||
import { Colors, Fonts, Spacing } from '../../styles'
|
||||
import { Colors, Fonts, Sizes, Spacing } from '../../styles'
|
||||
|
||||
const Button = ({
|
||||
children,
|
||||
@@ -52,7 +52,7 @@ const text = {
|
||||
}
|
||||
|
||||
const textSmall = {
|
||||
fontSize: Fonts.small,
|
||||
fontSize: Sizes.small,
|
||||
padding: Spacing.small,
|
||||
textTransform: 'uppercase'
|
||||
}
|
||||
|
||||
@@ -4,28 +4,31 @@ import { StyleSheet, TouchableOpacity } from 'react-native'
|
||||
|
||||
import AppIcon from './app-icon'
|
||||
|
||||
import { HIT_SLOP} from '../../config'
|
||||
import { Colors, Sizes } from '../../styles'
|
||||
|
||||
const CloseIcon = ({ onClose, ...props }) => {
|
||||
const CloseIcon = ({ onClose, color, ...props }) => {
|
||||
return (
|
||||
<TouchableOpacity
|
||||
hitSlop={HIT_SLOP}
|
||||
onPress={onClose}
|
||||
style={styles.container}
|
||||
{...props}
|
||||
>
|
||||
<AppIcon name='cross' color={Colors.orange} />
|
||||
<AppIcon name='cross' color={color ? color : Colors.orange} />
|
||||
</TouchableOpacity>
|
||||
)
|
||||
}
|
||||
|
||||
CloseIcon.propTypes = {
|
||||
onClose: PropTypes.func.isRequired
|
||||
onClose: PropTypes.func.isRequired,
|
||||
color: PropTypes.string
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
alignSelf: 'flex-start',
|
||||
marginBottom: Sizes.base
|
||||
marginBottom: Sizes.base,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react'
|
||||
import { StyleSheet, View } from 'react-native'
|
||||
import { Platform, StyleSheet, View } from 'react-native'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Keyboard } from 'react-native'
|
||||
import DateTimePicker from 'react-native-modal-datetime-picker'
|
||||
@@ -127,6 +127,7 @@ class Temperature extends Component {
|
||||
mode="time"
|
||||
onConfirm={this.setTime}
|
||||
onCancel={this.onCancelTimePicker}
|
||||
display={Platform.OS === "ios" ? "spinner" : "default"}
|
||||
/>
|
||||
</Segment>
|
||||
</React.Fragment>
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
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 CloseIcon from '../common/close-icon'
|
||||
import MenuItem from './menu-item'
|
||||
|
||||
import { Colors, Sizes } from '../../styles'
|
||||
@@ -49,12 +56,9 @@ export default class HamburgerMenu extends Component {
|
||||
style={styles.blackBackground}
|
||||
></TouchableOpacity>
|
||||
<View style={styles.menu}>
|
||||
<TouchableOpacity
|
||||
onPress={this.toggleMenu}
|
||||
style={styles.iconContainer}
|
||||
>
|
||||
<AppIcon name='cross' color='black' />
|
||||
</TouchableOpacity>
|
||||
<View style={styles.iconContainer}>
|
||||
<CloseIcon color={'black'} onClose={() => this.toggleMenu()} />
|
||||
</View>
|
||||
{settingsMenuItems.map((item) => (
|
||||
<MenuItem
|
||||
item={item}
|
||||
@@ -85,6 +89,7 @@ const styles = StyleSheet.create({
|
||||
backgroundColor: 'white',
|
||||
height: '100%',
|
||||
padding: Sizes.base,
|
||||
paddingTop: Platform.OS === 'ios' ? Sizes.huge : Sizes.base,
|
||||
position: 'absolute',
|
||||
width: '60%',
|
||||
},
|
||||
|
||||
@@ -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_EXPORT = 'export'
|
||||
@@ -16,16 +16,20 @@ export const SYMPTOMS = [
|
||||
'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_MIDDLE = CHART_COLUMN_WIDTH / 2
|
||||
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_STROKE_WIDTH = 3
|
||||
export const CHART_SYMPTOM_HEIGHT_RATIO = 0.08
|
||||
export const CHART_XAXIS_HEIGHT_RATIO = 0.1
|
||||
export const CHART_YAXIS_WIDTH = 32
|
||||
export const CHART_TICK_WIDTH = 44
|
||||
|
||||
export const TEMP_SCALE_MAX = 37.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 HIT_SLOP = { top: 20, bottom: 20, left: 20, right: 20 }
|
||||
|
||||
export const STATUSBAR_HEIGHT = StatusBar.currentHeight
|
||||
|
||||
+44
@@ -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
@@ -7,7 +7,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -22,6 +22,17 @@
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSExceptionDomains</key>
|
||||
<dict>
|
||||
<key>localhost</key>
|
||||
<dict>
|
||||
<key>NSExceptionAllowsInsecureHTTPLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
@@ -38,17 +49,5 @@
|
||||
<false/>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<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>
|
||||
</plist>
|
||||
|
||||
+427
-1291
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
@@ -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>
|
||||
@@ -6,8 +6,9 @@
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <UserNotifications/UNUserNotificationCenter.h>
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate>
|
||||
|
||||
@property (nonatomic, strong) UIWindow *window;
|
||||
|
||||
|
||||
+16
-6
@@ -10,6 +10,7 @@
|
||||
#import <React/RCTBridge.h>
|
||||
#import <React/RCTBundleURLProvider.h>
|
||||
#import <React/RCTRootView.h>
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
#import <RNCPushNotificationIOS.h>
|
||||
|
||||
@implementation AppDelegate
|
||||
@@ -28,14 +29,20 @@
|
||||
rootViewController.view = rootView;
|
||||
self.window.rootViewController = rootViewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
// Define UNUserNotificationCenter
|
||||
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
|
||||
center.delegate = self;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
// Required to register for notifications
|
||||
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
|
||||
//Called when a notification is delivered to a foreground app.
|
||||
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
|
||||
{
|
||||
[RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings];
|
||||
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
|
||||
}
|
||||
|
||||
// Required for the register event.
|
||||
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
|
||||
{
|
||||
@@ -52,12 +59,15 @@ fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
|
||||
{
|
||||
[RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
|
||||
}
|
||||
// Required for the localNotification event.
|
||||
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
|
||||
// Required for localNotification event
|
||||
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
||||
didReceiveNotificationResponse:(UNNotificationResponse *)response
|
||||
withCompletionHandler:(void (^)(void))completionHandler
|
||||
{
|
||||
[RNCPushNotificationIOS didReceiveLocalNotification:notification];
|
||||
[RNCPushNotificationIOS didReceiveNotificationResponse:response];
|
||||
}
|
||||
|
||||
|
||||
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
||||
{
|
||||
#if DEBUG
|
||||
|
||||
@@ -2,37 +2,52 @@
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"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" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
+11
-1
@@ -26,6 +26,8 @@
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
<key>NSExceptionDomains</key>
|
||||
<dict>
|
||||
<key>localhost</key>
|
||||
@@ -36,9 +38,10 @@
|
||||
</dict>
|
||||
</dict>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string/>
|
||||
<string></string>
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>Entypo.ttf</string>
|
||||
<string>Glyphter.ttf</string>
|
||||
<string>Prompt-Light.ttf</string>
|
||||
<string>Prompt-Thin.ttf</string>
|
||||
@@ -59,6 +62,13 @@
|
||||
<string>OpenSans-Regular.ttf</string>
|
||||
<string>OpenSans-SemiBold.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>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#import <React/RCTRootView.h>
|
||||
|
||||
#define TIMEOUT_SECONDS 600
|
||||
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
|
||||
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
||||
|
||||
@interface dripTests : XCTestCase
|
||||
|
||||
@@ -40,11 +40,13 @@
|
||||
BOOL foundElement = NO;
|
||||
|
||||
__block NSString *redboxError = nil;
|
||||
#ifdef DEBUG
|
||||
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
||||
if (level >= RCTLogLevelError) {
|
||||
redboxError = message;
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
||||
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
||||
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||
@@ -58,7 +60,9 @@
|
||||
}];
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
RCTSetLogFunction(RCTDefaultLogFunction);
|
||||
#endif
|
||||
|
||||
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
||||
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"dependencies": {
|
||||
"@ptomasroos/react-native-multi-slider": "^2.2.0",
|
||||
"@react-native-community/datetimepicker": "^3.0.9",
|
||||
"@react-native-community/push-notification-ios": "^1.8.0",
|
||||
"assert": "^1.4.1",
|
||||
"csvtojson": "^2.0.8",
|
||||
"isobject": "^3.0.1",
|
||||
|
||||
@@ -9,6 +9,12 @@ rm -rf android/app/build
|
||||
echo "Removed all Xcode derived data..."
|
||||
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..."
|
||||
watchman watch-del-all
|
||||
|
||||
@@ -18,6 +24,9 @@ rm -rf node_modules
|
||||
echo "npm install..."
|
||||
npm install
|
||||
|
||||
echo "Pods install..."
|
||||
cd ios && pod install && cd ..
|
||||
|
||||
echo "rm -rf $TMPDIR/react-*..."
|
||||
rm -rf $TMPDIR/react-*
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Platform } from 'react-native'
|
||||
|
||||
import { fontRatio } from '../config'
|
||||
|
||||
import Colors from './colors'
|
||||
import Spacing from './spacing'
|
||||
|
||||
export const fonts = {
|
||||
main: 'Jost-400-Book',
|
||||
bold : 'Jost-700-Bold',
|
||||
main: Platform.OS === 'ios' ? 'Jost-Book' : 'Jost-400-Book',
|
||||
bold : Platform.OS === 'ios' ? 'Jost-Bold' : 'Jost-700-Bold',
|
||||
}
|
||||
|
||||
export const sizes = {
|
||||
|
||||
Reference in New Issue
Block a user