|
1 | 1 | // @flow |
2 | 2 |
|
3 | 3 | import * as React from 'react' |
4 | | -import {View, Component} from 'react-native' |
| 4 | +import {View, StyleSheet} from 'react-native' |
5 | 5 | import {TabBarIcon} from '../components/tabbar-icon' |
6 | 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' |
7 | 10 |
|
8 | | -class TESView extends React.Component { |
9 | | - static navigationOptions = { |
| 11 | +type Props = TopLevelViewPropsType |
| 12 | + |
| 13 | +export default class TESView extends React.PureComponent<Props> { |
| 14 | + static navigationOptions = { |
10 | 15 | tabBarLabel: 'TES', |
11 | | - tabBarIcon: TabBarIcon('card'), |
| 16 | + tabBarIcon: TabBarIcon('cash'), |
12 | 17 | } |
13 | 18 |
|
14 | | - componentDidMount() { |
15 | | - openUrl('https://www.stolaf.edu/apps/tes/') |
16 | | - } |
17 | | - |
18 | | - render() { |
19 | | - return (<View></View>) |
20 | | - } |
| 19 | + launchSite = () => { |
| 20 | + openUrl('https://www.stolaf.edu/apps/tes/') |
| 21 | + } |
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 | + } |
22 | 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