Skip to content

Commit

Permalink
updated example app; added all views from hackathon-starter
Browse files Browse the repository at this point in the history
  • Loading branch information
Monte9 committed May 15, 2017
1 parent 102e1be commit ca9ee75
Show file tree
Hide file tree
Showing 13 changed files with 1,073 additions and 622 deletions.
5 changes: 5 additions & 0 deletions example/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Icon } from 'react-native-elements';
import Home from './src/drawer/home';
import SwipeDecker from './src/drawer/swipe_decker';
import Ratings from './src/drawer/ratings';
import Pricing from './src/drawer/pricing';

const SCREEN_WIDTH = Dimensions.get('window').width;

Expand Down Expand Up @@ -39,6 +40,10 @@ const MainRoot = DrawerNavigator(
path: '/ratings',
screen: Ratings,
},
Pricing: {
path: '/pricing',
screen: Pricing,
},
},
{
initialRouteName: 'Home',
Expand Down
25 changes: 18 additions & 7 deletions example/src/drawer/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { TabNavigator } from 'react-navigation';
import { Icon } from 'react-native-elements';

import ButtonsTab from '../tabs/buttons';
import IconsTab from '../tabs/icons';
import ListsTab from '../tabs/lists';
import FormsTab from '../tabs/forms';
import FontsTab from '../tabs/fonts';

const Home = TabNavigator(
Expand All @@ -24,16 +25,26 @@ const Home = TabNavigator(
),
},
},
IconsTab: {
screen: IconsTab,
path: '/icons',
ListsTab: {
screen: ListsTab,
path: '/lists',
navigationOptions: {
tabBarLabel: 'Icons',
tabBarLabel: 'Lists',
tabBarIcon: ({ tintColor, focused }) => (
<Icon name="list" size={30} type="entypo" color={tintColor} />
),
},
},
FormsTab: {
screen: FormsTab,
path: '/forms',
navigationOptions: {
tabBarLabel: 'Forms',
tabBarIcon: ({ tintColor, focused }) => (
<Icon
name={focused ? 'emoticon-cool' : 'emoticon-sad'}
name="wpforms"
size={30}
type="material-community"
type="font-awesome"
color={tintColor}
/>
),
Expand Down
32 changes: 32 additions & 0 deletions example/src/drawer/pricing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Expo from 'expo';
import React from 'react';
import { StackNavigator } from 'react-navigation';
import { Icon } from 'react-native-elements';

import Pricing from '../views/pricing';

const PricingDrawerItem = StackNavigator({
Pricing: {
screen: Pricing,
},
});

PricingDrawerItem.navigationOptions = {
drawerLabel: 'Pricing',
drawerIcon: ({ tintColor }) => (
<Icon
name="attach-money"
size={30}
style={{
width: 50,
height: 50,
alignItems: 'center',
justifyContent: 'center',
}}
type="material"
color={tintColor}
/>
),
};

export default PricingDrawerItem;
36 changes: 36 additions & 0 deletions example/src/tabs/forms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Expo from 'expo';
import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';

import { StackNavigator } from 'react-navigation';

import FormsHome from '../views/forms_home';
import FormsDetails from '../views/forms_details';

const FormsTabView = ({ navigation }) => <FormsHome navigation={navigation} />;

const FormsDetailTabView = ({ navigation }) => (
<FormsDetails
banner={`${navigation.state.params.name}s Profile`}
navigation={navigation}
/>
);

const FormsTab = StackNavigator({
Forms: {
screen: FormsTabView,
path: '/',
navigationOptions: {
title: 'Forms',
},
},
Forms_Detail: {
screen: FormsDetailTabView,
path: '/forms_detail',
navigationOptions: {
title: 'Forms Detail',
},
},
});

export default FormsTab;
35 changes: 0 additions & 35 deletions example/src/tabs/icons.js

This file was deleted.

35 changes: 35 additions & 0 deletions example/src/tabs/lists.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import Expo from 'expo';
import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';

import { StackNavigator } from 'react-navigation';

import ListsHome from '../views/lists_home';
import ListsDetails from '../views/lists_detail';

const ListsTabView = ({ navigation }) => (
<ListsHome banner="Lists" navigation={navigation} />
);

const ListsDetailTabView = ({ navigation }) => (
<ListsDetails banner="Lists Detail" navigation={navigation} />
);

const ListsTab = StackNavigator({
Home: {
screen: ListsTabView,
path: '/',
navigationOptions: () => ({
title: 'Lists',
}),
},
Lists_Detail: {
screen: ListsDetailTabView,
path: 'lists_detail',
navigationOptions: {
title: 'Lists Detail',
},
},
});

export default ListsTab;
Loading

0 comments on commit ca9ee75

Please sign in to comment.