Skip to content

Commit

Permalink
feat: add tooltip to advanced details (#2153)
Browse files Browse the repository at this point in the history
* feat: add tooltip to advanced details

* fix: alter wording
  • Loading branch information
iamacook committed Jun 22, 2023
1 parent d5e23c1 commit a378007
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions src/components/tx/DecodedTx/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { type SyntheticEvent, type ReactElement, useMemo } from 'react'
import { Accordion, AccordionDetails, AccordionSummary, Box, Skeleton, Typography } from '@mui/material'
import {
Accordion,
AccordionDetails,
AccordionSummary,
Box,
Skeleton,
SvgIcon,
Tooltip,
Typography,
} from '@mui/material'
import { OperationType, type SafeTransaction } from '@safe-global/safe-core-sdk-types'
import {
type DecodedDataResponse,
Expand All @@ -19,6 +28,9 @@ import ApprovalEditor from '@/components/tx/ApprovalEditor'
import { ErrorBoundary } from '@sentry/react'
import { getNativeTransferData } from '@/services/tx/tokenTransferParams'
import Multisend from '@/components/transactions/TxDetails/TxData/DecodedData/Multisend'
import InfoIcon from '@/public/images/notifications/info.svg'
import ExternalLink from '@/components/common/ExternalLink'
import { HelpCenterArticle } from '@/config/constants'

type DecodedTxProps = {
tx?: SafeTransaction
Expand Down Expand Up @@ -97,8 +109,34 @@ const DecodedTx = ({ tx, txId }: DecodedTxProps): ReactElement | null => {
)}

<Box mt={2}>
<Typography variant="overline" fontWeight="bold" color="border.main">
<Typography variant="overline" fontWeight="bold" color="border.main" display="flex" alignItems="center">
Advanced details
<Tooltip
title={
<>
We recommend not changing the default values unless necessary.{' '}
<ExternalLink href={HelpCenterArticle.ADVANCED_PARAMS} title="Learn more about advanced details">
Learn more about advanced details
</ExternalLink>
.
</>
}
arrow
placement="top"
>
<span>
<SvgIcon
component={InfoIcon}
inheritViewBox
color="border"
fontSize="small"
sx={{
verticalAlign: 'middle',
ml: 0.5,
}}
/>
</span>
</Tooltip>
</Typography>

{txDetails ? <Summary txDetails={txDetails} defaultExpanded /> : tx && <PartialSummary safeTx={tx} />}
Expand Down

0 comments on commit a378007

Please sign in to comment.