Skip to content

Commit 42ab53e

Browse files
authored
Merge pull request #1614 from StoDevX/list-footers-to-detail-footers
Move list footers (on lists with detail views) to the detail views
2 parents fcc7981 + e929d01 commit 42ab53e

File tree

8 files changed

+44
-16
lines changed

8 files changed

+44
-16
lines changed

source/views/building-hours/list.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type momentT from 'moment'
1313
import type {TopLevelViewPropsType} from '../types'
1414
import type {BuildingType} from './types'
1515

16-
import {ListSeparator, ListSectionHeader, ListFooter} from '../components/list'
16+
import {ListSeparator, ListSectionHeader} from '../components/list'
1717

1818
export {BuildingHoursDetailView} from './detail'
1919

@@ -47,13 +47,6 @@ export class BuildingHoursList extends React.PureComponent {
4747
return (
4848
<SectionList
4949
ItemSeparatorComponent={ListSeparator}
50-
ListFooterComponent={
51-
<ListFooter
52-
title={
53-
'Building hours subject to change without notice\n\nData collected by the humans of All About Olaf'
54-
}
55-
/>
56-
}
5750
sections={(this.props.buildings: any)}
5851
extraData={this.props}
5952
keyExtractor={this.keyExtractor}

source/views/calendar/event-detail.android.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import * as c from '../components/colors'
1111
import {ButtonCell} from '../components/cells/button'
1212
import {addToCalendar} from './calendar-util'
1313
import delay from 'delay'
14+
import {ListFooter} from '../components/list'
15+
16+
const STO_CALENDAR_URL = 'https://www.stolaf.edu/calendar'
1417

1518
const styles = StyleSheet.create({
1619
name: {
@@ -165,6 +168,11 @@ export class EventDetail extends React.PureComponent {
165168
message={this.state.message}
166169
disabled={this.state.disabled}
167170
/>
171+
172+
<ListFooter
173+
title="Powered by the St. Olaf Calendar"
174+
href={STO_CALENDAR_URL}
175+
/>
168176
</ScrollView>
169177
)
170178
}

source/views/calendar/event-detail.ios.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {CleanedEventType} from './types'
66
import type {TopLevelViewPropsType} from '../types'
77
import {ShareButton} from '../components/nav-buttons'
88
import openUrl from '../components/open-url'
9+
import {ListFooter} from '../components/list'
910
import {getTimes, getLinksFromEvent} from './clean-event'
1011
import {ButtonCell} from '../components/cells/button'
1112
import {addToCalendar} from './calendar-util'
@@ -17,6 +18,8 @@ const styles = StyleSheet.create({
1718
},
1819
})
1920

21+
const STO_CALENDAR_URL = 'https://www.stolaf.edu/calendar'
22+
2023
const shareItem = (event: CleanedEventType) => {
2124
const summary = event.summary ? event.summary : ''
2225
const times = getTimes(event) ? getTimes(event) : ''
@@ -134,6 +137,11 @@ export class EventDetail extends React.PureComponent {
134137
message={this.state.message}
135138
disabled={this.state.disabled}
136139
/>
140+
141+
<ListFooter
142+
title="Powered by the St. Olaf Calendar"
143+
href={STO_CALENDAR_URL}
144+
/>
137145
</TableView>
138146
</ScrollView>
139147
)

source/views/contacts/contact-detail.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
import React from 'react'
33
import {Alert, StyleSheet} from 'react-native'
44
import {Markdown} from '../components/markdown'
5+
import {ListFooter} from '../components/list'
56
import glamorous from 'glamorous-native'
67
import {phonecall} from 'react-native-communications'
78
import {tracker} from '../../analytics'
89
import {Button} from '../components/button'
910
import openUrl from '../components/open-url'
1011
import type {ContactType} from './types'
1112

13+
const AAO_URL = 'https://github.com/StoDevX/AAO-React-Native/issues/new'
14+
1215
const Title = glamorous.text({
1316
fontSize: 36,
1417
textAlign: 'center',
@@ -68,11 +71,18 @@ export class ContactsDetailView extends React.PureComponent {
6871
return (
6972
<Container>
7073
<Title selectable={true}>{contact.title}</Title>
74+
7175
<Markdown
7276
styles={{Paragraph: styles.paragraph}}
7377
source={contact.text}
7478
/>
79+
7580
<Button onPress={this.onPress} title={contact.buttonText} />
81+
82+
<ListFooter
83+
title="Collected by the humans of All About Olaf"
84+
href={AAO_URL}
85+
/>
7686
</Container>
7787
)
7888
}

source/views/contacts/contact-list.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import React from 'react'
88
import {SectionList, StyleSheet} from 'react-native'
99
import {ListSeparator, ListSectionHeader} from '../components/list'
10-
import {ListEmpty, ListFooter} from '../components/list'
10+
import {ListEmpty} from '../components/list'
1111
import {ContactRow} from './contact-row'
1212
import delay from 'delay'
1313
import {reportNetworkProblem} from '../../lib/report-network-problem'
@@ -18,7 +18,6 @@ import * as c from '../components/colors'
1818
import type {ContactType} from './types'
1919
import type {TopLevelViewPropsType} from '../types'
2020

21-
const AAO_URL = 'https://github.com/StoDevX/AAO-React-Native/issues/new'
2221
const GITHUB_URL =
2322
'https://stodevx.github.io/AAO-React-Native/contact-info.json'
2423

@@ -107,12 +106,6 @@ export class ContactsListView extends React.PureComponent<void, Props, State> {
107106
<SectionList
108107
ItemSeparatorComponent={ListSeparator}
109108
ListEmptyComponent={<ListEmpty mode="bug" />}
110-
ListFooterComponent={
111-
<ListFooter
112-
title="Collected by the humans of All About Olaf"
113-
href={AAO_URL}
114-
/>
115-
}
116109
style={styles.listContainer}
117110
data={groupedData}
118111
sections={groupedData}

source/views/dictionary/detail.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
import React from 'react'
33
import {StyleSheet} from 'react-native'
44
import {Markdown} from '../components/markdown'
5+
import {ListFooter} from '../components/list'
56
import glamorous from 'glamorous-native'
67
import type {WordType} from './types'
78

9+
// TODO: This doesn't point at the SA dictionary because they don't have an
10+
// overview page.
11+
const STO_SA_DICT_URL = 'https://github.com/StoDevX/AAO-React-Native/issues/new'
12+
813
const Term = glamorous.text({
914
fontSize: 36,
1015
textAlign: 'center',
@@ -43,6 +48,13 @@ export class DictionaryDetailView extends React.PureComponent {
4348
styles={{Paragraph: styles.paragraph}}
4449
source={item.definition}
4550
/>
51+
52+
<ListFooter
53+
title={
54+
'Collected by the humans of All About Olaf,\nfrom the Student Activities dictionary'
55+
}
56+
href={STO_SA_DICT_URL}
57+
/>
4658
</Container>
4759
)
4860
}

source/views/sis/student-work/detail.android.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ function LastUpdated({when}: {when: string}) {
135135
Last updated:
136136
{' '}
137137
{moment(when, 'YYYY/MM/DD').calendar()}
138+
{'\n'}
139+
Powered by St. Olaf Student Employment job postings
138140
</Text>
139141
: null
140142
}

source/views/sis/student-work/detail.ios.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ function LastUpdated({when}: {when: string}) {
103103
Last updated:
104104
{' '}
105105
{moment(when, 'YYYY/MM/DD').calendar()}
106+
{'\n'}
107+
Powered by St. Olaf Student Employment job postings
106108
</Text>
107109
: null
108110
}

0 commit comments

Comments
 (0)