11// @flow
22import * as React from 'react'
3- import { View , TextInput , StyleSheet , Platform } from 'react-native'
3+ import { View , TextInput , StyleSheet } from 'react-native'
4+ import { NoticeView } from '@frogpond/notice'
45import { TabBarIcon } from '@frogpond/navigation-tabs'
56import * as c from '@frogpond/colors'
67import { Toolbar } from '@frogpond/toolbar'
@@ -35,7 +36,7 @@ export class BonAppPickerView extends React.PureComponent<Props, State> {
3536 }
3637
3738 state = {
38- cafeId : '34 ' ,
39+ cafeId : '' ,
3940 }
4041
4142 chooseCafe = ( cafeId : string ) => {
@@ -52,18 +53,22 @@ export class BonAppPickerView extends React.PureComponent<Props, State> {
5253 < TextInput
5354 keyboardType = "numeric"
5455 onEndEditing = { e => this . chooseCafe ( e . nativeEvent . text ) }
56+ placeholder = "id"
5557 returnKeyType = "done"
5658 style = { styles . default }
57- value = { Platform . OS === 'ios' ? this . state . cafeId : null }
5859 />
5960 </ Toolbar >
60- < BonAppHostedMenu
61- key = { this . state . cafeId }
62- cafe = { { id : this . state . cafeId } }
63- loadingMessage = { [ 'Loading…' ] }
64- name = "BonApp"
65- navigation = { this . props . navigation }
66- />
61+ { this . state . cafeId ? (
62+ < BonAppHostedMenu
63+ key = { this . state . cafeId }
64+ cafe = { { id : this . state . cafeId } }
65+ loadingMessage = { [ 'Loading…' ] }
66+ name = "BonApp"
67+ navigation = { this . props . navigation }
68+ />
69+ ) : (
70+ < NoticeView text = "Please enter a Cafe ID." />
71+ ) }
6772 </ View >
6873 )
6974 }
0 commit comments