aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/confirm-page-container/confirm-page-container-navigation/confirm-page-container-navigation.component.js
blob: 8327f997bae1682668d891c1a41c481a33265131 (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
import React from 'react'
import PropTypes from 'prop-types'

const ConfirmPageContainerNavigation = props => {
  const { onNextTx, totalTx, positionOfCurrentTx, nextTxId, prevTxId, showNavigation, firstTx, lastTx, ofText, requestsWaitingText } = props

  return (
    <div className="confirm-page-container-navigation"
        style={{
          display: showNavigation ? 'flex' : 'none',
        }}
    >
      <div className="confirm-page-container-navigation__container"
        style={{
          visibility: prevTxId ? 'initial' : 'hidden',
        }}>
        <div
          className="confirm-page-container-navigation__arrow"
          onClick={() => onNextTx(firstTx)}>
          <img src="/images/double-arrow.svg" />
        </div>
        <div
          className="confirm-page-container-navigation__arrow"
          onClick={() => onNextTx(prevTxId)}>
          <img src="/images/single-arrow.svg" />
        </div>
      </div>
      <div className="confirm-page-container-navigation__textcontainer">
        <div className="confirm-page-container-navigation__navtext">
          {positionOfCurrentTx} {ofText} {totalTx}
        </div>
        <div className="confirm-page-container-navigation__longtext">
          {requestsWaitingText}
        </div>
      </div>
      <div
        className="confirm-page-container-navigation__container"
        style={{
          visibility: nextTxId ? 'initial' : 'hidden',
        }}>
        <div
          className="confirm-page-container-navigation__arrow"
          onClick={() => onNextTx(nextTxId)}>
          <img className="confirm-page-container-navigation__imageflip" src="/images/single-arrow.svg" />
        </div>
        <div
          className="confirm-page-container-navigation__arrow"
          onClick={() => onNextTx(lastTx)}>
          <img className="confirm-page-container-navigation__imageflip" src="/images/double-arrow.svg" />
        </div>
      </div>
    </div>
  )
}

ConfirmPageContainerNavigation.propTypes = {
  totalTx: PropTypes.number,
  positionOfCurrentTx: PropTypes.number,
  onNextTx: PropTypes.func,
  nextTxId: PropTypes.string,
  prevTxId: PropTypes.string,
  showNavigation: PropTypes.bool,
  firstTx: PropTypes.string,
  lastTx: PropTypes.string,
  ofText: PropTypes.string,
  requestsWaitingText: PropTypes.string,
}

export default ConfirmPageContainerNavigation