Skip to content

Commit

Permalink
chore: save some space (#247)
Browse files Browse the repository at this point in the history
* use openInNewWindow prop

* condense simulation and role permission check
  • Loading branch information
frontendphil authored Dec 4, 2024
1 parent d1a7381 commit d61011c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
29 changes: 15 additions & 14 deletions extension/src/panel/pages/transactions/RolePermissionCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,22 @@ export const RolePermissionCheck = ({
<div className="flex flex-col gap-2">
<div className="flex items-center justify-between gap-2">
Role permissions
{error === false ? (
<Tag head={<Check size={16} />} color="success">
Allowed
</Tag>
) : (
<Tag head={<TriangleAlert size={16} />} color="danger">
{error}
</Tag>
)}
<div className="flex gap-2">
{error === false ? (
<Tag head={<Check size={16} />} color="success">
Allowed
</Tag>
) : (
<Tag head={<TriangleAlert size={16} />} color="danger">
{error}
</Tag>
)}
{error && !translationAvailable && (
<CopyToClipboard transaction={transactionState.transaction} />
)}
</div>
{error && !!translationAvailable && <Translate index={index} labeled />}
</div>

{error && !!translationAvailable && <Translate index={index} labeled />}
{error && !translationAvailable && (
<CopyToClipboard transaction={transactionState.transaction} labeled />
)}
</div>
)
}
Expand Down
30 changes: 16 additions & 14 deletions extension/src/panel/pages/transactions/SimulationStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Spinner, Tag } from '@/components'
import { GhostLinkButton, Spinner, Tag } from '@/components'
import { useProvider } from '@/providers-ui'
import { ExecutionStatus, TransactionState } from '@/state'
import {
Expand Down Expand Up @@ -38,7 +38,7 @@ export const SimulationStatus = ({ transactionState, mini = false }: Props) => {
<div className="flex flex-col gap-2">
<div className="flex items-center justify-between gap-1">
Simulation
<div className="flex flex-col gap-2">
<div className="flex gap-2">
{transactionState.status === ExecutionStatus.PENDING && (
<Tag head={<Spinner />} color="info">
Pending...
Expand All @@ -60,20 +60,22 @@ export const SimulationStatus = ({ transactionState, mini = false }: Props) => {
Reverted
</Tag>
)}

{transactionState.transactionHash && (
<GhostLinkButton
openInNewWindow
iconOnly
size="small"
icon={SquareArrowOutUpRight}
to={provider?.getTransactionLink(
transactionState.transactionHash
)}
>
View in Tenderly
</GhostLinkButton>
)}
</div>
</div>

{transactionState.transactionHash && (
<a
href={provider?.getTransactionLink(transactionState.transactionHash)}
target="_blank"
rel="noreferrer"
className="flex items-center gap-1 text-xs no-underline opacity-75"
>
View in Tenderly
<SquareArrowOutUpRight size={14} />
</a>
)}
</div>
)
}
3 changes: 1 addition & 2 deletions extension/src/panel/pages/transactions/Submit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,10 @@ const AwaitingSignatureModal = ({
{usesWalletConnect && (
<Modal.Actions>
<SecondaryLinkButton
openInNewWindow
style="contrast"
icon={SquareArrowOutUpRight}
to={`https://app.safe.global/${account}`}
target="_blank"
rel="noreferrer"
>
Open Pilot Safe
</SecondaryLinkButton>
Expand Down

0 comments on commit d61011c

Please sign in to comment.