55 */
66
77import React from 'react'
8- import { View , StyleSheet , Platform } from 'react-native'
8+ import { ScrollView , StyleSheet , Platform , Image } from 'react-native'
99import { buildingImages } from '../../../../images/building-images'
1010import type { BuildingType } from '../types'
1111import moment from 'moment-timezone'
12- import ParallaxView from 'react-native-parallax-view'
1312import * as c from '../../components/colors'
1413import { getShortBuildingStatus } from '../lib'
1514
@@ -18,10 +17,9 @@ import {Header} from './header'
1817import { ScheduleTable } from './schedule-table'
1918import { ListFooter } from '../../components/list'
2019
21- const transparentPixel = require ( '../../../../images/transparent.png' )
22-
2320const styles = StyleSheet . create ( {
24- scrollableStyle : {
21+ container : {
22+ alignItems : 'stretch' ,
2523 ...Platform . select ( {
2624 android : {
2725 backgroundColor : c . androidLightBackground ,
@@ -31,6 +29,10 @@ const styles = StyleSheet.create({
3129 } ,
3230 } ) ,
3331 } ,
32+ image : {
33+ width : null ,
34+ height : 100 ,
35+ } ,
3436} )
3537
3638type Props = {
@@ -53,34 +55,34 @@ export class BuildingDetail extends React.Component<void, Props, void> {
5355
5456 const headerImage = info . image && buildingImages . hasOwnProperty ( info . image )
5557 ? buildingImages [ info . image ]
56- : transparentPixel
58+ : null
5759 const openStatus = getShortBuildingStatus ( info , now )
5860 const schedules = info . schedule || [ ]
5961
6062 return (
61- < ParallaxView
62- backgroundSource = { headerImage }
63- windowHeight = { 100 }
64- scrollableViewStyle = { styles . scrollableStyle }
65- >
66- < View >
67- < Header building = { info } />
68-
69- < Badge status = { openStatus } />
63+ < ScrollView contentContainerStyle = { styles . container } >
64+ { headerImage
65+ ? < Image
66+ source = { headerImage }
67+ resizeMode = "cover"
68+ style = { styles . image }
69+ />
70+ : null }
7071
71- < ScheduleTable
72- schedules = { schedules }
73- now = { now }
74- onProblemReport = { onProblemReport }
75- />
72+ < Header building = { info } />
73+ < Badge status = { openStatus } />
74+ < ScheduleTable
75+ schedules = { schedules }
76+ now = { now }
77+ onProblemReport = { onProblemReport }
78+ />
7679
77- < ListFooter
78- title = {
79- 'Building hours subject to change without notice\n\nData collected by the humans of All About Olaf'
80- }
81- />
82- </ View >
83- </ ParallaxView >
80+ < ListFooter
81+ title = {
82+ 'Building hours subject to change without notice\n\nData collected by the humans of All About Olaf'
83+ }
84+ />
85+ </ ScrollView >
8486 )
8587 }
8688}
0 commit comments