Skip to content

Commit df0235a

Browse files
committed
Replace MUI Tooltip with Oasis UI Library component
1 parent c877853 commit df0235a

3 files changed

Lines changed: 6 additions & 17 deletions

File tree

.changelog/2301.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Replace MUI Tooltip with Oasis UI Library component

src/app/components/ConsensusTransactionMethod/index.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import MiscellaneousServicesIcon from '@mui/icons-material/MiscellaneousServices
1313
import PersonIcon from '@mui/icons-material/Person'
1414
import PriceChangeIcon from '@mui/icons-material/PriceChange'
1515
import QuestionMarkIcon from '@mui/icons-material/QuestionMark'
16-
import Tooltip from '@mui/material/Tooltip'
17-
import { tooltipDelay } from '../../../styles/theme'
16+
import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'
1817
import { ConsensusTxMethod, GetConsensusTransactionsParams } from '../../../oasis-nexus/api'
1918
import { COLORS } from '../../../styles/theme/colors'
2019
import { exhaustedTypeWarning } from '../../../types/errors'
@@ -142,16 +141,7 @@ const MethodIconWithTruncatedLabel: FC<MethodIconProps> = props => {
142141
}, [applyTruncate, elementRef, props.label, props.size])
143142

144143
return (
145-
<Tooltip
146-
arrow
147-
placement="top"
148-
title={props.label}
149-
enterDelay={tooltipDelay}
150-
enterNextDelay={tooltipDelay}
151-
disableFocusListener={!truncate}
152-
disableHoverListener={!truncate}
153-
disableTouchListener={!truncate}
154-
>
144+
<Tooltip title={props.label} disabled={!truncate}>
155145
<div>
156146
<MethodIconContent {...props} elementRef={elementRef} truncate={truncate} />
157147
</div>

src/app/components/Tooltip/MaybeWithTooltip.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FC, ReactNode } from 'react'
2-
import Tooltip from '@mui/material/Tooltip'
2+
import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'
33

44
type MaybeWithTooltipProps = {
55
/**
@@ -24,13 +24,11 @@ type MaybeWithTooltipProps = {
2424
* A component to display some content with or without a tooltip
2525
*/
2626
export const MaybeWithTooltip: FC<MaybeWithTooltipProps> = ({ title, children, spanClassName }) => {
27+
console.log('title', title)
2728
return (
2829
<Tooltip
29-
placement="top"
3030
title={<div className="flex items-center gap-2 md:mx-0 -mx-3 min-w-0 wrap-anywhere">{title}</div>}
31-
disableFocusListener={!title}
32-
disableHoverListener={!title}
33-
disableTouchListener={!title}
31+
disabled={!title}
3432
>
3533
<span className={spanClassName}>{children}</span>
3634
</Tooltip>

0 commit comments

Comments
 (0)