Skip to content

Commit

Permalink
Merge pull request #1743 from RafaelTaranto/backport/explicitly-show-…
Browse files Browse the repository at this point in the history
…errors-on-tx-page

LAM-539 backport: explicitly show errors on tx page
  • Loading branch information
RafaelTaranto authored Nov 29, 2024
2 parents 36cded5 + bd6f197 commit fd7cb21
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
4 changes: 3 additions & 1 deletion new-lamassu-admin/src/pages/Transactions/CopyToClipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const CopyToClipboard = ({
buttonClassname,
children,
wrapperClassname,
removeSpace = true,
...props
}) => {
const [anchorEl, setAnchorEl] = useState(null)
Expand Down Expand Up @@ -46,7 +47,8 @@ const CopyToClipboard = ({
{children}
</div>
<div className={classnames(classes.buttonWrapper, buttonClassname)}>
<ReactCopyToClipboard text={R.replace(/\s/g, '')(children)}>
<ReactCopyToClipboard
text={removeSpace ? R.replace(/\s/g, '')(children) : children}>
<button
aria-describedby={id}
onClick={event => handleClick(event)}>
Expand Down
15 changes: 8 additions & 7 deletions new-lamassu-admin/src/pages/Transactions/DetailsCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ const DetailsRow = ({ it: tx, timezone }) => {
<>
<Label>Transaction status</Label>
<span className={classes.bold}>{getStatus(tx)}</span>
{getStatusDetails(tx) ? (
<CopyToClipboard removeSpace={false} className={classes.errorCopy}>
{getStatusDetails(tx)}
</CopyToClipboard>
) : (
<></>
)}
</>
)

Expand Down Expand Up @@ -392,13 +399,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
</div>
<div className={classes.lastRow}>
<div className={classes.status}>
{getStatusDetails(tx) ? (
<HoverableTooltip parentElements={errorElements} width={200}>
<P>{getStatusDetails(tx)}</P>
</HoverableTooltip>
) : (
errorElements
)}
{errorElements}
{((tx.txClass === 'cashOut' && getStatus(tx) === 'Pending') ||
(tx.txClass === 'cashIn' && getStatus(tx) === 'Batched')) && (
<ActionButton
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typographyStyles from 'src/components/typography/styles'
import { offColor, comet, white, tomato } from 'src/styling/variables'

const { p } = typographyStyles
const { p, label3 } = typographyStyles

export default {
wrapper: {
Expand Down Expand Up @@ -137,5 +137,10 @@ export default {
},
swept: {
width: 250
},
errorCopy: {
extend: label3,
lineBreak: 'normal',
maxWidth: 180
}
}

0 comments on commit fd7cb21

Please sign in to comment.