|
| 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 | +}) |
0 commit comments