Files
react-native-vector-icons/Examples/IconExplorer/index.windows.js
James McGinty f92e7a2c12 Add support for windows port (#308)
* Update README.md

* Update create-icon-set.js

Add support for windows port

* Update README.md

Add support for windows port

* Update README.md

* Update README.md

* Update README.md

Changed the instructions for adding the fonts to link to the original file, instead of copying the file.

* Update README.md

Mention Windows as a supported platform

* Add windows example

* Link fonts into windows project

* Add "windows" keyword

* update to latest package.json to resolve merge conflict

* Bump up to version 0.35.0 & fix merge confict

* finish upgrade from react native 0.32 -> 0.35
2016-10-26 23:07:17 +02:00

85 lines
1.7 KiB
JavaScript

/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Dimensions,
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import IconSetList from './IconSetList';
import IconList from './IconList';
const LEFT_PANEL_WIDTH = 300;
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
},
leftPanel: {
width: LEFT_PANEL_WIDTH,
},
rightPanel: {
flex: 1,
backgroundColor: '#fff',
},
welcomeWrapper: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
welcomeText: {
color: '#999',
fontSize: 20,
},
});
class Welcome extends Component {
render() {
return (
<View style={styles.welcomeWrapper}>
<Text style={styles.welcomeText}>Choose an icon set on the left side</Text>
</View>
);
}
}
class IconExplorer extends Component {
constructor() {
super();
this.state = {
iconSet: null,
layout: Dimensions.get('window'),
};
}
render() {
const { iconSet, iconSetTitle, layout } = this.state;
return (
<View style={styles.container} onLayout={(e) => this.setState({layout: e.nativeEvent.layout})}>
<View style={styles.leftPanel}>
<IconSetList navigator={{ push: (route) => this.setState({ iconSet: route.iconSet }) }}/>
</View>
<View style={[styles.rightPanel, { width: layout.width - LEFT_PANEL_WIDTH }]}>
{(iconSet
? (<IconList iconSet={iconSet} />)
: (<Welcome />)
)}
</View>
</View>
);
}
}
AppRegistry.registerComponent('IconExplorer', () => IconExplorer);