2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2018-11-13 18:19:12 +01:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const ConfirmPageContainerNavigation = (props) => {
|
2020-11-03 00:41:28 +01:00
|
|
|
const {
|
|
|
|
onNextTx,
|
|
|
|
totalTx,
|
|
|
|
positionOfCurrentTx,
|
|
|
|
nextTxId,
|
|
|
|
prevTxId,
|
|
|
|
showNavigation,
|
|
|
|
firstTx,
|
|
|
|
lastTx,
|
|
|
|
ofText,
|
|
|
|
requestsWaitingText,
|
2021-02-04 19:15:23 +01:00
|
|
|
} = props;
|
2018-11-13 18:19:12 +01:00
|
|
|
|
|
|
|
return (
|
2019-12-03 17:35:44 +01:00
|
|
|
<div
|
|
|
|
className="confirm-page-container-navigation"
|
2019-07-31 22:17:11 +02:00
|
|
|
style={{
|
|
|
|
display: showNavigation ? 'flex' : 'none',
|
|
|
|
}}
|
2018-11-13 18:19:12 +01:00
|
|
|
>
|
2019-12-03 17:35:44 +01:00
|
|
|
<div
|
|
|
|
className="confirm-page-container-navigation__container"
|
2018-11-13 18:19:12 +01:00
|
|
|
style={{
|
|
|
|
visibility: prevTxId ? 'initial' : 'hidden',
|
2019-12-03 17:35:44 +01:00
|
|
|
}}
|
|
|
|
>
|
2018-11-13 18:19:12 +01:00
|
|
|
<div
|
|
|
|
className="confirm-page-container-navigation__arrow"
|
2020-01-14 19:53:02 +01:00
|
|
|
data-testid="first-page"
|
2019-12-03 17:35:44 +01:00
|
|
|
onClick={() => onNextTx(firstTx)}
|
|
|
|
>
|
2021-05-25 02:20:09 +02:00
|
|
|
<img src="./images/double-arrow.svg" alt="" />
|
2018-11-13 18:19:12 +01:00
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
className="confirm-page-container-navigation__arrow"
|
2020-01-14 19:53:02 +01:00
|
|
|
data-testid="previous-page"
|
2019-12-03 17:35:44 +01:00
|
|
|
onClick={() => onNextTx(prevTxId)}
|
|
|
|
>
|
2021-05-25 02:20:09 +02:00
|
|
|
<img src="./images/single-arrow.svg" alt="" />
|
2018-11-13 18:19:12 +01:00
|
|
|
</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',
|
2019-12-03 17:35:44 +01:00
|
|
|
}}
|
|
|
|
>
|
2018-11-13 18:19:12 +01:00
|
|
|
<div
|
|
|
|
className="confirm-page-container-navigation__arrow"
|
2020-01-14 19:53:02 +01:00
|
|
|
data-testid="next-page"
|
2019-12-03 17:35:44 +01:00
|
|
|
onClick={() => onNextTx(nextTxId)}
|
|
|
|
>
|
2020-11-03 00:41:28 +01:00
|
|
|
<img
|
|
|
|
className="confirm-page-container-navigation__imageflip"
|
2021-05-25 02:20:09 +02:00
|
|
|
src="./images/single-arrow.svg"
|
2020-11-11 16:38:15 +01:00
|
|
|
alt=""
|
2020-11-03 00:41:28 +01:00
|
|
|
/>
|
2018-11-13 18:19:12 +01:00
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
className="confirm-page-container-navigation__arrow"
|
2020-01-14 19:53:02 +01:00
|
|
|
data-testid="last-page"
|
2019-12-03 17:35:44 +01:00
|
|
|
onClick={() => onNextTx(lastTx)}
|
|
|
|
>
|
2020-11-03 00:41:28 +01:00
|
|
|
<img
|
|
|
|
className="confirm-page-container-navigation__imageflip"
|
2021-05-25 02:20:09 +02:00
|
|
|
src="./images/double-arrow.svg"
|
2020-11-11 16:38:15 +01:00
|
|
|
alt=""
|
2020-11-03 00:41:28 +01:00
|
|
|
/>
|
2018-11-13 18:19:12 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
|
|
|
};
|
2018-11-13 18:19:12 +01:00
|
|
|
|
|
|
|
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,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-11-13 18:19:12 +01:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export default ConfirmPageContainerNavigation;
|