Skip to content

Commit

Permalink
Fixed iOS build.
Browse files Browse the repository at this point in the history
Updated node version on travis.
Fixed isNaN error in ShadowHelper.js
  • Loading branch information
Proyoyo committed Jul 27, 2019
1 parent 3508496 commit 206c1fb
Show file tree
Hide file tree
Showing 358 changed files with 44,068 additions and 18,494 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- "9.5.0"
- "12.6.0"
script:
- npm run lint
119 changes: 60 additions & 59 deletions app/components/Icons/ShadowHelper.js
Original file line number Diff line number Diff line change
@@ -1,59 +1,60 @@
import React from 'react';
import {View} from 'react-native';
import Svg, {RadialGradient, Stop, Circle } from 'react-native-svg'
import {Platform} from "react-native";

const Shadow = (props) => {
if(Platform.OS === "ios"){
return React.cloneElement(props.children, props);
}

const {style: {shadowColor, shadowRadius, height, width, margin, marginLeft, marginRight, marginBottom = 0, marginTop = 0}} = props
const container = {
width: width + (shadowRadius * 2),
height: height + (shadowRadius * 2),
}

const wrapStyles = {
position: "relative",
marginBottom: -shadowRadius + marginBottom,
marginTop: -shadowRadius + marginTop,
height: container.height,
width: container.width,
margin: -shadowRadius + margin,
marginLeft: -shadowRadius + marginLeft,
marginRight: -shadowRadius + marginRight,
}


const svgStyles = {
position: "absolute"

}

const innerStyles = {
position: "absolute",
top: shadowRadius,
left: shadowRadius,
marginLeft: 0,
marginRight: 0,
marginTop: 0,
marginBottom: 0,
margin: 0
}

return (
<View height={container.height} width={container.width} style={[props.style, wrapStyles]}>
<Svg height={container.height} width={container.width} style={svgStyles}>
<RadialGradient id="dropshadow" r="100%" cx="50%" cy="50%" rx="50%" ry="50%" fx="50%" fy="50%" gradientUnits="userSpaceOnUse">
<Stop offset="0%" stopColor={shadowColor} stopOpacity=".6"/>
<Stop offset="50%" stopColor={shadowColor} stopOpacity=".2"/>
<Stop offset="100%" stopColor={shadowColor} stopOpacity="0"/>
</RadialGradient>
<Circle fill="url(#dropshadow)" cx="50%" cy="50%" r="100%" />
</Svg>
{React.cloneElement(props.children, {...props, style: [props.style, innerStyles]})}
</View>)
}

export default Shadow
import React from "react";
import { View } from "react-native";
import Svg, { RadialGradient, Stop, Circle } from "react-native-svg";
import { Platform } from "react-native";

const Shadow = props => {
if (Platform.OS === "ios") {
return React.cloneElement(props.children, props);
}

const {
style: { shadowColor, shadowRadius, height, width, margin, marginLeft, marginRight, marginBottom = 0, marginTop = 0 }
} = props;
const container = {
width: width + shadowRadius * 2,
height: height + shadowRadius * 2
};

const wrapStyles = {
position: "relative",
marginBottom: -shadowRadius + marginBottom,
marginTop: -shadowRadius + marginTop,
height: container.height,
width: container.width,
margin: isNaN(-shadowRadius + margin) ? 0 : -shadowRadius + margin,
marginLeft: -shadowRadius + marginLeft,
marginRight: -shadowRadius + marginRight
};

const svgStyles = {
position: "absolute"
};

const innerStyles = {
position: "absolute",
top: shadowRadius,
left: shadowRadius,
marginLeft: 0,
marginRight: 0,
marginTop: 0,
marginBottom: 0,
margin: 0
};

return (
<View height={container.height} width={container.width} style={[props.style, wrapStyles]}>
<Svg height={container.height} width={container.width} style={svgStyles}>
<RadialGradient id="dropshadow" r="100%" cx="50%" cy="50%" rx="50%" ry="50%" fx="50%" fy="50%" gradientUnits="userSpaceOnUse">
<Stop offset="0%" stopColor={shadowColor} stopOpacity=".6" />
<Stop offset="50%" stopColor={shadowColor} stopOpacity=".2" />
<Stop offset="100%" stopColor={shadowColor} stopOpacity="0" />
</RadialGradient>
<Circle fill="url(#dropshadow)" cx="50%" cy="50%" r="100%" />
</Svg>
{React.cloneElement(props.children, { ...props, style: [props.style, innerStyles] })}
</View>
);
};

