Skip to content

Commit 648eb38

Browse files
committed
rework the carleton menus screen a bit… still not great
1 parent 54b5de4 commit 648eb38

File tree

3 files changed

+123
-107
lines changed

3 files changed

+123
-107
lines changed

source/views/menus/carleton-list.js

Lines changed: 0 additions & 105 deletions
This file was deleted.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// @flow
2+
import React from 'react'
3+
import {TabBarIcon} from '../components/tabbar-icon'
4+
import {View, Platform, ScrollView, StyleSheet} from 'react-native'
5+
import type {TopLevelViewPropsType} from '../types'
6+
import {Row} from '../components/layout'
7+
import {ListRow, ListSeparator, Title} from '../components/list'
8+
import {BonAppHostedMenu} from './menu-bonapp'
9+
10+
export const CarletonBurtonMenuScreen = ({navigation}: TopLevelViewPropsType) =>
11+
<BonAppHostedMenu
12+
navigation={navigation}
13+
name="burton"
14+
cafeId="35"
15+
loadingMessage={['Searching for Schiller…']}
16+
/>
17+
CarletonBurtonMenuScreen.navigationOptions = {
18+
title: 'Burton',
19+
tabBarIcon: TabBarIcon('menu'),
20+
}
21+
22+
export const CarletonLDCMenuScreen = ({navigation}: TopLevelViewPropsType) =>
23+
<BonAppHostedMenu
24+
navigation={navigation}
25+
name="ldc"
26+
cafeId="36"
27+
loadingMessage={['Tracking down empty seats…']}
28+
/>
29+
CarletonLDCMenuScreen.navigationOptions = {
30+
title: 'LDC',
31+
tabBarIcon: TabBarIcon('menu'),
32+
}
33+
34+
export const CarletonWeitzMenuScreen = ({navigation}: TopLevelViewPropsType) =>
35+
<BonAppHostedMenu
36+
navigation={navigation}
37+
name="weitz"
38+
cafeId="458"
39+
loadingMessage={['Observing the artwork…', 'Previewing performances…']}
40+
/>
41+
CarletonWeitzMenuScreen.navigationOptions = {
42+
title: 'Weitz Center',
43+
tabBarIcon: TabBarIcon('menu'),
44+
}
45+
46+
export const CarletonSaylesMenuScreen = ({navigation}: TopLevelViewPropsType) =>
47+
<BonAppHostedMenu
48+
navigation={navigation}
49+
name="sayles"
50+
cafeId="34"
51+
loadingMessage={['Engaging in people-watching…', 'Checking the mail…']}
52+
/>
53+
CarletonSaylesMenuScreen.navigationOptions = {
54+
title: 'Sayles Hill',
55+
tabBarIcon: TabBarIcon('menu'),
56+
}
57+
58+
export class CarletonCafeIndex extends React.Component {
59+
props: TopLevelViewPropsType
60+
61+
render() {
62+
const carletonCafes = [
63+
{id: 'CarletonBurtonMenuView', title: 'Burton'},
64+
{id: 'CarletonLDCMenuView', title: 'LDC'},
65+
{id: 'CarletonWeitzMenuView', title: 'Weitz Center'},
66+
{id: 'CarletonSaylesMenuView', title: 'Sayles Hill'},
67+
]
68+
69+
return (
70+
<ScrollView style={styles.container}>
71+
{carletonCafes.map((loc: {id: string, title: string}, i, collection) =>
72+
<View key={i}>
73+
<ListRow
74+
onPress={() => this.props.navigation.navigate(loc.id)}
75+
arrowPosition="center"
76+
>
77+
<Row alignItems="center">
78+
<Title style={styles.rowText}>{loc.title}</Title>
79+
</Row>
80+
</ListRow>
81+
{i < collection.length - 1
82+
? <ListSeparator spacing={{left: 15}} />
83+
: null}
84+
</View>,
85+
)}
86+
</ScrollView>
87+
)
88+
}
89+
}
90+
91+
const styles = StyleSheet.create({
92+
rowText: {
93+
paddingVertical: 6,
94+
},
95+
container: {
96+
paddingTop: Platform.OS === 'ios' ? 20 : 0,
97+
},
98+
})

source/views/menus/index.js

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
*/
66

77
import React from 'react'
8+
import {StackNavigator} from 'react-navigation'
89
import {TabNavigator} from '../components/tabbed-view'
910
import {TabBarIcon} from '../components/tabbar-icon'
10-
import * as c from '../components/colors'
1111

1212
import {BonAppHostedMenu} from './menu-bonapp'
1313
import {GitHubHostedMenu} from './menu-github'
14-
import {CarletonMenuPicker} from './carleton-list'
14+
import {
15+
CarletonCafeIndex,
16+
CarletonBurtonMenuScreen,
17+
CarletonLDCMenuScreen,
18+
CarletonWeitzMenuScreen,
19+
CarletonSaylesMenuScreen,
20+
} from './carleton-menus'
1521
// import {BonAppPickerView} from './dev-bonapp-picker'
1622

1723
const StavHallTab = ({navigation}) =>
@@ -42,6 +48,19 @@ const ThePauseTab = ({navigation}) =>
4248
loadingMessage={['Mixing up a shake…', 'Spinning up pizzas…']}
4349
/>
4450

51+
const CarletonMenuPicker = StackNavigator(
52+
{
53+
CarletonCafeIndex: {screen: CarletonCafeIndex},
54+
CarletonBurtonMenuView: {screen: CarletonBurtonMenuScreen},
55+
CarletonLDCMenuView: {screen: CarletonLDCMenuScreen},
56+
CarletonWeitzMenuView: {screen: CarletonWeitzMenuScreen},
57+
CarletonSaylesMenuView: {screen: CarletonSaylesMenuScreen},
58+
},
59+
{
60+
headerMode: 'none',
61+
},
62+
)
63+
4564
export const MenusView = TabNavigator(
4665
{
4766
StavHallMenuView: {
@@ -67,6 +86,10 @@ export const MenusView = TabNavigator(
6786
},
6887
CarletonMenuListView: {
6988
screen: CarletonMenuPicker,
89+
navigationOptions: {
90+
title: 'Carleton',
91+
tabBarIcon: TabBarIcon('menu'),
92+
},
7093
},
7194
// BonAppDevToolView: {screen: BonAppPickerView},
7295
},

0 commit comments

Comments
 (0)