aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/info-box/info-box.component.js
diff options
context:
space:
mode:
authorBruno <brunobar79@gmail.com>2018-05-31 10:27:33 +0800
committerBruno <brunobar79@gmail.com>2018-05-31 10:27:33 +0800
commitde9672726833e26ea96d198c0d9f1464015614f5 (patch)
tree5a213d4ff8269fe52c9e561fe8da6fefb4e03d09 /ui/app/components/info-box/info-box.component.js
parent3dd58463caef98c2cc1f068931624795a43912db (diff)
parent39d22a4ddb4ba0f4ad456009c86486a433c6724e (diff)
downloadtangerine-wallet-browser-de9672726833e26ea96d198c0d9f1464015614f5.tar
tangerine-wallet-browser-de9672726833e26ea96d198c0d9f1464015614f5.tar.gz
tangerine-wallet-browser-de9672726833e26ea96d198c0d9f1464015614f5.tar.bz2
tangerine-wallet-browser-de9672726833e26ea96d198c0d9f1464015614f5.tar.lz
tangerine-wallet-browser-de9672726833e26ea96d198c0d9f1464015614f5.tar.xz
tangerine-wallet-browser-de9672726833e26ea96d198c0d9f1464015614f5.tar.zst
tangerine-wallet-browser-de9672726833e26ea96d198c0d9f1464015614f5.zip
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'ui/app/components/info-box/info-box.component.js')
-rw-r--r--ui/app/components/info-box/info-box.component.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/ui/app/components/info-box/info-box.component.js b/ui/app/components/info-box/info-box.component.js
new file mode 100644
index 000000000..8688b8e8f
--- /dev/null
+++ b/ui/app/components/info-box/info-box.component.js
@@ -0,0 +1,49 @@
+import React, { Component } from 'react'
+import PropTypes from 'prop-types'
+
+export default class InfoBox extends Component {
+ static contextTypes = {
+ t: PropTypes.func,
+ }
+
+ static propTypes = {
+ onClose: PropTypes.func,
+ title: PropTypes.string,
+ description: PropTypes.string,
+ }
+
+ constructor (props) {
+ super(props)
+
+ this.state = {
+ isShowing: true,
+ }
+ }
+
+ handleClose () {
+ const { onClose } = this.props
+
+ if (onClose) {
+ onClose()
+ } else {
+ this.setState({ isShowing: false })
+ }
+ }
+
+ render () {
+ const { title, description } = this.props
+
+ return !this.state.isShowing
+ ? null
+ : (
+ <div className="info-box">
+ <div
+ className="info-box__close"
+ onClick={() => this.handleClose()}
+ />
+ <div className="info-box__title">{ title }</div>
+ <div className="info-box__description">{ description }</div>
+ </div>
+ )
+ }
+}