Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
Merge 803deeb into ccc5e3f
Browse files Browse the repository at this point in the history
  • Loading branch information
alongoni committed Apr 29, 2022
2 parents ccc5e3f + 803deeb commit 20d1acf
Showing 1 changed file with 53 additions and 5 deletions.
58 changes: 53 additions & 5 deletions src/components/orders/DetailsTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import { StatusLabel } from 'components/orders/StatusLabel'
import { GasFeeDisplay } from 'components/orders/GasFeeDisplay'
import { triggerEvent } from 'api/analytics'
import { LinkWithPrefixNetwork } from 'components/common/LinkWithPrefixNetwork'
import { ButtonBase } from 'components/common/Button'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faProjectDiagram } from '@fortawesome/free-solid-svg-icons'

const Table = styled(SimpleTable)`
border: 0.1rem solid ${({ theme }): string => theme.borderPrimary};
Expand Down Expand Up @@ -83,6 +86,44 @@ const tooltip = {
fees: 'The amount of fees paid for this order. This will show a progressive number for orders with partial fills.',
}

const Wrapper = styled.div`
display: flex;
flex-direction: row;
${media.mobile} {
flex-direction: column;
}
`

const Button = styled(ButtonBase)`
display: flex;
align-items: center;
justify-content: center;
font-size: ${({ theme }): string => theme.fontSizeDefault};
color: ${({ theme }): string => theme.orange1};
border: 1px solid ${({ theme }): string => theme.orange1};
background-color: ${({ theme }): string => theme.orangeOpacity};
border-radius: 0.4rem;
padding: 0.8rem 1.5rem;
margin: 0 0 0 2rem;
${media.mobile} {
margin: 1rem 0 0 0;
}
${media.mediumDown} {
min-width: 18rem;
}
:hover {
opacity: 0.8;
color: ${({ theme }): string => theme.white};
}
svg {
margin-right: 0.5rem;
}
`

export type Props = {
order: Order
areTradesLoading: boolean
Expand Down Expand Up @@ -170,11 +211,18 @@ export function DetailsTable(props: Props): JSX.Element | null {
{areTradesLoading ? (
<Spinner />
) : txHash ? (
<RowWithCopyButton
textToCopy={txHash}
onCopy={(): void => onCopy('settlementTx')}
contentsToDisplay={<LinkWithPrefixNetwork to={`/tx/${txHash}`}>{txHash}</LinkWithPrefixNetwork>}
/>
<Wrapper>
<RowWithCopyButton
textToCopy={txHash}
onCopy={(): void => onCopy('settlementTx')}
contentsToDisplay={
<LinkWithPrefixNetwork to={`/tx/${txHash}/?tab=graph`}>{txHash}</LinkWithPrefixNetwork>
}
/>
<Button role="button">
<FontAwesomeIcon icon={faProjectDiagram} /> View batch graph
</Button>
</Wrapper>
) : (
'-'
)}
Expand Down

0 comments on commit 20d1acf

Please sign in to comment.