mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-22 06:18:41 +00:00
Update README; add guides to docs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import GridView from './GridView'
|
||||
import Heading from './Heading'
|
||||
import MediaQueryWidget from './MediaQueryWidget'
|
||||
import React, { Image, StyleSheet, ScrollView, Text, TextInput, Touchable, View } from '../../src'
|
||||
import React, { Image, StyleSheet, ScrollView, Text, TextInput, TouchableHighlight, View } from 'react-native'
|
||||
|
||||
export default class App extends React.Component {
|
||||
static propTypes = {
|
||||
@@ -25,7 +25,8 @@ export default class App extends React.Component {
|
||||
}
|
||||
|
||||
return (
|
||||
<View accessibilityRole='main' style={rootStyles}>
|
||||
<ScrollView accessibilityRole='main'>
|
||||
<View style={rootStyles}>
|
||||
<Heading size='xlarge'>React Native for Web</Heading>
|
||||
<Text>React Native Web takes the core components from <Text
|
||||
accessibilityRole='link' href='https://facebook.github.io/react-native/'>React
|
||||
@@ -107,7 +108,7 @@ export default class App extends React.Component {
|
||||
/>
|
||||
|
||||
<Heading size='large'>Touchable</Heading>
|
||||
<Touchable
|
||||
<TouchableHighlight
|
||||
accessibilityLabel={'Touchable element'}
|
||||
activeHighlight='lightblue'
|
||||
activeOpacity={0.8}
|
||||
@@ -119,7 +120,7 @@ export default class App extends React.Component {
|
||||
<View style={styles.touchableArea}>
|
||||
<Text>Touchable area (press, long press)</Text>
|
||||
</View>
|
||||
</Touchable>
|
||||
</TouchableHighlight>
|
||||
|
||||
<Heading size='large'>View</Heading>
|
||||
<Heading>Default layout</Heading>
|
||||
@@ -205,7 +206,8 @@ export default class App extends React.Component {
|
||||
))}
|
||||
</ScrollView>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+9
-5
@@ -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 from '../src'
|
||||
import React, { AppRegistry } from '../src'
|
||||
|
||||
const mediaQueries = {
|
||||
small: '(min-width: 300px)',
|
||||
@@ -10,10 +10,14 @@ const mediaQueries = {
|
||||
large: '(min-width: 500px)'
|
||||
}
|
||||
const ResponsiveApp = matchMedia()(App)
|
||||
|
||||
React.render(
|
||||
const WrappedApp = () => (
|
||||
<MediaProvider getMedia={createGetter(mediaQueries)} listener={createListener(mediaQueries)}>
|
||||
<ResponsiveApp />
|
||||
</MediaProvider>,
|
||||
document.getElementById('react-root')
|
||||
</MediaProvider>
|
||||
)
|
||||
|
||||
AppRegistry.registerComponent('Example', () => WrappedApp)
|
||||
|
||||
AppRegistry.runApplication('Example', {
|
||||
rootTag: document.getElementById('react-root')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user