Pārlūkot izejas kodu

add files property (demo.css) to demo

iou90 6 gadus atpakaļ
vecāks
revīzija
3910c92601

+ 6
- 0
demo/App.js Parādīt failu

@@ -102,6 +102,12 @@ export default class Explorer extends Component {
102 102
           style={{
103 103
             marginTop: 15
104 104
           }}
105
+          enableBaseUrl
106
+          files={[{
107
+            href: 'demo.css',
108
+            type: 'text/css',
109
+            rel: 'stylesheet'
110
+          }]}
105 111
           customStyle={widthStyle}
106 112
           onError={() => console.log('width on error')}
107 113
           onLoad={() => console.log('width on load')}

+ 3
- 0
demo/android/app/src/main/assets/web/demo.css Parādīt failu

@@ -0,0 +1,3 @@
1
+.localStyle {
2
+    font-weight: bold;
3
+}

+ 1
- 1
demo/config.js Parādīt failu

@@ -36,7 +36,7 @@ const autoWidthHtml0 = `
36 36
 <head>
37 37
   <meta name="viewport" content="target-densitydpi=device-dpi, initial-scale=1.0, user-scalable=no" />
38 38
 </head>
39
-<p style="display: inline;background-color: transparent !important;background-image: linear-gradient(to bottom, rgba(146, 249, 190, 1), rgba(146, 249, 190, 1));font-weight: 400;font-style: normal;zoom:1;font-size: 21px;line-height: 1.58;letter-spacing: -.003em;">hey</p>
39
+<p class="localStyle" style="display: inline;background-color: transparent !important;background-image: linear-gradient(to bottom, rgba(146, 249, 190, 1), rgba(146, 249, 190, 1));font-style: normal;zoom:1;font-size: 21px;line-height: 1.58;letter-spacing: -.003em;">hey</p>
40 40
 </html>
41 41
 `;
42 42
 

+ 12
- 0
demo/ios/demo.xcodeproj/project.pbxproj Parādīt failu

@@ -38,6 +38,7 @@
38 38
 		5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
39 39
 		832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
40 40
 		ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
41
+		B7420B85210E3185007509B0 /* demo.css in Resources */ = {isa = PBXBuildFile; fileRef = B7420B84210E3185007509B0 /* demo.css */; };
41 42
 /* End PBXBuildFile section */
42 43
 
43 44
 /* Begin PBXContainerItemProxy section */
@@ -343,6 +344,7 @@
343 344
 		78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
344 345
 		832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
345 346
 		ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
347
+		B7420B84210E3185007509B0 /* demo.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = demo.css; sourceTree = "<group>"; };
346 348
 /* End PBXFileReference section */
347 349
 
348 350
 /* Begin PBXFrameworksBuildPhase section */
@@ -482,6 +484,7 @@
482 484
 		13B07FAE1A68108700A75B9A /* demo */ = {
483 485
 			isa = PBXGroup;
484 486
 			children = (
487
+				B7420B5E210E3082007509B0 /* web */,
485 488
 				008F07F21AC5B25A0029DE68 /* main.jsbundle */,
486 489
 				13B07FAF1A68108700A75B9A /* AppDelegate.h */,
487 490
 				13B07FB01A68108700A75B9A /* AppDelegate.m */,
@@ -604,6 +607,14 @@
604 607
 			name = Products;
605 608
 			sourceTree = "<group>";
606 609
 		};
610
+		B7420B5E210E3082007509B0 /* web */ = {
611
+			isa = PBXGroup;
612
+			children = (
613
+				B7420B84210E3185007509B0 /* demo.css */,
614
+			);
615
+			path = web;
616
+			sourceTree = "<group>";
617
+		};
607 618
 /* End PBXGroup section */
608 619
 
609 620
 /* Begin PBXNativeTarget section */
@@ -1050,6 +1061,7 @@
1050 1061
 			files = (
1051 1062
 				13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
1052 1063
 				13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
1064
+				B7420B85210E3185007509B0 /* demo.css in Resources */,
1053 1065
 			);
1054 1066
 			runOnlyForDeploymentPostprocessing = 0;
1055 1067
 		};

+ 3
- 0
demo/ios/web/demo.css Parādīt failu

@@ -0,0 +1,3 @@
1
+.localStyle {
2
+    font-weight: bold;
3
+}

+ 5349
- 0
demo/yarn.lock
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 1
- 1
package-lock.json Parādīt failu

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "react-native-autoheight-webview",
3
-  "version": "0.6.1",
3
+  "version": "0.10.0",
4 4
   "lockfileVersion": 1,
5 5
   "requires": true,
6 6
   "dependencies": {