export default Shadow;
1 change: 1 addition & 0 deletions ios/OpenDota/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
Expand Down
3 changes: 1 addition & 2 deletions ios/OpenDota/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"OpenDota"
initialProperties:nil
launchOptions:launchOptions];
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
Expand Down
82 changes: 45 additions & 37 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,60 +1,68 @@
PODS:
- boost-for-react-native (1.63.0)
- DoubleConversion (1.1.5)
- Folly (2016.10.31.00):
- DoubleConversion (1.1.6)
- Folly (2018.10.22.00):
- boost-for-react-native
- DoubleConversion
- glog
- glog (0.3.4)
- React/Core (0.56.0):
- yoga (= 0.56.0.React)
- React/CxxBridge (0.56.0):
- Folly (= 2016.10.31.00)
- glog (0.3.5)
- React/Core (0.59.10):
- yoga (= 0.59.10.React)
- React/CxxBridge (0.59.10):
- Folly (= 2018.10.22.00)
- React/Core
- React/cxxreact
- React/cxxreact (0.56.0):
- React/jsiexecutor
- React/cxxreact (0.59.10):
- boost-for-react-native (= 1.63.0)
- Folly (= 2016.10.31.00)
- React/jschelpers
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React/jsinspector
- React/DevSupport (0.56.0):
- React/DevSupport (0.59.10):
- React/Core
- React/RCTWebSocket
- React/fishhook (0.56.0)
- React/jschelpers (0.56.0):
- Folly (= 2016.10.31.00)
- React/PrivateDatabase
- React/jsinspector (0.56.0)
- React/PrivateDatabase (0.56.0)
- React/RCTActionSheet (0.56.0):
- React/fishhook (0.59.10)
- React/jsi (0.59.10):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React/jsiexecutor (0.59.10):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React/cxxreact
- React/jsi
- React/jsinspector (0.59.10)
- React/RCTActionSheet (0.59.10):
- React/Core
- React/RCTAnimation (0.56.0):
- React/RCTAnimation (0.59.10):
- React/Core
- React/RCTBlob (0.56.0):
- React/RCTBlob (0.59.10):
- React/Core
- React/RCTCameraRoll (0.56.0):
- React/RCTCameraRoll (0.59.10):
- React/Core
- React/RCTImage
- React/RCTImage (0.56.0):
- React/RCTImage (0.59.10):
- React/Core
- React/RCTNetwork
- React/RCTLinkingIOS (0.56.0):
- React/RCTLinkingIOS (0.59.10):
- React/Core
- React/RCTNetwork (0.56.0):
- React/RCTNetwork (0.59.10):
- React/Core
- React/RCTPushNotification (0.56.0):
- React/RCTPushNotification (0.59.10):
- React/Core
- React/RCTSettings (0.56.0):
- React/RCTSettings (0.59.10):
- React/Core
- React/RCTText (0.56.0):
- React/RCTText (0.59.10):
- React/Core
- React/RCTVibration (0.56.0):
- React/RCTVibration (0.59.10):
- React/Core
- React/RCTWebSocket (0.56.0):
- React/RCTWebSocket (0.59.10):
- React/Core
- React/fishhook
- React/RCTBlob
- yoga (0.56.0.React)
- yoga (0.59.10.React)

DEPENDENCIES:
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
Expand Down Expand Up @@ -95,12 +103,12 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: a9706f16e388b53ff12cca34473428ee29746a26
Folly: c89ac2d5c6ab169cd7397ef27485c44f35f742c7
glog: b3b0330915eccea41c5cc9731a77cf564a9be5ea
React: 1fe0eb13d90b625d94c3b117c274dcfd2e760e11
yoga: b1ce48b6cf950b98deae82838f5173ea7cf89e85
DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd
Folly: de497beb10f102453a1afa9edbf8cf8a251890de
glog: aefd1eb5dda2ab95ba0938556f34b98e2da3a60d
React: 36d0768f9e93be2473b37e7fa64f92c1d5341eef
yoga: 684513b14b03201579ba3cee20218c9d1298b0cc

PODFILE CHECKSUM: f7f701c8967edefd2c3ce6c90122773c6f921ede
PODFILE CHECKSUM: f15c56df54f632eef5264ebabfcf7caf03f4f078

COCOAPODS: 1.5.3
COCOAPODS: 1.7.5
43 changes: 43 additions & 0 deletions ios/Pods/DoubleConversion/README

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ios/Pods/DoubleConversion/double-conversion/strtod.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ios/Pods/DoubleConversion/double-conversion/utils.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 206c1fb

Please sign in to comment.