Skip to content

Commit e04aaea

Browse files
authored
Merge pull request #1475 from StoDevX/remove-parallax-building-hours
Remove parallax building hours image
2 parents be2b56d + 88eb27f commit e04aaea

File tree

4 files changed

+29
-41
lines changed

4 files changed

+29
-41
lines changed

images/transparent.png

-740 Bytes
Binary file not shown.

package-lock.json

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
"react-native-maps": "0.16.3",
7878
"react-native-network-info": "2.2.0",
7979
"react-native-onesignal": "3.0.5",
80-
"react-native-parallax-view": "2.0.6",
8180
"react-native-restart": "0.0.3",
8281
"react-native-safari-view": "2.0.0",
8382
"react-native-search-bar": "3.0.0",

source/views/building-hours/detail/building.js

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
*/
66

77
import React from 'react'
8-
import {View, StyleSheet, Platform} from 'react-native'
8+
import {ScrollView, StyleSheet, Platform, Image} from 'react-native'
99
import {buildingImages} from '../../../../images/building-images'
1010
import type {BuildingType} from '../types'
1111
import moment from 'moment-timezone'
12-
import ParallaxView from 'react-native-parallax-view'
1312
import * as c from '../../components/colors'
1413
import {getShortBuildingStatus} from '../lib'
1514

@@ -18,10 +17,9 @@ import {Header} from './header'
1817
import {ScheduleTable} from './schedule-table'
1918
import {ListFooter} from '../../components/list'
2019

21-
const transparentPixel = require('../../../../images/transparent.png')
22-
2320
const 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

3638
type 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

Comments
 (0)