Skip to content

Commit 0567232

Browse files
committed
[fix] NetInfo export
1 parent e5ecc26 commit 0567232

File tree

10 files changed

+82
-79
lines changed

10 files changed

+82
-79
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status][travis-image]][travis-url]
44
[![npm version][npm-image]][npm-url]
5-
![gzipped size](https://img.shields.io/badge/gzipped-~22.6k-blue.svg)
5+
![gzipped size](https://img.shields.io/badge/gzipped-~23k-blue.svg)
66

77
[React Native][react-native-url] components and APIs for the Web.
88

config/webpack.config.example.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
var constants = require('./constants')
2-
var webpack = require('webpack')
1+
const constants = require('./constants')
2+
const path = require('path')
3+
const webpack = require('webpack')
34

45
module.exports = {
56
devServer: {
@@ -30,7 +31,7 @@ module.exports = {
3031
],
3132
resolve: {
3233
alias: {
33-
'react-native': '../../src'
34+
'react-native': path.join(__dirname, '../dist/react-native-web')
3435
}
3536
}
3637
}

examples/components/GridView.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
import React, { Component, PropTypes, StyleSheet, View } from '../../src'
2-
3-
const styles = StyleSheet.create({
4-
root: {
5-
overflow: 'hidden'
6-
},
7-
contentContainer: {
8-
flexDirection: 'row',
9-
flexGrow: 1
10-
},
11-
// distribute all space (rather than extra space)
12-
column: {
13-
flexBasis: '0%'
14-
}
15-
})
1+
import React, { Component, PropTypes, StyleSheet, View } from 'react-native'
162

173
export default class GridView extends Component {
184
static propTypes = {
@@ -63,3 +49,17 @@ export default class GridView extends Component {
6349
)
6450
}
6551
}
52+
53+
const styles = StyleSheet.create({
54+
root: {
55+
overflow: 'hidden'
56+
},
57+
contentContainer: {
58+
flexDirection: 'row',
59+
flexGrow: 1
60+
},
61+
// distribute all space (rather than extra space)
62+
column: {
63+
flexBasis: '0%'
64+
}
65+
})

examples/components/Heading.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import React, { StyleSheet, Text } from '../../src'
1+
import React, { StyleSheet, Text } from 'react-native'
2+
3+
const Heading = ({ children, size = 'normal' }) => (
4+
<Text
5+
accessibilityRole='heading'
6+
children={children}
7+
style={{ ...styles.root, ...sizeStyles[size] }}
8+
/>
9+
)
210

311
const sizeStyles = StyleSheet.create({
412
xlarge: {
@@ -23,12 +31,4 @@ const styles = StyleSheet.create({
2331
}
2432
})
2533

26-
const Heading = ({ children, size = 'normal' }) => (
27-
<Text
28-
accessibilityRole='heading'
29-
children={children}
30-
style={{ ...styles.root, ...sizeStyles[size] }}
31-
/>
32-
)
33-
3434
export default Heading
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
1-
import React, { StyleSheet, Text, View } from '../../src'
2-
3-
const styles = StyleSheet.create({
4-
root: {
5-
alignItems: 'center',
6-
borderWidth: 1,
7-
marginVertical: 10,
8-
padding: 10
9-
},
10-
heading: {
11-
fontWeight: 'bold',
12-
padding: 5,
13-
textAlign: 'center'
14-
},
15-
text: {
16-
textAlign: 'center'
17-
}
18-
})
1+
import React, { StyleSheet, Text, View } from 'react-native'
192

203
const MediaQueryWidget = ({ mediaQuery = {} }) => {
214
const active = Object.keys(mediaQuery).reduce((active, alias) => {
@@ -36,4 +19,21 @@ const MediaQueryWidget = ({ mediaQuery = {} }) => {
3619
)
3720
}
3821

22+
const styles = StyleSheet.create({
23+
root: {
24+
alignItems: 'center',
25+
borderWidth: 1,
26+
marginVertical: 10,
27+
padding: 10
28+
},
29+
heading: {
30+
fontWeight: 'bold',
31+
padding: 5,
32+
textAlign: 'center'
33+
},
34+
text: {
35+
textAlign: 'center'
36+
}
37+
})
38+
3939
export default MediaQueryWidget

examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { MediaProvider, matchMedia } from 'react-media-queries'
22
import App from './components/App'
33
import createGetter from 'react-media-queries/lib/createMediaQueryGetter'
44
import createListener from 'react-media-queries/lib/createMediaQueryListener'
5-
import React, { AppRegistry } from '../src'
5+
import React, { AppRegistry } from 'react-native'
66

77
const mediaQueries = {
88
small: '(min-width: 300px)',

src/apis/AppRegistry/ReactNativeApp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Portal from '../../components/Portal'
22
import React, { Component, PropTypes } from 'react'
33
import ReactDOM from 'react-dom'
4-
import StyleSheet from '../../apis/StyleSheet'
4+
import StyleSheet from '../StyleSheet'
55
import View from '../../components/View'
66

77
export default class ReactNativeApp extends Component {

src/apis/NetInfo/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ const NetInfo = {
7575
}
7676
}
7777
}
78+
79+
export default NetInfo

src/components/ScrollView/index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@ import React, { Component, PropTypes } from 'react'
33
import StyleSheet from '../../apis/StyleSheet'
44
import View from '../View'
55

6-
const styles = StyleSheet.create({
7-
initial: {
8-
flex: 1,
9-
overflow: 'auto'
10-
},
11-
initialContentContainer: {
12-
flex: 1
13-
},
14-
row: {
15-
flexDirection: 'row'
16-
}
17-
})
18-
196
export default class ScrollView extends Component {
207
static propTypes = {
218
children: PropTypes.any,
@@ -127,3 +114,16 @@ export default class ScrollView extends Component {
127114
)
128115
}
129116
}
117+
118+
const styles = StyleSheet.create({
119+
initial: {
120+
flex: 1,
121+
overflow: 'auto'
122+
},
123+
initialContentContainer: {
124+
flex: 1
125+
},
126+
row: {
127+
flexDirection: 'row'
128+
}
129+
})

src/components/Text/index.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@ import StyleSheet from '../../apis/StyleSheet'
44
import StyleSheetPropType from '../../apis/StyleSheet/StyleSheetPropType'
55
import TextStylePropTypes from './TextStylePropTypes'
66

7-
const styles = StyleSheet.create({
8-
initial: {
9-
color: 'inherit',
10-
display: 'inline',
11-
font: 'inherit',
12-
margin: 0,
13-
padding: 0,
14-
textDecoration: 'none',
15-
wordWrap: 'break-word'
16-
},
17-
singleLineStyle: {
18-
maxWidth: '100%',
19-
overflow: 'hidden',
20-
textOverflow: 'ellipsis',
21-
whiteSpace: 'nowrap'
22-
}
23-
})
24-
257
export default class Text extends Component {
268
static propTypes = {
279
accessibilityLabel: CoreComponent.propTypes.accessibilityLabel,
@@ -64,3 +46,21 @@ export default class Text extends Component {
6446
)
6547
}
6648
}
49+
50+
const styles = StyleSheet.create({
51+
initial: {
52+
color: 'inherit',
53+
display: 'inline',
54+
font: 'inherit',
55+
margin: 0,
56+
padding: 0,
57+
textDecoration: 'none',
58+
wordWrap: 'break-word'
59+
},
60+
singleLineStyle: {
61+
maxWidth: '100%',
62+
overflow: 'hidden',
63+
textOverflow: 'ellipsis',
64+
whiteSpace: 'nowrap'
65+
}
66+
})

0 commit comments

Comments
 (0)