Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/2301.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace MUI Tooltip with Oasis UI Library component
14 changes: 2 additions & 12 deletions src/app/components/ConsensusTransactionMethod/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import PersonIcon from '@mui/icons-material/Person'
import PriceChangeIcon from '@mui/icons-material/PriceChange'
import QuestionMarkIcon from '@mui/icons-material/QuestionMark'
import Tooltip from '@mui/material/Tooltip'
import { tooltipDelay } from '../../../styles/theme'
import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'
import { ConsensusTxMethod, GetConsensusTransactionsParams } from '../../../oasis-nexus/api'
import { COLORS } from '../../../styles/theme/colors'
import { exhaustedTypeWarning } from '../../../types/errors'
Expand Down Expand Up @@ -142,16 +141,7 @@
}, [applyTruncate, elementRef, props.label, props.size])

return (
<Tooltip
arrow
placement="top"
title={props.label}
enterDelay={tooltipDelay}
enterNextDelay={tooltipDelay}
disableFocusListener={!truncate}
disableHoverListener={!truncate}
disableTouchListener={!truncate}
>
<Tooltip title={props.label} disabled={!truncate}>
<div>
<MethodIconContent {...props} elementRef={elementRef} truncate={truncate} />
</div>
Expand Down Expand Up @@ -282,7 +272,7 @@
label: string
}

export const getConsensusTxMethodOptions = (t: TFunction) =>

Check warning on line 275 in src/app/components/ConsensusTransactionMethod/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
knownConsensusTxMethods.map(
(method): ConsensusTransactionTypeFilterOption => ({
value: method,
Expand Down Expand Up @@ -370,6 +360,6 @@

export type ConsensusTxMethodFilterOption = ConsensusTxMethod | 'any'

export const getConsensusTransactionMethodFilteringParam = (

Check warning on line 363 in src/app/components/ConsensusTransactionMethod/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
method: ConsensusTxMethodFilterOption,
): Partial<GetConsensusTransactionsParams> => (method === 'any' ? {} : { method })
8 changes: 3 additions & 5 deletions src/app/components/Tooltip/MaybeWithTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC, ReactNode } from 'react'
import Tooltip from '@mui/material/Tooltip'
import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'

type MaybeWithTooltipProps = {
/**
Expand All @@ -26,11 +26,9 @@ type MaybeWithTooltipProps = {
export const MaybeWithTooltip: FC<MaybeWithTooltipProps> = ({ title, children, spanClassName }) => {
return (
<Tooltip
placement="top"
className="max-w-[410px]"
title={<div className="flex items-center gap-2 md:mx-0 -mx-3 min-w-0 wrap-anywhere">{title}</div>}
disableFocusListener={!title}
disableHoverListener={!title}
disableTouchListener={!title}
disabled={!title}
>
<span className={spanClassName}>{children}</span>
</Tooltip>
Expand Down
Loading