aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/info-box
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2018-05-31 07:04:02 +0800
committerGitHub <noreply@github.com>2018-05-31 07:04:02 +0800
commitdc5477be3cc62dff912a9447c702edab66200f02 (patch)
tree4c4c4293bfbc2a80812d231af9c7e22877cebfbd /ui/app/components/info-box
parent5fc24930a7febd919ec6a8f6e9c14f2bac0ef2b2 (diff)
parente59f606adb65de85484b0fb258980543967ee5e1 (diff)
downloadtangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.tar.gz
tangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.tar.zst
tangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.zip
Merge pull request #4408 from MetaMask/v4.7.0rc2
Version 4.7.0 - rc2
Diffstat (limited to 'ui/app/components/info-box')
-rw-r--r--ui/app/components/info-box/index.js2
-rw-r--r--ui/app/components/info-box/index.scss24
-rw-r--r--ui/app/components/info-box/info-box.component.js49
3 files changed, 75 insertions, 0 deletions
diff --git a/ui/app/components/info-box/index.js b/ui/app/components/info-box/index.js
new file mode 100644
index 000000000..6110422ed
--- /dev/null
+++ b/ui/app/components/info-box/index.js
@@ -0,0 +1,2 @@
+import InfoBox from './info-box.component'
+module.exports = InfoBox
diff --git a/ui/app/components/info-box/index.scss b/ui/app/components/info-box/index.scss
new file mode 100644
index 000000000..8b5626d79
--- /dev/null
+++ b/ui/app/components/info-box/index.scss
@@ -0,0 +1,24 @@
+.info-box {
+ border-radius: 4px;
+ background-color: $alabaster;
+ position: relative;
+ padding: 16px;
+ display: flex;
+ flex-flow: column;
+ color: $mid-gray;
+
+ &__close::after {
+ content: '\00D7';
+ font-size: 29px;
+ font-weight: 200;
+ color: $dusty-gray;
+ position: absolute;
+ right: 12px;
+ top: 0;
+ cursor: pointer;
+ }
+
+ &__description {
+ font-size: .75rem;
+ }
+}
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>
+ )
+ }
+}