Skip to content

Commit

Permalink
Merge pull request #3616 from NotEternal/removeTsIgnoreTooltip
Browse files Browse the repository at this point in the history
Remove ts-ignore from tooltips
  • Loading branch information
noxonsu authored Nov 20, 2020
2 parents 6fcb4ce + d4420e5 commit aaa3cfd
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
22 changes: 9 additions & 13 deletions src/front/shared/components/modals/WithdrawModal/WithdrawModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -890,19 +890,15 @@ export default class WithdrawModal extends React.Component<any, any> {
</Button>
</div>
{!isMobile && (
<>
{/* ignore ReactTooltip property 'type', because it keyword in TypeScript
//@ts-ignore */}
<ReactTooltip id="Withdrow134" type={`${isDark ? 'light' : 'dark'}`} effect="solid" place="top" styleName="r-tooltip">
<FormattedMessage
id="WithdrawButton32"
defaultMessage="When you click this button, in the field, an amount{br}equal to your balance minus the miners commission will appear"
values={{
br: <br />,
}}
/>
</ReactTooltip>
</>
<Tooltip id="Withdrow134" place='top' mark={false}>
<FormattedMessage
id="WithdrawButton32"
defaultMessage="When you click this button, in the field, an amount{br}equal to your balance minus the miners commission will appear"
values={{
br: <br />,
}}
/>
</Tooltip>
)}
</div>
{this.isEthOrERC20() && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ export default class WithdrawModalMultisig extends React.Component<any, any> {
</Button>
</div>
{!isMobile && (
//@ts-ignore
<ReactTooltip id="Withdrow134" type="light" effect="solid" styleName="r-tooltip">
<FormattedMessage
id="WithdrawButton32"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ export default class WithdrawModalMultisigUser extends React.Component<any, any>
</Button>
</div>
{!isMobile && (
//@ts-ignore
<ReactTooltip id="Withdrow134" type="light" effect="solid" styleName="r-tooltip">
<FormattedMessage
id="WithdrawButton32"
Expand Down
12 changes: 8 additions & 4 deletions src/front/shared/components/ui/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ import ThemeTooltip from './ThemeTooltip'
import styles from './Tooltip.scss'


const Tooltip = ({ children, id, dontHideMobile = null, place = null }) => (
const Tooltip = ({ mark = true, children, id, dontHideMobile = null, place = null }) => (
<Fragment>
<span data-tip data-for={id} styleName={`tooltip${dontHideMobile ? ' tooltip_truesight' : ''}`}>
<FormattedMessage id="Tooltip11" defaultMessage="?" />
</span>
{
mark && (
<span data-tip data-for={id} styleName={`tooltip${dontHideMobile ? ' tooltip_truesight' : ''}`}>
<FormattedMessage id="Tooltip11" defaultMessage="?" />
</span>
)
}
<ThemeTooltip id={id} effect="solid" multiline {...{ place }} styleName="r-tooltip">
{children}
</ThemeTooltip>
Expand Down
4 changes: 1 addition & 3 deletions src/front/shared/pages/Exchange/SelectGroup/SelectGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ const SelectGroup = (props) => {
{inputToolTip && inputToolTip()}
{balanceTooltip && (
<div styleName="smallTooltip balanceTooltip">
{/*
//@ts-ignore */}
<Tooltip>
<Tooltip id='SelectGroupTooltipBalance'>
{balanceTooltip()}
</Tooltip>
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/front/shared/pages/History/Row/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ class Row extends React.PureComponent<any, any> {
<Fragment>
{direction === directionType ?
<div styleName="amount">{`+ ${parseFloat(Number(value).toFixed(5))}`} {type.toUpperCase()}
{/*
//@ts-ignore */}
{txType === 'INVOICE' ? <span styleName="smallTooltip"><Tooltip>Invoice</Tooltip></span> : ''}
{txType === 'INVOICE' ? <span styleName="smallTooltip"><Tooltip id='RowTooltipInvoice'>Invoice</Tooltip></span> : ''}
</div> :
<div styleName="amount">{`- ${parseFloat(Number(value).toFixed(5))}`} {type.toUpperCase()}</div>
}
Expand Down

0 comments on commit aaa3cfd

Please sign in to comment.