Skip to content

Commit

Permalink
pass thru isDelegateCall flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Nov 30, 2023
1 parent dc9717c commit b13cc2d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
16 changes: 13 additions & 3 deletions extension/src/browser/Drawer/RolePermissionCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import classes from './style.module.css'

const RolePermissionCheck: React.FC<{
transaction: TransactionInput
isDelegateCall: boolean
index: number
mini?: boolean
}> = ({ transaction, index, mini = false }) => {
}> = ({ transaction, isDelegateCall, index, mini = false }) => {
const [error, setError] = useState<string | undefined | false>(undefined)
const wrappingProvider = useWrappingProvider()

Expand Down Expand Up @@ -87,10 +88,19 @@ const RolePermissionCheck: React.FC<{
</Flex>
</Flex>
{error && !!translationAvailable && (
<Translate transaction={transaction} index={index} labeled />
<Translate
transaction={transaction}
isDelegateCall={isDelegateCall}
index={index}
labeled
/>
)}
{error && !translationAvailable && (
<CopyToClipboard transaction={transaction} labeled />
<CopyToClipboard
transaction={transaction}
isDelegateCall={isDelegateCall}
labeled
/>
)}
</Flex>
</Flex>
Expand Down
22 changes: 19 additions & 3 deletions extension/src/browser/Drawer/Transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ const TransactionHeader: React.FC<HeaderProps> = ({
)}

{showRoles && (
<RolePermissionCheck transaction={input} index={index} mini />
<RolePermissionCheck
transaction={input}
isDelegateCall={isDelegateCall}
index={index}
mini
/>
)}

<Flex gap={0}>
Expand Down Expand Up @@ -170,6 +175,7 @@ export const TransactionBadge: React.FC<Props> = ({
index,
transactionHash,
input,
isDelegateCall,
scrollIntoView,
}) => {
const { connection } = useConnection()
Expand All @@ -191,7 +197,12 @@ export const TransactionBadge: React.FC<Props> = ({
)}

{showRoles && (
<RolePermissionCheck transaction={input} index={index} mini />
<RolePermissionCheck
transaction={input}
isDelegateCall={isDelegateCall}
index={index}
mini
/>
)}
</Box>
)
Expand All @@ -204,6 +215,7 @@ interface StatusProps extends TransactionState {

const TransactionStatus: React.FC<StatusProps> = ({
input,
isDelegateCall,
transactionHash,
index,
showRoles = false,
Expand All @@ -221,7 +233,11 @@ const TransactionStatus: React.FC<StatusProps> = ({
)}
{showRoles && (
<Box bg p={2} className={classes.statusHeader}>
<RolePermissionCheck transaction={input} index={index} />
<RolePermissionCheck
transaction={input}
isDelegateCall={isDelegateCall}
index={index}
/>
</Box>
)}
</Flex>
Expand Down

0 comments on commit b13cc2d

Please sign in to comment.