Skip to content

Commit 30b3f8e

Browse files
authored
Merge pull request #2217 from StoDevX/add-tes-view
Add tes view
2 parents f2f4c55 + 1b53915 commit 30b3f8e

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
"source/**/*.js",
5050
"!**/node_modules/**"
5151
],
52+
"transformIgnorePatterns": [
53+
"node_modules/(?!(jest-)?react-native|glamorous-native)"
54+
],
5255
"preset": "react-native"
5356
},
5457
"prettier": {

source/views/components/notice.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as React from 'react'
33
import {ActivityIndicator, StyleSheet, Text, View} from 'react-native'
44
import * as c from './colors'
55
import {Button} from './button'
6+
import {Heading} from './markdown/heading'
67

78
const styles = StyleSheet.create({
89
container: {
@@ -23,18 +24,28 @@ const styles = StyleSheet.create({
2324
})
2425

2526
type Props = {
27+
header?: string,
2628
text?: string,
2729
style?: any,
2830
spinner?: boolean,
2931
buttonText?: string,
3032
onPress?: () => any,
3133
}
3234

33-
export function NoticeView({text, style, spinner, buttonText, onPress}: Props) {
35+
export function NoticeView({
36+
header,
37+
text,
38+
style,
39+
spinner,
40+
buttonText,
41+
onPress,
42+
}: Props) {
3443
return (
3544
<View style={[styles.container, style]}>
3645
{spinner ? <ActivityIndicator style={styles.spinner} /> : null}
3746

47+
{header ? <Heading level={1}>{header}</Heading> : null}
48+
3849
<Text selectable={true} style={styles.text}>
3950
{text || 'Notice!'}
4051
</Text>

source/views/sis/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import {TabNavigator} from '../components/tabbed-view'
44

55
import BalancesView from './balances'
66
import StudentWorkView from './student-work'
7+
import TESView from './tes'
78

89
export default TabNavigator(
910
{
1011
BalancesView: {screen: BalancesView},
12+
TESView: {screen: TESView},
1113
StudentWorkView: {screen: StudentWorkView},
1214
},
1315
{

source/views/sis/tes.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// @flow
2+
3+
import * as React from 'react'
4+
import {View, StyleSheet} from 'react-native'
5+
import {TabBarIcon} from '../components/tabbar-icon'
6+
import openUrl from '../components/open-url'
7+
import type {TopLevelViewPropsType} from '../types'
8+
import * as c from '../components/colors'
9+
import {NoticeView} from '../components/notice'
10+
11+
type Props = TopLevelViewPropsType
12+
13+
export default class TESView extends React.PureComponent<Props> {
14+
static navigationOptions = {
15+
tabBarLabel: 'TES',
16+
tabBarIcon: TabBarIcon('cash'),
17+
}
18+
19+
launchSite = () => {
20+
openUrl('https://www.stolaf.edu/apps/tes/')
21+
}
22+
23+
render() {
24+
return (
25+
<View style={styles.container}>
26+
<NoticeView
27+
buttonText="Open TES"
28+
header="Time Entry System"
29+
onPress={this.launchSite}
30+
text="The St. Olaf Time Entry System (TES) is the place to report your work hours, for both students and hourly staff."
31+
/>
32+
</View>
33+
)
34+
}
35+
}
36+
37+
const styles = StyleSheet.create({
38+
container: {
39+
alignItems: 'center',
40+
flexGrow: 1,
41+
flexDirection: 'column',
42+
justifyContent: 'center',
43+
backgroundColor: c.white,
44+
padding: 20,
45+
},
46+
})

0 commit comments

Comments
 (0)