Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import PRSNT_demo from './src/main.js'
- import NavAllDay from './src/components/navigation.js';
- import React, { Component } from 'react';
- import { AppRegistry, Text, Navigator, TouchableHighlight } from 'react-native';
- import Style from '../Style';
- console.log('doing this');
- export default class NavAllDay extends Component {
- render() {
- const routes = [
- {title: 'First Scene', index: 0},
- {title: 'Second Scene', index: 1},
- ];
- return (
- <Navigator
- style={Style.header}
- initialRoute={routes[0]}
- renderScene={(route, navigator) =>
- <TouchableHighlight onPress={() => {
- if (route.index === 0) {
- navigator.push(routes[1]);
- } else {
- navigator.pop();
- }
- }}>
- <Text>Hello {route.title}!</Text>
- </TouchableHighlight>
- }
- navigationBar={
- <Navigator.NavigationBar
- routeMapper={{
- LeftButton: (route, navigator, index, navState) =>
- {
- if (route.index === 0) {
- return null;
- } else {
- return (
- <TouchableHighlight onPress={() => navigator.pop()}>
- <Text>Back</Text>
- </TouchableHighlight>
- );
- }
- },
- RightButton: (route, navigator, index, navState) =>
- {
- if (route.index === 1) {
- return null;
- } else {
- return (
- <TouchableHighlight onPress={() => navigator.push(routes[1])}>
- <Text>Done</Text>
- </TouchableHighlight>
- );
- }
- },
- Title: (route, navigator, index, navState) =>
- { return (<Text>Awesome Nav Bar</Text>); },
- }}
- style={Style.header}
- />
- }
- />
- );
- }
- }
- AppRegistry.registerComponent('PRSNT_demo', () => NavAllDay)
- import React, { Component } from 'react';
- import Style from './Style';
- import {
- AppRegistry,
- Text,
- View
- } from 'react-native';
- export default class PRSNT_demo extends Component {
- render() {
- return (
- <View style={Style.container}>
- <View style={Style.invites}>
- <Text style={Style.presentListText}> Section</Text>
- </View>
- <View style={Style.presentList}>
- <Text style={Style.presentListText}>
- List
- </Text>
- </View>
- </View>
- );
- }
- }
- AppRegistry.registerComponent('PRSNT_demo', () => PRSNT_demo);
- import React, { Component } from 'react';
- import {
- AppRegistry,
- View
- } from 'react-native';
- import PRSNT_demo from './src/main.js'
- import NavAllDay from './src/components/navigation.js'
- export default class Main extends Component {
- render() {
- return (
- <View>
- <PRSNT_demo />
- <NavAllDay />
- </View>
- )
- }
- }
- AppRegistry.registerComponent('PRSNT_demo', () => Main);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement