@@ -14,6 +14,7 @@ import findLast from 'lodash/findLast'
1414import { Separator } from '@frogpond/separator'
1515import { BusStopRow } from './components/bus-stop-row'
1616import { ListSectionHeader , ListFooter , ListRow } from '@frogpond/lists'
17+ import { InfoHeader } from '@frogpond/info-header'
1718
1819const styles = StyleSheet . create ( {
1920 separator : {
@@ -152,25 +153,34 @@ export class BusLine extends React.Component<Props, State> {
152153 const { line } = this . props
153154 const { schedule , subtitle } = this . state
154155
155- const headerEl = (
156+ const INFO_EL = (
156157 < ListSectionHeader
157158 subtitle = { subtitle }
158159 title = { line . line }
159160 titleStyle = { Platform . OS === 'android' ? { color : line . colors . bar } : null }
160161 />
161162 )
162163
163- const FOOTER_MSG = ` ${ this . props . line . notice || '' } ${
164- this . props . line . notice ? '\n\n' : ''
165- } Bus routes and times subject to change without notice\n\nData collected by the humans of All About Olaf`
164+ const LINE_MSG = line . notice || ''
165+ const FOOTER_MSG =
166+ ' Bus routes and times subject to change without notice\n\nData collected by the humans of All About Olaf'
166167 const FOOTER_EL = < ListFooter title = { FOOTER_MSG } />
167168
169+ const HEADER_EL = LINE_MSG ? (
170+ < React . Fragment >
171+ < InfoHeader message = { LINE_MSG } title = { `About ${ line . line } ` } />
172+ { INFO_EL }
173+ </ React . Fragment >
174+ ) : (
175+ INFO_EL
176+ )
177+
168178 return (
169179 < FlatList
170180 ItemSeparatorComponent = { BusLineSeparator }
171181 ListEmptyComponent = { EMPTY_SCHEDULE_MESSAGE }
172182 ListFooterComponent = { FOOTER_EL }
173- ListHeaderComponent = { headerEl }
183+ ListHeaderComponent = { HEADER_EL }
174184 data = { schedule ? schedule . timetable : [ ] }
175185 extraData = { this . state }
176186 keyExtractor = { this . keyExtractor }
0 commit comments