Skip to content

Commit d8a02ea

Browse files
committed
inline react components in the tab defs
1 parent ae06aa2 commit d8a02ea

File tree

4 files changed

+99
-114
lines changed

4 files changed

+99
-114
lines changed

source/views/calendar/index.js

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,38 @@ import {GoogleCalendarView} from './calendar-google'
1212

1313
export {EventDetail} from './event-detail'
1414

15-
const StOlafTab = ({navigation}) =>
16-
<GoogleCalendarView
17-
navigation={navigation}
18-
calendarId="[email protected]"
19-
/>
20-
21-
const OlevilleTab = ({navigation}) =>
22-
<GoogleCalendarView
23-
navigation={navigation}
24-
calendarId="[email protected]"
25-
/>
26-
27-
const NorthfieldTab = ({navigation}) =>
28-
<GoogleCalendarView
29-
navigation={navigation}
30-
calendarId="[email protected]"
31-
/>
32-
3315
export default TabNavigator(
3416
{
3517
StOlafCalendarView: {
36-
screen: StOlafTab,
18+
screen: ({navigation}) =>
19+
<GoogleCalendarView
20+
navigation={navigation}
21+
calendarId="[email protected]"
22+
/>,
3723
navigationOptions: {
3824
tabBarLabel: 'St. Olaf',
3925
tabBarIcon: TabBarIcon('school'),
4026
},
4127
},
28+
4229
OlevilleCalendarView: {
43-
screen: OlevilleTab,
30+
screen: ({navigation}) =>
31+
<GoogleCalendarView
32+
navigation={navigation}
33+
calendarId="[email protected]"
34+
/>,
4435
navigationOptions: {
4536
tabBarLabel: 'Oleville',
4637
tabBarIcon: TabBarIcon('happy'),
4738
},
4839
},
40+
4941
NorthfieldCalendarView: {
50-
screen: NorthfieldTab,
42+
screen: ({navigation}) =>
43+
<GoogleCalendarView
44+
navigation={navigation}
45+
calendarId="[email protected]"
46+
/>,
5147
navigationOptions: {
5248
tabBarLabel: 'Northfield',
5349
tabBarIcon: TabBarIcon('pin'),

source/views/menus/index.js

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,6 @@ import {
2020
} from './carleton-menus'
2121
// import {BonAppPickerView} from './dev-bonapp-picker'
2222

23-
const StavHallTab = ({navigation}) =>
24-
<BonAppHostedMenu
25-
navigation={navigation}
26-
name="stav"
27-
cafeId="261"
28-
loadingMessage={[
29-
'Hunting Ferndale Turkey…',
30-
'Tracking wild vegan burgers…',
31-
'"Cooking" some lutefisk…',
32-
]}
33-
/>
34-
35-
const TheCageTab = ({navigation}) =>
36-
<BonAppHostedMenu
37-
navigation={navigation}
38-
name="cage"
39-
cafeId="262"
40-
ignoreProvidedMenus={true}
41-
loadingMessage={['Checking for vegan cookies…', 'Serving up some shakes…']}
42-
/>
43-
44-
const ThePauseTab = ({navigation}) =>
45-
<GitHubHostedMenu
46-
navigation={navigation}
47-
name="pause"
48-
loadingMessage={['Mixing up a shake…', 'Spinning up pizzas…']}
49-
/>
50-
5123
const CarletonMenuPicker = StackNavigator(
5224
{
5325
CarletonCafeIndex: {screen: CarletonCafeIndex},
@@ -64,33 +36,62 @@ const CarletonMenuPicker = StackNavigator(
6436
export const MenusView = TabNavigator(
6537
{
6638
StavHallMenuView: {
67-
screen: StavHallTab,
39+
screen: ({navigation}) =>
40+
<BonAppHostedMenu
41+
navigation={navigation}
42+
name="stav"
43+
cafeId="261"
44+
loadingMessage={[
45+
'Hunting Ferndale Turkey…',
46+
'Tracking wild vegan burgers…',
47+
'"Cooking" some lutefisk…',
48+
]}
49+
/>,
6850
navigationOptions: {
6951
tabBarLabel: 'Stav Hall',
7052
tabBarIcon: TabBarIcon('nutrition'),
7153
},
7254
},
55+
7356
TheCageMenuView: {
74-
screen: TheCageTab,
57+
screen: ({navigation}) =>
58+
<BonAppHostedMenu
59+
navigation={navigation}
60+
name="cage"
61+
cafeId="262"
62+
ignoreProvidedMenus={true}
63+
loadingMessage={[
64+
'Checking for vegan cookies…',
65+
'Serving up some shakes…',
66+
]}
67+
/>,
7568
navigationOptions: {
7669
tabBarLabel: 'The Cage',
7770
tabBarIcon: TabBarIcon('cafe'),
7871
},
7972
},
73+
8074
ThePauseMenuView: {
81-
screen: ThePauseTab,
75+
screen: ({navigation}) =>
76+
<GitHubHostedMenu
77+
navigation={navigation}
78+
name="pause"
79+
loadingMessage={['Mixing up a shake…', 'Spinning up pizzas…']}
80+
/>,
8281
navigationOptions: {
8382
tabBarLabel: 'The Pause',
8483
tabBarIcon: TabBarIcon('paw'),
8584
},
8685
},
86+
8787
CarletonMenuListView: {
8888
screen: CarletonMenuPicker,
8989
navigationOptions: {
9090
title: 'Carleton',
9191
tabBarIcon: TabBarIcon('menu'),
9292
},
9393
},
94+
9495
// BonAppDevToolView: {screen: BonAppPickerView},
9596
},
9697
{

source/views/news/index.js

Lines changed: 43 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,82 +11,76 @@ import {TabBarIcon} from '../components/tabbar-icon'
1111

1212
import NewsContainer from './news-container'
1313

14-
const StOlafTab = ({navigation}) =>
15-
<NewsContainer
16-
navigation={navigation}
17-
mode="wp-json"
18-
url="https://wp.stolaf.edu/wp-json/wp/v2/posts"
19-
query={{per_page: 10, _embed: true}}
20-
name="St. Olaf"
21-
/>
22-
23-
const OlevilleTab = ({navigation}) =>
24-
<NewsContainer
25-
navigation={navigation}
26-
mode="wp-json"
27-
url="http://oleville.com/wp-json/wp/v2/posts/"
28-
query={{per_page: 10, _embed: true}}
29-
embedFeaturedImage={true}
30-
name="Oleville"
31-
/>
32-
33-
const MessTab = ({navigation}) =>
34-
<NewsContainer
35-
navigation={navigation}
36-
mode="rss"
37-
url="http://manitoumessenger.com/feed/"
38-
name="The Mess"
39-
/>
40-
41-
const PoliticOleTab = ({navigation}) =>
42-
<NewsContainer
43-
navigation={navigation}
44-
mode="rss"
45-
url="http://oleville.com/politicole/feed/"
46-
name="PoliticOle"
47-
/>
48-
49-
const KstoTab = ({navigation}) =>
50-
<NewsContainer
51-
navigation={navigation}
52-
mode="wp-json"
53-
url="https://pages.stolaf.edu/ksto/wp-json/wp/v2/posts/"
54-
query={{per_page: 10, _embed: true}}
55-
name="KSTO"
56-
/>
57-
5814
export default TabNavigator(
5915
{
6016
StOlafNewsView: {
61-
screen: StOlafTab,
17+
screen: ({navigation}) =>
18+
<NewsContainer
19+
navigation={navigation}
20+
mode="wp-json"
21+
url="https://wp.stolaf.edu/wp-json/wp/v2/posts"
22+
query={{per_page: 10, _embed: true}}
23+
name="St. Olaf"
24+
/>,
6225
navigationOptions: {
6326
tabBarLabel: 'St. Olaf',
6427
tabBarIcon: TabBarIcon('school'),
6528
},
6629
},
30+
6731
OlevilleNewsView: {
68-
screen: OlevilleTab,
32+
screen: ({navigation}) =>
33+
<NewsContainer
34+
navigation={navigation}
35+
mode="wp-json"
36+
url="http://oleville.com/wp-json/wp/v2/posts/"
37+
query={{per_page: 10, _embed: true}}
38+
embedFeaturedImage={true}
39+
name="Oleville"
40+
/>,
6941
navigationOptions: {
7042
tabBarLabel: 'Oleville',
7143
tabBarIcon: TabBarIcon('happy'),
7244
},
7345
},
46+
7447
MessNewsView: {
75-
screen: MessTab,
48+
screen: ({navigation}) =>
49+
<NewsContainer
50+
navigation={navigation}
51+
mode="rss"
52+
url="http://manitoumessenger.com/feed/"
53+
name="The Mess"
54+
/>,
7655
navigationOptions: {
7756
tabBarLabel: 'The Mess',
7857
tabBarIcon: TabBarIcon('paper'),
7958
},
8059
},
60+
8161
PoliticOleNewsView: {
82-
screen: PoliticOleTab,
62+
screen: ({navigation}) =>
63+
<NewsContainer
64+
navigation={navigation}
65+
mode="rss"
66+
url="http://oleville.com/politicole/feed/"
67+
name="PoliticOle"
68+
/>,
8369
navigationOptions: {
8470
tabBarLabel: 'PoliticOle',
8571
tabBarIcon: TabBarIcon('megaphone'),
8672
},
8773
},
74+
8875
KstoNewsView: {
89-
screen: KstoTab,
76+
screen: ({navigation}) =>
77+
<NewsContainer
78+
navigation={navigation}
79+
mode="wp-json"
80+
url="https://pages.stolaf.edu/ksto/wp-json/wp/v2/posts/"
81+
query={{per_page: 10, _embed: true}}
82+
name="KSTO"
83+
/>,
9084
navigationOptions: {
9185
tabBarLabel: 'KSTO',
9286
tabBarIcon: TabBarIcon('radio'),

source/views/transportation/index.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,34 @@ import {TabBarIcon} from '../components/tabbar-icon'
1212
import OtherModesView from './otherModes'
1313
import BusView from './bus'
1414

15-
const ExpressLineTab = () => <BusView line="Express Bus" />
16-
17-
const RedLineTab = () => <BusView line="Red Line" />
18-
19-
const BlueLineTab = () => <BusView line="Blue Line" />
20-
21-
const OtherModesTab = () => <OtherModesView />
22-
2315
export default TabNavigator(
2416
{
2517
ExpressLineBusView: {
26-
screen: ExpressLineTab,
18+
screen: () => <BusView line="Express Bus" />,
2719
navigationOptions: {
2820
tabBarLabel: 'Express Bus',
2921
tabBarIcon: TabBarIcon('bus'),
3022
},
3123
},
24+
3225
RedLineBusView: {
33-
screen: RedLineTab,
26+
screen: () => <BusView line="Red Line" />,
3427
navigationOptions: {
3528
tabBarLabel: 'Red Line',
3629
tabBarIcon: TabBarIcon('bus'),
3730
},
3831
},
39-
BlueLineBusView: {
40-
screen: BlueLineTab,
4132

33+
BlueLineBusView: {
34+
screen: () => <BusView line="Blue Line" />,
4235
navigationOptions: {
4336
tabBarLabel: 'Blue Line',
4437
tabBarIcon: TabBarIcon('bus'),
4538
},
4639
},
40+
4741
TransportationOtherModesListView: {
48-
screen: OtherModesTab,
42+
screen: OtherModesView,
4943
navigationOptions: {
5044
tabBarLabel: 'Other Modes',
5145
tabBarIcon: TabBarIcon('boat'),

0 commit comments

Comments
 (0)