From 3890f8224d371cecbd5c9d0e3d5c4b54f4381fdb Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 24 Jul 2018 14:44:31 -0700 Subject: Fix tooltip wrapping issue in onboardin --- .../ts/components/inputs/allowance_state_toggle.tsx | 21 +++++++++++++-------- packages/website/ts/components/ui/text.tsx | 3 +++ 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'packages/website/ts/components') diff --git a/packages/website/ts/components/inputs/allowance_state_toggle.tsx b/packages/website/ts/components/inputs/allowance_state_toggle.tsx index ce439e147..a812ead5d 100644 --- a/packages/website/ts/components/inputs/allowance_state_toggle.tsx +++ b/packages/website/ts/components/inputs/allowance_state_toggle.tsx @@ -5,6 +5,7 @@ import ReactTooltip = require('react-tooltip'); import { Blockchain } from 'ts/blockchain'; import { AllowanceState, AllowanceStateView } from 'ts/components/ui/allowance_state_view'; import { Container } from 'ts/components/ui/container'; +import { Text } from 'ts/components/ui/text'; import { Dispatcher } from 'ts/redux/dispatcher'; import { BalanceErrs, Token, TokenState } from 'ts/types'; import { analytics } from 'ts/utils/analytics'; @@ -55,12 +56,13 @@ export class AllowanceStateToggle extends React.Component - {this._getTooltipContent()} + + {this._getTooltipContent()} +
@@ -76,7 +78,6 @@ export class AllowanceStateToggle extends React.Component + Please confirm in MetaMask + + ); case AllowanceState.Locked: return ( - + Click to enable {symbol} for trading - + ); case AllowanceState.Unlocked: return ( - + {symbol} is available for trading - + ); default: return null; diff --git a/packages/website/ts/components/ui/text.tsx b/packages/website/ts/components/ui/text.tsx index 315f72854..72bee8c0a 100644 --- a/packages/website/ts/components/ui/text.tsx +++ b/packages/website/ts/components/ui/text.tsx @@ -18,6 +18,7 @@ export interface TextProps { textDecorationLine?: string; onClick?: (event: React.MouseEvent) => void; hoverColor?: string; + noWrap?: boolean; } const PlainText: React.StatelessComponent = ({ children, className, onClick, Tag }) => ( @@ -37,6 +38,7 @@ export const Text = styled(PlainText)` ${props => (props.minHeight ? `min-height: ${props.minHeight}` : '')}; ${props => (props.onClick ? 'cursor: pointer' : '')}; transition: color 0.5s ease; + ${props => (props.noWrap ? 'white-space: nowrap' : '')}; &:hover { ${props => (props.onClick ? `color: ${props.hoverColor || darken(0.3, props.fontColor)}` : '')}; } @@ -50,6 +52,7 @@ Text.defaultProps = { lineHeight: '1.5em', textDecorationLine: 'none', Tag: 'div', + noWrap: false, }; Text.displayName = 'Text'; -- cgit