Skip to content

Commit a7c44fb

Browse files
committed
* remove platform check
* remove value in textinput * remove initial cafe id * add a placeholder * add a notice for no cafe id
1 parent 2894612 commit a7c44fb

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

source/views/menus/dev-bonapp-picker.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow
22
import * 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'
45
import {TabBarIcon} from '@frogpond/navigation-tabs'
56
import * as c from '@frogpond/colors'
67
import {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

Comments
 (0)