Skip to content

Commit 41587d1

Browse files
committed
use the info-header module in reporting views
1 parent 8c7f32e commit 41587d1

File tree

2 files changed

+14
-62
lines changed

2 files changed

+14
-62
lines changed

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

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

77
import * as React from 'react'
8-
import {ScrollView, View, StyleSheet, Text} from 'react-native'
8+
import {ScrollView, View} from 'react-native'
99
import moment from 'moment-timezone'
10-
import * as c from '@frogpond/colors'
10+
import {InfoHeader} from '@frogpond/info-header'
1111
import {
1212
TableView,
1313
Section,
@@ -26,28 +26,6 @@ import type {TopLevelViewPropsType} from '../../types'
2626
import {summarizeDays, formatBuildingTimes, blankSchedule} from '../lib'
2727
import {submitReport} from './submit'
2828

29-
const styles = StyleSheet.create({
30-
helpWrapper: {
31-
backgroundColor: c.white,
32-
borderWidth: StyleSheet.hairlineWidth,
33-
borderTopColor: c.iosHeaderTopBorder,
34-
borderBottomColor: c.iosHeaderBottomBorder,
35-
marginBottom: 10,
36-
},
37-
helpTitle: {
38-
fontSize: 16,
39-
fontWeight: 'bold',
40-
paddingTop: 15,
41-
paddingHorizontal: 15,
42-
},
43-
helpDescription: {
44-
fontSize: 14,
45-
paddingTop: 5,
46-
paddingBottom: 15,
47-
paddingHorizontal: 15,
48-
},
49-
})
50-
5129
type Props = TopLevelViewPropsType & {
5230
navigation: {state: {params: {initialBuilding: BuildingType}}},
5331
}
@@ -203,13 +181,11 @@ export class BuildingHoursProblemReportView extends React.PureComponent<
203181

204182
return (
205183
<ScrollView>
206-
<View style={styles.helpWrapper}>
207-
<Text style={styles.helpTitle}>Thanks for spotting a problem!</Text>
208-
<Text style={styles.helpDescription}>
209-
If you could tell us what the new times are, we&rsquo;d greatly
210-
appreciate it.
211-
</Text>
212-
</View>
184+
<InfoHeader
185+
message="If you could tell us what the new times are, we&rsquo;d greatly
186+
appreciate it."
187+
title="Thanks for spotting a problem!"
188+
/>
213189

214190
<TableView>
215191
{schedules.map((s, i) => (

source/views/dictionary/report/editor.js

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow
22
import * as React from 'react'
3-
import {ScrollView, View, Text, StyleSheet} from 'react-native'
3+
import {ScrollView} from 'react-native'
4+
import {InfoHeader} from '@frogpond/info-header'
45
import {
56
TableView,
67
Section,
@@ -9,7 +10,6 @@ import {
910
} from '@frogpond/tableview'
1011
import {submitReport} from './submit'
1112
import type {WordType} from '../types'
12-
import * as c from '@frogpond/colors'
1313
import type {TopLevelViewPropsType} from '../../types'
1414

1515
type Props = TopLevelViewPropsType & {
@@ -65,13 +65,11 @@ export class DictionaryEditorView extends React.PureComponent<Props, State> {
6565
keyboardDismissMode="on-drag"
6666
keyboardShouldPersistTaps="always"
6767
>
68-
<View style={styles.helpWrapper}>
69-
<Text style={styles.helpTitle}>Thanks for spotting a problem!</Text>
70-
<Text style={styles.helpDescription}>
71-
If you could tell us what the word and definition should be,
72-
we&rsquo;d greatly appreciate it.
73-
</Text>
74-
</View>
68+
<InfoHeader
69+
message="If you could tell us what the word and definition should be,
70+
we&rsquo;d greatly appreciate it."
71+
title="Thanks for spotting a problem!"
72+
/>
7573

7674
<TableView>
7775
<Section header="WORD">
@@ -120,25 +118,3 @@ const DefinitionCell = ({text, onChange = () => {}}: TextFieldProps) => (
120118
value={text}
121119
/>
122120
)
123-
124-
const styles = StyleSheet.create({
125-
helpWrapper: {
126-
backgroundColor: c.white,
127-
borderWidth: StyleSheet.hairlineWidth,
128-
borderTopColor: c.iosHeaderTopBorder,
129-
borderBottomColor: c.iosHeaderBottomBorder,
130-
marginBottom: 10,
131-
},
132-
helpTitle: {
133-
fontSize: 16,
134-
fontWeight: 'bold',
135-
paddingTop: 15,
136-
paddingHorizontal: 15,
137-
},
138-
helpDescription: {
139-
fontSize: 14,
140-
paddingTop: 5,
141-
paddingBottom: 15,
142-
paddingHorizontal: 15,
143-
},
144-
})

0 commit comments

Comments
 (0)