// @flow import React from 'react'; import { shape, func, string, arrayOf } from 'prop-types'; import Food from './pages/Food'; import Places from './pages/Places'; import Faves from './pages/Faves'; import FoodItemDetail from './pages/FoodItemDetail'; import PlaceDetail from './pages/PlaceDetail'; export type Route = { title: string, component: React.Component, icon: string, }; export default { food: { title: 'Food', component: Food, icon: 'local-pizza', }, places: { title: 'Places', component: Places, icon: 'restaurant', }, faves: { title: 'Faves', component: Faves, icon: 'stars', }, foodDetail: { title: 'Food Details', component: FoodItemDetail, icon: 'local-pizza', }, placeDetail: { title: 'Place Details', component: PlaceDetail, icon: 'domain', }, }; export const routingContextPropTypes = { router: shape({ history: shape({ push: func.isRequired, replace: func.isRequired, goBack: func.isRequired, entries: arrayOf( shape({ pathname: string.isRequired, search: string.isRequired, }) ), }).isRequired, }).isRequired, }; export type RoutingContextFlowTypes = { router: { history: { push: Function, replace: Function, goBack: Function, entries: Array<{ pathname: string, search: string, }>, }, route: { location: { pathname: string, state: ?Object, }, }, }, match: { params: { type?: string, }, }, };