aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/inputs
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-25 06:09:47 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-25 06:11:46 +0800
commit5b6cf447e5793a775d8d590647c85971a6746909 (patch)
tree514783b48fd004e7b52cfc8b5532f93831d7847e /packages/website/ts/components/inputs
parent3890f8224d371cecbd5c9d0e3d5c4b54f4381fdb (diff)
downloaddexon-0x-contracts-5b6cf447e5793a775d8d590647c85971a6746909.tar.gz
dexon-0x-contracts-5b6cf447e5793a775d8d590647c85971a6746909.tar.zst
dexon-0x-contracts-5b6cf447e5793a775d8d590647c85971a6746909.zip
Make tooltip appear to the left of the toggle when onboarding in progress
Diffstat (limited to 'packages/website/ts/components/inputs')
-rw-r--r--packages/website/ts/components/inputs/allowance_state_toggle.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/website/ts/components/inputs/allowance_state_toggle.tsx b/packages/website/ts/components/inputs/allowance_state_toggle.tsx
index a812ead5d..764013682 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 { PointerDirection } from 'ts/components/ui/pointer';
import { Text } from 'ts/components/ui/text';
import { Dispatcher } from 'ts/redux/dispatcher';
import { BalanceErrs, Token, TokenState } from 'ts/types';
@@ -21,6 +22,7 @@ export interface AllowanceStateToggleProps {
userAddress: string;
onErrorOccurred?: (errType: BalanceErrs) => void;
refetchTokenStateAsync: () => Promise<void>;
+ tooltipDirection?: PointerDirection;
}
export interface AllowanceStateToggleState {
@@ -33,6 +35,7 @@ const DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS = new BigNumber(2).pow(256).minus(1
export class AllowanceStateToggle extends React.Component<AllowanceStateToggleProps, AllowanceStateToggleState> {
public static defaultProps = {
onErrorOccurred: _.noop.bind(_),
+ tooltipDirection: PointerDirection.Right,
};
private static _getAllowanceState(tokenState: TokenState): AllowanceState {
if (!tokenState.isLoaded) {
@@ -62,7 +65,7 @@ export class AllowanceStateToggle extends React.Component<AllowanceStateTogglePr
<div
data-tip={true}
data-for={tooltipId}
- data-place="right"
+ data-place={this.props.tooltipDirection}
onClick={this._onToggleAllowanceAsync.bind(this)}
>
<AllowanceStateView allowanceState={this.state.allowanceState} />