aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js
blob: 89ceb015f2a9b97d1f0d93e6ec4d0769b58e6673 (plain) (blame)
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
71
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import Identicon from '../../../identicon'

const ConfirmPageContainerSummary = props => {
  const {
    action,
    title,
    titleComponent,
    subtitle,
    subtitleComponent,
    hideSubtitle,
    className,
    identiconAddress,
    nonce,
    assetImage,
  } = props

  return (
    <div className={classnames('confirm-page-container-summary', className)}>
      <div className="confirm-page-container-summary__action-row">
        <div className="confirm-page-container-summary__action">
          { action }
        </div>
        {
          nonce && (
            <div className="confirm-page-container-summary__nonce">
              { `#${nonce}` }
            </div>
          )
        }
      </div>
      <div className="confirm-page-container-summary__title">
        {
          identiconAddress && (
            <Identicon
              className="confirm-page-container-summary__identicon"
              diameter={36}
              address={identiconAddress}
              image={assetImage}
            />
          )
        }
        <div className="confirm-page-container-summary__title-text">
          { titleComponent || title }
        </div>
      </div>
      {
        hideSubtitle || <div className="confirm-page-container-summary__subtitle">
          { subtitleComponent || subtitle }
        </div>
      }
    </div>
  )
}

ConfirmPageContainerSummary.propTypes = {
  action: PropTypes.string,
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  titleComponent: PropTypes.node,
  subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  subtitleComponent: PropTypes.node,
  hideSubtitle: PropTypes.bool,
  className: PropTypes.string,
  identiconAddress: PropTypes.string,
  nonce: PropTypes.string,
  assetImage: PropTypes.string,
}

export default ConfirmPageContainerSummary