Skip to content

Commit 8c7f32e

Browse files
committed
module to display a message at the top of a view
1 parent 9e8e8f3 commit 8c7f32e

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

modules/info-header/index.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// @flow
2+
import * as React from 'react'
3+
import {View, Text, StyleSheet} from 'react-native'
4+
import * as c from '@frogpond/colors'
5+
6+
const styles = StyleSheet.create({
7+
content: {
8+
backgroundColor: c.white,
9+
borderWidth: StyleSheet.hairlineWidth,
10+
borderTopColor: c.iosHeaderTopBorder,
11+
borderBottomColor: c.iosHeaderBottomBorder,
12+
marginBottom: 10,
13+
},
14+
title: {
15+
fontSize: 16,
16+
fontWeight: 'bold',
17+
paddingTop: 15,
18+
paddingHorizontal: 15,
19+
},
20+
message: {
21+
fontSize: 14,
22+
paddingTop: 5,
23+
paddingBottom: 15,
24+
paddingHorizontal: 15,
25+
},
26+
})
27+
28+
type Props = {
29+
message: string,
30+
title: string,
31+
}
32+
33+
export class InfoHeader extends React.PureComponent<Props> {
34+
render() {
35+
return (
36+
<View style={styles.content}>
37+
<Text style={styles.title}>{this.props.title}</Text>
38+
<Text style={styles.message}>{this.props.message}</Text>
39+
</View>
40+
)
41+
}
42+
}

modules/info-header/package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@frogpond/info-header",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"author": "",
7+
"license": "ISC",
8+
"scripts": {
9+
"test": "jest"
10+
},
11+
"peerDependencies": {
12+
"react": "^16.4.2",
13+
"react-native": "^0.55.4"
14+
},
15+
"dependencies": {
16+
"@frogpond/colors": "^1.0.0"
17+
}
18+
}

0 commit comments

Comments
 (0)