Skip to content

Commit

Permalink
Merge pull request #10 from negativetwelve/mark/package/react-native-svg
Browse files Browse the repository at this point in the history
[Package] Add react-native-svg with example and tests
  • Loading branch information
negativetwelve committed Aug 11, 2017
2 parents b7f8db1 + b91d5f9 commit 4344178
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ It also serves as a catalog for all react-native pacakges in the community.
## Packages

* [react-native-heap-analytics](https://github.com/negativetwelve/react-native-heap-analytics)
* [react-native-svg](https://github.com/react-native-community/react-native-svg)
* [react-native-ux-cam](https://github.com/negativetwelve/react-native-ux-cam)
* [react-native-video](https://github.com/react-native-community/react-native-video)
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ android {
}

dependencies {
compile project(':react-native-svg')
compile project(':react-native-video')
compile project(':react-native-ux-cam')
compile fileTree(dir: "libs", include: ["*.jar"])
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/java/com/rnpackages/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Application;

import com.facebook.react.ReactApplication;
import com.horcrux.svg.SvgPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.rnuxcam.rnuxcam.UXCamPackage;
import com.facebook.react.ReactNativeHost;
Expand All @@ -25,6 +26,7 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new SvgPackage(),
new ReactVideoPackage(),
new UXCamPackage()
);
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'RNPackages'
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')
include ':react-native-ux-cam'
Expand Down
11 changes: 11 additions & 0 deletions ios/RNPackages.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
1ED3D47199F24599A9125D38 /* libRNUXCam.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 659F784FC46344179C5B6774 /* libRNUXCam.a */; };
442CFF7594324918A98A95CE /* libRCTVideo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C6FC00D33D8474A8E688CFE /* libRCTVideo.a */; };
AA3C83CBF3C4477BBF860411 /* libRNHeap.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 702B3FCBEC9440E0874F0ADC /* libRNHeap.a */; };
915FAC3A46E54800ADEE082B /* libRNSVG.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 57FC3505C8CA45A7B135F342 /* libRNSVG.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -263,6 +264,8 @@
7C6FC00D33D8474A8E688CFE /* libRCTVideo.a */ = {isa = PBXFileReference; name = "libRCTVideo.a"; path = "libRCTVideo.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
1B63D7E53F1C43C1984724A9 /* RNHeap.xcodeproj */ = {isa = PBXFileReference; name = "RNHeap.xcodeproj"; path = "../node_modules/react-native-heap-analytics/ios/RNHeap.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
702B3FCBEC9440E0874F0ADC /* libRNHeap.a */ = {isa = PBXFileReference; name = "libRNHeap.a"; path = "libRNHeap.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
F6CD04D862284277B2A3C4FD /* RNSVG.xcodeproj */ = {isa = PBXFileReference; name = "RNSVG.xcodeproj"; path = "../node_modules/react-native-svg/ios/RNSVG.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
57FC3505C8CA45A7B135F342 /* libRNSVG.a */ = {isa = PBXFileReference; name = "libRNSVG.a"; path = "libRNSVG.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -292,6 +295,7 @@
1ED3D47199F24599A9125D38 /* libRNUXCam.a in Frameworks */,
442CFF7594324918A98A95CE /* libRCTVideo.a in Frameworks */,
AA3C83CBF3C4477BBF860411 /* libRNHeap.a in Frameworks */,
915FAC3A46E54800ADEE082B /* libRNSVG.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -461,6 +465,7 @@
4B184078C3454F4F808958E7 /* RNUXCam.xcodeproj */,
10D94D39E400418C9E39A435 /* RCTVideo.xcodeproj */,
1B63D7E53F1C43C1984724A9 /* RNHeap.xcodeproj */,
F6CD04D862284277B2A3C4FD /* RNSVG.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
Expand Down Expand Up @@ -997,6 +1002,7 @@
"$(SRCROOT)/../node_modules/react-native-ux-cam/ios",
"$(SRCROOT)/../node_modules/react-native-video/ios",
"$(SRCROOT)/../node_modules/react-native-heap-analytics/ios",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
);
};
name = Debug;
Expand Down Expand Up @@ -1026,6 +1032,7 @@
"$(SRCROOT)/../node_modules/react-native-ux-cam/ios",
"$(SRCROOT)/../node_modules/react-native-video/ios",
"$(SRCROOT)/../node_modules/react-native-heap-analytics/ios",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
);
};
name = Release;
Expand All @@ -1050,6 +1057,7 @@
"$(SRCROOT)/../node_modules/react-native-ux-cam/ios",
"$(SRCROOT)/../node_modules/react-native-video/ios",
"$(SRCROOT)/../node_modules/react-native-heap-analytics/ios",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
);
};
name = Debug;
Expand All @@ -1073,6 +1081,7 @@
"$(SRCROOT)/../node_modules/react-native-ux-cam/ios",
"$(SRCROOT)/../node_modules/react-native-video/ios",
"$(SRCROOT)/../node_modules/react-native-heap-analytics/ios",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
);
};
name = Release;
Expand Down Expand Up @@ -1111,6 +1120,7 @@
"$(SRCROOT)/../node_modules/react-native-ux-cam/ios",
"$(SRCROOT)/../node_modules/react-native-video/ios",
"$(SRCROOT)/../node_modules/react-native-heap-analytics/ios",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
);
};
name = Debug;
Expand Down Expand Up @@ -1149,6 +1159,7 @@
"$(SRCROOT)/../node_modules/react-native-ux-cam/ios",
"$(SRCROOT)/../node_modules/react-native-video/ios",
"$(SRCROOT)/../node_modules/react-native-heap-analytics/ios",
"$(SRCROOT)/../node_modules/react-native-svg/ios/**",
);
};
name = Release;
Expand Down
2 changes: 2 additions & 0 deletions js/components/PackagesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {StyleSheet, View} from 'react-native';

// Packages
import HeapAnalyticsExample from '../examples/HeapAnalyticsExample';
import SVGExample from '../examples/SVGExample';
import UXCamExample from '../examples/UXCamExample';
import VideoExample from '../examples/VideoExample';

Expand All @@ -18,6 +19,7 @@ const styles = StyleSheet.create({
export default () => (
<View style={styles.container}>
<HeapAnalyticsExample />
<SVGExample />
<UXCamExample />
<VideoExample />
</View>
Expand Down
17 changes: 17 additions & 0 deletions js/examples/SVGExample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Libraries
import React from 'react';
import {StyleSheet, View} from 'react-native';
import SVG from 'react-native-svg';


const styles = StyleSheet.create({
container: {
flex: 1,
},
});


// TODO(mark): We need to add a example components from react-native-svg.
export default () => (
<View />
);
14 changes: 14 additions & 0 deletions js/examples/__tests__/SVGExample.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Libraries
import 'react-native';
import React from 'react';
import Renderer from 'react-test-renderer';

// Components
import SVGExample from '../SVGExample';


it('renders correctly', () => {
const tree = Renderer.create(
<SVGExample />
);
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"react": "16.0.0-alpha.12",
"react-native": "0.47.1",
"react-native-heap-analytics": "^1.3.0",
"react-native-svg": "^5.4.1",
"react-native-ux-cam": "^3.4.0",
"react-native-video": "^1.2.0"
},
Expand Down
27 changes: 24 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ clone@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/clone/-/clone-0.2.0.tgz#c6126a90ad4f72dbf5acdb243cc37724fe93fc1f"

clone@^1.0.0:
clone@^1.0.0, clone@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149"

Expand All @@ -1240,16 +1240,30 @@ code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"

color-convert@^1.9.0:
color-convert@^1.3.0, color-convert@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a"
dependencies:
color-name "^1.1.1"

color-name@^1.1.1:
color-name@^1.0.0, color-name@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"

color-string@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991"
dependencies:
color-name "^1.0.0"

color@^0.11.1:
version "0.11.4"
resolved "https://registry.yarnpkg.com/color/-/color-0.11.4.tgz#6d7b5c74fb65e841cd48792ad1ed5e07b904d764"
dependencies:
clone "^1.0.2"
color-convert "^1.3.0"
color-string "^0.3.0"

colors@1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
Expand Down Expand Up @@ -4602,6 +4616,13 @@ react-native-heap-analytics@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/react-native-heap-analytics/-/react-native-heap-analytics-1.3.0.tgz#4082980701b30010d6533940f963605d51f1de89"

react-native-svg@^5.4.1:
version "5.4.1"
resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-5.4.1.tgz#c46191c786adbe9d5007342b4279efd153db8839"
dependencies:
color "^0.11.1"
lodash "^4.16.6"

react-native-ux-cam@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/react-native-ux-cam/-/react-native-ux-cam-3.4.0.tgz#f47551e6007b17e3acca04796bb8d668e7e48b6f"
Expand Down

0 comments on commit 4344178

Please sign in to comment.