Skip to content

Commit 2a7f7c2

Browse files
committed
fix merge conflicts
1 parent 69d1b10 commit 2a7f7c2

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ const styles = StyleSheet.create({
3333
})
3434

3535
export class BuildingDetail extends React.PureComponent {
36-
props: {info: BuildingType, now: moment}
36+
props: {info: BuildingType, now: moment, onProblemReport: () => any}
3737

3838
render() {
39-
const {info, now} = this.props
39+
const {info, now, onProblemReport} = this.props
4040

4141
const headerImage = info.image && buildingImages.hasOwnProperty(info.image)
4242
? buildingImages[info.image]
@@ -55,7 +55,11 @@ export class BuildingDetail extends React.PureComponent {
5555

5656
<Badge status={openStatus} />
5757

58-
<ScheduleTable schedules={schedules} now={now} />
58+
<ScheduleTable
59+
schedules={schedules}
60+
now={now}
61+
onProblemReport={onProblemReport}
62+
/>
5963
</View>
6064
</ParallaxView>
6165
)

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import React from 'react'
99
import type {BuildingType} from '../types'
10-
import type momentT from 'moment'
1110
import moment from 'moment-timezone'
1211
import {BuildingDetail} from './building'
1312
import {CENTRAL_TZ} from '../lib'
13+
import type {TopLevelViewPropsType} from '../../types'
1414

1515
export class BuildingHoursDetailView extends React.PureComponent {
1616
static navigationOptions = ({navigation}) => {
@@ -19,7 +19,7 @@ export class BuildingHoursDetailView extends React.PureComponent {
1919
}
2020
}
2121

22-
state: {intervalId: number, now: momentT} = {
22+
state: {intervalId: number, now: moment} = {
2323
intervalId: 0,
2424
// now: moment.tz('Wed 7:25pm', 'ddd h:mma', null, CENTRAL_TZ),
2525
now: moment.tz(CENTRAL_TZ),
@@ -35,7 +35,9 @@ export class BuildingHoursDetailView extends React.PureComponent {
3535
clearTimeout(this.state.intervalId)
3636
}
3737

38-
props: {navigation: {state: {params: {building: BuildingType}}}}
38+
props: TopLevelViewPropsType & {
39+
navigation: {state: {params: {building: BuildingType}}},
40+
}
3941

4042
updateTime = () => {
4143
this.setState({now: moment.tz(CENTRAL_TZ)})
@@ -51,6 +53,12 @@ export class BuildingHoursDetailView extends React.PureComponent {
5153
const info = this.props.navigation.state.params.building
5254
const {now} = this.state
5355

54-
return <BuildingDetail info={info} now={now} />
56+
return (
57+
<BuildingDetail
58+
info={info}
59+
now={now}
60+
onProblemReport={this.reportProblem}
61+
/>
62+
)
5563
}
5664
}

source/views/building-hours/detail/schedule-table.android.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class ScheduleTable extends React.PureComponent {
1616
props: {
1717
now: moment,
1818
schedules: NamedBuildingScheduleType[],
19+
onProblemReport: () => any,
1920
}
2021

2122
render() {
@@ -39,7 +40,7 @@ export class ScheduleTable extends React.PureComponent {
3940
isActive={
4041
schedule.isPhysicallyOpen !== false &&
4142
set.days.includes(dayOfWeek) &&
42-
isBuildingOpenAtMoment(set, this.state.now)
43+
isScheduleOpenAtMoment(set, this.state.now)
4344
}
4445
/>,
4546
)}

source/views/building-hours/detail/schedule-table.ios.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import React from 'react'
8-
import {TableView, Section} from 'react-native-tableview-simple'
8+
import {TableView, Section, Cell} from 'react-native-tableview-simple'
99
import moment from 'moment-timezone'
1010
import type {NamedBuildingScheduleType} from '../types'
1111
import {isScheduleOpenAtMoment, getDayOfWeek} from '../lib'
@@ -15,10 +15,11 @@ export class ScheduleTable extends React.PureComponent {
1515
props: {
1616
now: moment,
1717
schedules: NamedBuildingScheduleType[],
18+
onProblemReport: () => any,
1819
}
1920

2021
render() {
21-
const {now, schedules} = this.props
22+
const {now, schedules, onProblemReport} = this.props
2223
const dayOfWeek = getDayOfWeek(now)
2324

2425
return (
@@ -37,13 +38,13 @@ export class ScheduleTable extends React.PureComponent {
3738
isActive={
3839
schedule.isPhysicallyOpen !== false &&
3940
set.days.includes(dayOfWeek) &&
40-
isBuildingOpenAtMoment(set, now)
41+
isScheduleOpenAtMoment(set, now)
4142
}
4243
/>,
4344
)}
4445
</Section>,
4546
)}
46-
47+
4748
<Section>
4849
<Cell
4950
accessory="DisclosureIndicator"

source/views/building-hours/report/overview.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,7 @@ export class BuildingHoursProblemReportView extends React.PureComponent {
193193
</Section>
194194

195195
<Section footer="Thanks for reporting!">
196-
<ButtonCell
197-
title="Submit Report"
198-
onPress={this.submit}
199-
/>
196+
<ButtonCell title="Submit Report" onPress={this.submit} />
200197
</Section>
201198
</TableView>
202199
</ScrollView>

0 commit comments

Comments
 (0)