-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
index.tsx
70 lines (66 loc) · 1.63 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import * as React from 'react'
import {Box2, Text} from '../../common-adapters'
// @ts-ignore not typed yet
import {Background} from '../../common-adapters/text'
import * as Styles from '../../styles'
type Props = {
background: Background
onAction?: (() => void) | null
reviewProofs?: boolean
sendFailed?: boolean
text: string
}
const Banner = (props: Props) => (
<Box2
direction="vertical"
fullWidth={true}
centerChildren={true}
style={Styles.collapseStyles([
styles.container,
{backgroundColor: Styles.backgroundModeToColor[props.background]},
])}
>
<Text
center={true}
type="BodySmallSemibold"
negative={true}
style={{
color: Styles.backgroundModeToTextColor(props.background),
}}
>
{props.text}
{props.reviewProofs && props.onAction && (
<Text
type="BodySmallSemiboldPrimaryLink"
center={true}
style={styles.secondText}
negative={true}
onClick={props.onAction}
>
Please review.
</Text>
)}
</Text>
{props.sendFailed && props.onAction && (
<Text
type="BodySmallSemiboldPrimaryLink"
center={true}
style={styles.secondText}
negative={true}
onClick={props.onAction}
>
Review payments
</Text>
)}
</Box2>
)
const styles = Styles.styleSheetCreate({
container: {
minHeight: 40,
padding: Styles.globalMargins.small,
paddingBottom: Styles.globalMargins.tiny,
paddingTop: Styles.globalMargins.tiny,
},
secondText: {paddingLeft: Styles.globalMargins.xtiny},
})
export default Banner