Skip to content

Commit 69d1b10

Browse files
committed
Merge branch 'stateful-list-split' into react-navigation-take2
* stateful-list-split: add a button to "submit" the report automatically go back when the user deletes a schedule fix an accidental quote in jsx body add temporary dep on react-native-datepicker add initial fully-featured building editor add initial actual data display to ReportProblem poke at the reporting view a bit update references to PushButton extract more custom cells to components/ add a "delete" button to the components folder move CellToggle to the components folder added custom container style options to touchable move textfield from login to components reverse "set" and "schedule" in BuildingHoursDetail split building-hours-helpers apart into individual files extract building hours stateful list from the index file
2 parents 2a22e9f + 82c2410 commit 69d1b10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1391
-610
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"react-native-button": "1.8.2",
7373
"react-native-communications": "2.2.1",
7474
"react-native-custom-tabs": "0.1.4",
75+
"react-native-datepicker": "1.5.1",
7576
"react-native-device-info": "0.10.2",
7677
"react-native-google-analytics-bridge": "5.0.1",
7778
"react-native-keychain": "1.2.0",

source/navigation.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import JobDetailView from './views/sis/student-work/detail'
1717
import {
1818
BuildingHoursView,
1919
BuildingHoursDetailView,
20+
BuildingHoursProblemReportView,
21+
BuildingHoursScheduleEditorView,
2022
} from './views/building-hours'
2123
import TransportationView from './views/transportation'
2224
import SettingsView from './views/settings'
@@ -34,6 +36,8 @@ export const AppNavigator = StackNavigator(
3436
HomeView: {screen: HomeView},
3537
BuildingHoursDetailView: {screen: BuildingHoursDetailView},
3638
BuildingHoursView: {screen: BuildingHoursView},
39+
BuildingHoursProblemReportView: {screen: BuildingHoursProblemReportView},
40+
BuildingHoursScheduleEditorView: {screen: BuildingHoursScheduleEditorView},
3741
CalendarView: {screen: CalendarView},
3842
ContactsView: {screen: ContactsView},
3943
CreditsView: {screen: CreditsView},

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

Lines changed: 0 additions & 301 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {BuildingType} from '../types'
1111
import moment from 'moment-timezone'
1212
import ParallaxView from 'react-native-parallax-view'
1313
import * as c from '../../components/colors'
14-
import {getShortBuildingStatus} from '../building-hours-helpers'
14+
import {getShortBuildingStatus} from '../lib'
1515

1616
import {Badge} from './badge'
1717
import {Header} from './header'

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import type {BuildingType} from '../types'
1010
import type momentT from 'moment'
1111
import moment from 'moment-timezone'
1212
import {BuildingDetail} from './building'
13-
14-
const CENTRAL_TZ = 'America/Winnipeg'
13+
import {CENTRAL_TZ} from '../lib'
1514

1615
export class BuildingHoursDetailView extends React.PureComponent {
1716
static navigationOptions = ({navigation}) => {
@@ -42,6 +41,12 @@ export class BuildingHoursDetailView extends React.PureComponent {
4241
this.setState({now: moment.tz(CENTRAL_TZ)})
4342
}
4443

44+
reportProblem = () => {
45+
this.props.navigation.navigate('BuildingHoursProblemReportView', {
46+
initialBuilding: this.props.navigation.state.params.building,
47+
})
48+
}
49+
4550
render() {
4651
const info = this.props.navigation.state.params.building
4752
const {now} = this.state

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ import React from 'react'
88
import {View, Text, StyleSheet} from 'react-native'
99
import type {SingleBuildingScheduleType} from '../types'
1010

11-
import {formatBuildingTimes, summarizeDays} from '../building-hours-helpers'
11+
import {formatBuildingTimes, summarizeDays} from '../lib'
1212

1313
export class ScheduleRow extends React.PureComponent {
1414
props: {
15-
schedule: SingleBuildingScheduleType,
15+
set: SingleBuildingScheduleType,
1616
isActive: boolean,
1717
now: moment,
1818
}
1919

2020
render() {
21-
const {schedule, isActive, now} = this.props
21+
const {set, isActive, now} = this.props
2222
return (
2323
<View style={styles.scheduleRow}>
2424
<StyledText style={[styles.scheduleDays, isActive && styles.bold]}>
25-
{summarizeDays(schedule.days)}
25+
{summarizeDays(set.days)}
2626
</StyledText>
2727

2828
<StyledText style={[styles.scheduleHours, isActive && styles.bold]}>
29-
{formatBuildingTimes(schedule, now)}
29+
{formatBuildingTimes(set, now)}
3030
</StyledText>
3131
</View>
3232
)

0 commit comments

Comments
 (0)