Files
explore/ui/shared/DetailsActionsWrapper.tsx
T
tom goriunovandGitHub 23bb231351 Add support for Diamond proxy standard (#1963)
* add support for array of implementations

* refactor ContainerWithScrollY component

* contract source code: allow to choose between all implementations

* fix layout of AddressNetWorth component

* add scroll container to implementation address on write/read proxy contract tab

* update screenshots
2024-05-29 14:09:55 +02:00

42 lines
1.1 KiB
TypeScript

import React from 'react';
import * as DetailsInfoItem from 'ui/shared/DetailsInfoItem';
export const TX_ACTIONS_BLOCK_ID = 'tx-actions';
type Props = {
children: React.ReactNode;
isLoading?: boolean;
type: 'tx' | 'user_op';
}
const DetailsActionsWrapper = ({ children, isLoading, type }: Props) => {
const [ hasScroll, setHasScroll ] = React.useState(false);
return (
<>
<DetailsInfoItem.Label
id={ TX_ACTIONS_BLOCK_ID }
hint={ `Highlighted events of the ${ type === 'tx' ? 'transaction' : 'user operation' }` }
isLoading={ isLoading }
hasScroll={ hasScroll }
>
<span>{ `${ type === 'tx' ? 'Transaction' : 'User operation' } action` }</span>
</DetailsInfoItem.Label>
<DetailsInfoItem.ValueWithScroll
gradientHeight={ 48 }
onScrollVisibilityChange={ setHasScroll }
alignItems="stretch"
rowGap={ 5 }
w="100%"
maxH="200px"
>
{ children }
</DetailsInfoItem.ValueWithScroll>
</>
);
};
export default React.memo(DetailsActionsWrapper);