Browse Source

Modified styles & layout for demo

iou90 5 years ago
parent
commit
7687a1e732
2 changed files with 10 additions and 21 deletions
  1. 10
    13
      demo/App.js
  2. 0
    8
      demo/ios/demo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

+ 10
- 13
demo/App.js View File

106
   const [heightSize, setHeightSize] = useState({height: 0, width: 0});
106
   const [heightSize, setHeightSize] = useState({height: 0, width: 0});
107
   const [widthSize, setWidthSize] = useState({height: 0, width: 0});
107
   const [widthSize, setWidthSize] = useState({height: 0, width: 0});
108
 
108
 
109
-  // set spacing on left/right
110
-  const spacing = 30;
111
-
112
-  // calculate new width of *real* content
113
-  const screenWidth = Math.round(Dimensions.get('window').width) - 2 * spacing;
114
-  // For example on iPhone 8, screenWidth will be 315
115
-
116
-  // I temporarily hard-coded the width into the newsletter.js its viewport tag
117
-
118
   return (
109
   return (
119
     <ScrollView
110
     <ScrollView
120
       style={{
111
       style={{
130
         scrollEnabled={false}
121
         scrollEnabled={false}
131
         scrollEnabledWithZoomedin={true}
122
         scrollEnabledWithZoomedin={true}
132
         customStyle={`
123
         customStyle={`
133
-          ${heightStyle}
124
+          body {
125
+            background-color: lightyellow !important;
126
+          }
134
           #rnahw-wrapper {
127
           #rnahw-wrapper {
135
-            padding: 0 ${spacing}px;
136
-            width: ${screenWidth};
128
+            padding: 0 30px;
129
+            width: 100vw;
137
             box-sizing: border-box;
130
             box-sizing: border-box;
131
+            background-color: lightyellow;
132
+          }     
133
+          #doc {
134
+            min-width: unset !important;
138
           }
135
           }
139
         `}
136
         `}
140
         onError={onError}
137
         onError={onError}
143
         onLoadEnd={onHeightLoadEnd}
140
         onLoadEnd={onHeightLoadEnd}
144
         onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
141
         onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
145
         onSizeUpdated={setHeightSize}
142
         onSizeUpdated={setHeightSize}
146
-        source={{html: heightHtml}}
143
+        source={{html: autoHeightHtml1}}
147
         customScript={heightScript}
144
         customScript={heightScript}
148
         onMessage={onMessage}
145
         onMessage={onMessage}
149
       />
146
       />

+ 0
- 8
demo/ios/demo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist View File

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
-<plist version="1.0">
4
-<dict>
5
-	<key>IDEDidComputeMac32BitWarning</key>
6
-	<true/>
7
-</dict>
8
-</plist>