|
| 1 | +/** |
| 2 | + * Sample React Native App |
| 3 | + * https://github.com/facebook/react-native |
| 4 | + * @flow |
| 5 | + */ |
| 6 | + |
| 7 | +import React, {PropTypes,Component} from 'react'; |
| 8 | +import {observable, computed, reaction} from 'mobx' |
| 9 | +import {observer} from "mobx-react"; |
| 10 | +import {BaseComponent} from "restackx-core/lib/native"; |
| 11 | + |
| 12 | +import { |
| 13 | + StyleSheet, |
| 14 | + Text, |
| 15 | + View, |
| 16 | + Image, |
| 17 | + TouchableOpacity |
| 18 | +} from 'react-native'; |
| 19 | +import { Link} from 'react-router-native'; |
| 20 | + |
| 21 | + |
| 22 | +@observer |
| 23 | +class LaunchPage extends BaseComponent { |
| 24 | + |
| 25 | + componentWillMount() { |
| 26 | + |
| 27 | + } |
| 28 | + componentDidMount() { |
| 29 | + // this.context.store.launch.launchActionHandle(); |
| 30 | + // console.log(this.context.store.launch.user); |
| 31 | + } |
| 32 | + render() { |
| 33 | + |
| 34 | + return ( |
| 35 | + <View style={styles.container}> |
| 36 | + <View style={styles.content}> |
| 37 | + <Image style={styles.logo} source={require('../../resource/restack_logo.png')}/> |
| 38 | + <Text style={styles.instructions}>Welcome to restack-core {'\n'} for react-native</Text> |
| 39 | + <Link to={'/main'} replace={true} component={TouchableOpacity}> |
| 40 | + <Text style={styles.simpleLink}>link the simple</Text> |
| 41 | + </Link> |
| 42 | + <View style={{marginTop:35}}> |
| 43 | + <TouchableOpacity onPress={()=>{this.props.history.push('/app')}}> |
| 44 | + <Text style={styles.open} >Open Your's App</Text> |
| 45 | + </TouchableOpacity> |
| 46 | + </View> |
| 47 | + |
| 48 | + |
| 49 | + </View> |
| 50 | + |
| 51 | + </View> |
| 52 | + );s |
| 53 | + } |
| 54 | +} |
| 55 | + |
| 56 | +const styles = StyleSheet.create({ |
| 57 | + container: { |
| 58 | + flex: 1, |
| 59 | + // justifyContent: 'center', |
| 60 | + alignItems: 'center', |
| 61 | + backgroundColor: '#ffffff', |
| 62 | + }, |
| 63 | + content:{ |
| 64 | + alignItems: 'center', |
| 65 | + backgroundColor: '#ffffff', |
| 66 | + marginTop:150 |
| 67 | + |
| 68 | + }, |
| 69 | + logo: { |
| 70 | + // width:80, |
| 71 | + height:60, |
| 72 | + resizeMode : Image.resizeMode.center |
| 73 | + }, |
| 74 | + instructions: { |
| 75 | + color: '#2c2c2c', |
| 76 | + textAlign: 'center', |
| 77 | + marginTop:35 |
| 78 | + |
| 79 | + }, |
| 80 | + simpleLink:{ |
| 81 | + color: '#1781ff', |
| 82 | + textAlign: 'center', |
| 83 | + marginTop:15, |
| 84 | + textDecorationLine:'underline' |
| 85 | + }, |
| 86 | + open:{ |
| 87 | + color: '#1781ff', |
| 88 | + textAlign: 'center', |
| 89 | + } |
| 90 | +}); |
| 91 | + |
| 92 | +LaunchPage.prototypes = { |
| 93 | + id: PropTypes.string |
| 94 | +} |
| 95 | +export default LaunchPage; |
| 96 | + |
0 commit comments