[fix] NetInfo export

This commit is contained in:
Nicolas Gallagher
2016-02-18 23:03:59 -08:00
parent e5ecc26d21
commit 0567232942
10 changed files with 82 additions and 79 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
[![Build Status][travis-image]][travis-url]
[![npm version][npm-image]][npm-url]
![gzipped size](https://img.shields.io/badge/gzipped-~22.6k-blue.svg)
![gzipped size](https://img.shields.io/badge/gzipped-~23k-blue.svg)
[React Native][react-native-url] components and APIs for the Web.
+4 -3
View File
@@ -1,5 +1,6 @@
var constants = require('./constants')
var webpack = require('webpack')
const constants = require('./constants')
const path = require('path')
const webpack = require('webpack')
module.exports = {
devServer: {
@@ -30,7 +31,7 @@ module.exports = {
],
resolve: {
alias: {
'react-native': '../../src'
'react-native': path.join(__dirname, '../dist/react-native-web')
}
}
}
+15 -15
View File
@@ -1,18 +1,4 @@
import React, { Component, PropTypes, StyleSheet, View } from '../../src'
const styles = StyleSheet.create({
root: {
overflow: 'hidden'
},
contentContainer: {
flexDirection: 'row',
flexGrow: 1
},
// distribute all space (rather than extra space)
column: {
flexBasis: '0%'
}
})
import React, { Component, PropTypes, StyleSheet, View } from 'react-native'
export default class GridView extends Component {
static propTypes = {
@@ -63,3 +49,17 @@ export default class GridView extends Component {
)
}
}
const styles = StyleSheet.create({
root: {
overflow: 'hidden'
},
contentContainer: {
flexDirection: 'row',
flexGrow: 1
},
// distribute all space (rather than extra space)
column: {
flexBasis: '0%'
}
})
+9 -9
View File
@@ -1,4 +1,12 @@
import React, { StyleSheet, Text } from '../../src'
import React, { StyleSheet, Text } from 'react-native'
const Heading = ({ children, size = 'normal' }) => (
<Text
accessibilityRole='heading'
children={children}
style={{ ...styles.root, ...sizeStyles[size] }}
/>
)
const sizeStyles = StyleSheet.create({
xlarge: {
@@ -23,12 +31,4 @@ const styles = StyleSheet.create({
}
})
const Heading = ({ children, size = 'normal' }) => (
<Text
accessibilityRole='heading'
children={children}
style={{ ...styles.root, ...sizeStyles[size] }}
/>
)
export default Heading
+18 -18
View File
@@ -1,21 +1,4 @@
import React, { StyleSheet, Text, View } from '../../src'
const styles = StyleSheet.create({
root: {
alignItems: 'center',
borderWidth: 1,
marginVertical: 10,
padding: 10
},
heading: {
fontWeight: 'bold',
padding: 5,
textAlign: 'center'
},
text: {
textAlign: 'center'
}
})
import React, { StyleSheet, Text, View } from 'react-native'
const MediaQueryWidget = ({ mediaQuery = {} }) => {
const active = Object.keys(mediaQuery).reduce((active, alias) => {
@@ -36,4 +19,21 @@ const MediaQueryWidget = ({ mediaQuery = {} }) => {
)
}
const styles = StyleSheet.create({
root: {
alignItems: 'center',
borderWidth: 1,
marginVertical: 10,
padding: 10
},
heading: {
fontWeight: 'bold',
padding: 5,
textAlign: 'center'
},
text: {
textAlign: 'center'
}
})
export default MediaQueryWidget
+1 -1
View File
@@ -2,7 +2,7 @@ import { MediaProvider, matchMedia } from 'react-media-queries'
import App from './components/App'
import createGetter from 'react-media-queries/lib/createMediaQueryGetter'
import createListener from 'react-media-queries/lib/createMediaQueryListener'
import React, { AppRegistry } from '../src'
import React, { AppRegistry } from 'react-native'
const mediaQueries = {
small: '(min-width: 300px)',
+1 -1
View File
@@ -1,7 +1,7 @@
import Portal from '../../components/Portal'
import React, { Component, PropTypes } from 'react'
import ReactDOM from 'react-dom'
import StyleSheet from '../../apis/StyleSheet'
import StyleSheet from '../StyleSheet'
import View from '../../components/View'
export default class ReactNativeApp extends Component {
+2
View File
@@ -75,3 +75,5 @@ const NetInfo = {
}
}
}
export default NetInfo
+13 -13
View File
@@ -3,19 +3,6 @@ import React, { Component, PropTypes } from 'react'
import StyleSheet from '../../apis/StyleSheet'
import View from '../View'
const styles = StyleSheet.create({
initial: {
flex: 1,
overflow: 'auto'
},
initialContentContainer: {
flex: 1
},
row: {
flexDirection: 'row'
}
})
export default class ScrollView extends Component {
static propTypes = {
children: PropTypes.any,
@@ -127,3 +114,16 @@ export default class ScrollView extends Component {
)
}
}
const styles = StyleSheet.create({
initial: {
flex: 1,
overflow: 'auto'
},
initialContentContainer: {
flex: 1
},
row: {
flexDirection: 'row'
}
})
+18 -18
View File
@@ -4,24 +4,6 @@ import StyleSheet from '../../apis/StyleSheet'
import StyleSheetPropType from '../../apis/StyleSheet/StyleSheetPropType'
import TextStylePropTypes from './TextStylePropTypes'
const styles = StyleSheet.create({
initial: {
color: 'inherit',
display: 'inline',
font: 'inherit',
margin: 0,
padding: 0,
textDecoration: 'none',
wordWrap: 'break-word'
},
singleLineStyle: {
maxWidth: '100%',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}
})
export default class Text extends Component {
static propTypes = {
accessibilityLabel: CoreComponent.propTypes.accessibilityLabel,
@@ -64,3 +46,21 @@ export default class Text extends Component {
)
}
}
const styles = StyleSheet.create({
initial: {
color: 'inherit',
display: 'inline',
font: 'inherit',
margin: 0,
padding: 0,
textDecoration: 'none',
wordWrap: 'break-word'
},
singleLineStyle: {
maxWidth: '100%',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}
})