diff --git a/packages/ui/src/common/components/Tooltip/Tooltip.tsx b/packages/ui/src/common/components/Tooltip/Tooltip.tsx index 7e8ebe1c5c..cc6c7aa0db 100644 --- a/packages/ui/src/common/components/Tooltip/Tooltip.tsx +++ b/packages/ui/src/common/components/Tooltip/Tooltip.tsx @@ -33,6 +33,7 @@ export interface TooltipPopupProps { forBig?: boolean hideOnComponentLeave?: boolean boundaryClassName?: string + placement?: 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' } export interface DarkTooltipInnerItemProps { @@ -54,6 +55,7 @@ export const Tooltip = ({ offset, hideOnComponentLeave, boundaryClassName, + placement = 'bottom-start', }: TooltipProps) => { const [isTooltipActive, setTooltipActive] = useState(tooltipOpen) const [referenceElementRef, setReferenceElementRef] = useState(null) @@ -61,7 +63,7 @@ export const Tooltip = ({ const [boundaryElement, setBoundaryElement] = useState(null) const { styles, attributes } = usePopper(referenceElementRef, popperElementRef, { - placement: 'bottom-start', + placement, modifiers: [ { name: 'offset', diff --git a/packages/ui/src/common/components/buttons/TransactionButton.tsx b/packages/ui/src/common/components/buttons/TransactionButton.tsx index 31477b7bf3..dd54e6671b 100644 --- a/packages/ui/src/common/components/buttons/TransactionButton.tsx +++ b/packages/ui/src/common/components/buttons/TransactionButton.tsx @@ -9,15 +9,24 @@ import { ButtonGhost, ButtonPrimary, ButtonProps, ButtonSecondary } from '.' interface WrapperProps { children: ReactNode + tooltip: { [key: string]: string } } -export const TransactionButtonWrapper = ({ children }: WrapperProps) => { +export const TransactionButtonWrapper = ({ children, tooltip }: WrapperProps) => { const { isTransactionPending } = useTransactionStatus() if (isTransactionPending) { return {children} } + if (tooltip) { + return ( + + {children} + + ) + } + return <>{children} } @@ -25,6 +34,7 @@ type StyleOption = 'primary' | 'ghost' | 'secondary' interface TransactionButtonProps extends ButtonProps { style: StyleOption + tooltip: { [key: string]: string } } export const TransactionButton = (props: TransactionButtonProps) => { @@ -33,7 +43,7 @@ export const TransactionButton = (props: TransactionButtonProps) => { const Button = buttonTypes[props.style] return ( - +