{"size": 2744, "ext": "js", "max_stars_repo_path": "source/views/menus/carleton-menus.js", "max_stars_repo_name": "hawkrives/AAO-React-Native", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "source/views/menus/carleton-menus.js", "max_issues_repo_name": "hawkrives/AAO-React-Native", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "source/views/menus/carleton-menus.js", "max_forks_repo_name": "hawkrives/AAO-React-Native", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.7207207207, "max_line_length": 79, "alphanum_fraction": 0.6785714286}
// @flow
import * as React from 'react'
import {TabBarIcon} from '@frogpond/navigation-tabs'
import {View, Platform, ScrollView, StyleSheet} from 'react-native'
import type {TopLevelViewPropsType} from '../types'
import {Row} from '@frogpond/layout'
import {ListRow, ListSeparator, Title} from '@frogpond/lists'
import {BonAppHostedMenu} from './menu-bonapp'

export const CarletonBurtonMenuScreen = ({
	navigation,
}: TopLevelViewPropsType) => (
	<BonAppHostedMenu
		cafe="burton"
		loadingMessage={['Searching for Schiller…']}
		name="Burton"
		navigation={navigation}
	/>
)
CarletonBurtonMenuScreen.navigationOptions = {
	title: 'Burton',
	tabBarIcon: TabBarIcon('menu'),
}

export const CarletonLDCMenuScreen = ({navigation}: TopLevelViewPropsType) => (
	<BonAppHostedMenu
		cafe="ldc"
		loadingMessage={['Tracking down empty seats…']}
		name="LDC"
		navigation={navigation}
	/>
)
CarletonLDCMenuScreen.navigationOptions = {
	title: 'LDC',
	tabBarIcon: TabBarIcon('menu'),
}

export const CarletonWeitzMenuScreen = ({
	navigation,
}: TopLevelViewPropsType) => (
	<BonAppHostedMenu
		cafe="weitz"
		loadingMessage={['Observing the artwork…', 'Previewing performances…']}
		name="Weitz Center"
		navigation={navigation}
	/>
)
CarletonWeitzMenuScreen.navigationOptions = {
	title: 'Weitz Center',
	tabBarIcon: TabBarIcon('menu'),
}

export const CarletonSaylesMenuScreen = ({
	navigation,
}: TopLevelViewPropsType) => (
	<BonAppHostedMenu
		cafe="sayles"
		loadingMessage={['Engaging in people-watching…', 'Checking the mail…']}
		name="Sayles Hill"
		navigation={navigation}
	/>
)
CarletonSaylesMenuScreen.navigationOptions = {
	title: 'Sayles Hill',
	tabBarIcon: TabBarIcon('menu'),
}

type Props = TopLevelViewPropsType

export class CarletonCafeIndex extends React.Component<Props> {
	render() {
		const carletonCafes = [
			{id: 'CarletonBurtonMenuView', title: 'Burton'},
			{id: 'CarletonLDCMenuView', title: 'LDC'},
			{id: 'CarletonWeitzMenuView', title: 'Weitz Center'},
			{id: 'CarletonSaylesMenuView', title: 'Sayles Hill'},
		]

		return (
			<ScrollView style={styles.container}>
				{carletonCafes.map(
					(loc: {id: string, title: string}, i, collection) => (
						<View key={i}>
							<ListRow
								arrowPosition="center"
								onPress={() => this.props.navigation.navigate(loc.id)}
							>
								<Row alignItems="center">
									<Title style={styles.rowText}>{loc.title}</Title>
								</Row>
							</ListRow>
							{i < collection.length - 1 ? (
								<ListSeparator spacing={{left: 15}} />
							) : null}
						</View>
					),
				)}
			</ScrollView>
		)
	}
}

const styles = StyleSheet.create({
	rowText: {
		paddingVertical: 6,
	},
	container: {
		paddingTop: Platform.OS === 'ios' ? 20 : 0,
	},
})
