Guest User

Untitled

a guest
Feb 23rd, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from 'react';
  2. import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
  3.  
  4. import Styles from './Styles'
  5. import Icon from 'react-native-vector-icons/Ionicons';
  6.  
  7. export default class Home extends Component<{}> {
  8.  
  9.  
  10.     constructor(props) {
  11.         super(props);
  12.     }
  13.  
  14.     static navigationOptions = {
  15.         header: (
  16.             <View style={Styles.header}>
  17.                 <View style={{
  18.                     flex: 0.1,
  19.                     justifyContent: 'center',
  20.                     alignItems: 'center',
  21.                     paddingLeft: 5,
  22.                     paddingTop: 10
  23.                 }}>
  24.                     <Icon
  25.                         name="md-menu"
  26.                         size={28} color="white" style={{ fontWeight: 'bold' }}
  27.                     />
  28.                 </View>
  29.                 <View style={{ flex: 0.8, justifyContent: 'center', alignItems: 'center', paddingTop: 5 }}>
  30.                     <Text style={Styles.locBtnText}> TOK-BOT </Text>
  31.                 </View>
  32.             </View>
  33.         )
  34.     };
  35.  
  36.     render() {
  37.         return (
  38.             <View style={Styles.container}>
  39.                 <View style={Styles.conBox}>
  40.                     <Text style={Styles.mainText}> OpenTok </Text>
  41.                     <Text style={Styles.mainText}> + </Text>
  42.                     <Text style={Styles.mainText}> React Native </Text>
  43.                 </View>
  44.                 <View style={Styles.eventContainer}>
  45.                     <TouchableOpacity style={Styles.eventBox} onPress={() => {
  46.                         this.props.navigation.navigate('Publish')
  47.                     }}>
  48.                         <View style={{ flex: 0.2, alignItems: 'center', justifyContent: 'center' }}>
  49.                             <Icon
  50.                                 name="ios-videocam"
  51.                                 size={40} color="white" style={{ fontWeight: 'bold' }}
  52.                             />
  53.                         </View>
  54.                         <View style={{ flex: 0.8, justifyContent: 'center' }}>
  55.                             <Text style={Styles.locBtnText}> Publish </Text>
  56.                         </View>
  57.                     </TouchableOpacity>
  58.                     <TouchableOpacity style={Styles.eventBox} onPress={() => {
  59.                         this.props.navigation.navigate('Viewer')
  60.                     }}>
  61.                         <View style={{ flex: 0.2, alignItems: 'center', justifyContent: 'center' }}>
  62.                             <Icon
  63.                                 name="ios-eye"
  64.                                 size={40} color="white" style={{ fontWeight: 'bold' }}
  65.                             />
  66.                         </View>
  67.                         <View style={{ flex: 0.8, justifyContent: 'center' }}>
  68.                             <Text style={Styles.locBtnText}> View </Text>
  69.                         </View>
  70.                     </TouchableOpacity>
  71.                 </View>
  72.             </View>
  73.         );
  74.     }
  75.  
  76.     publishAndView(type) {
  77.         this.props.navigation.navigate(type)
  78.     }
  79. }
  80.  
  81. const styles = StyleSheet.create({
  82.     container: {
  83.         flex: 1,
  84.         backgroundColor: 'white'
  85.     },
  86.     welcome: {
  87.         fontSize: 20,
  88.         textAlign: 'center',
  89.         margin: 10,
  90.     },
  91.     instructions: {
  92.         textAlign: 'center',
  93.         color: '#333333',
  94.         marginBottom: 5,
  95.     },
  96. });
Advertisement
Add Comment
Please, Sign In to add comment