Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable interactive tooltip #303

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 src/modules/scenes/Main/Explorer/Browser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export const Browser = () => {
</Tooltip.Content>
}
data-testid="tooltip"
interactive={true}
>
<IconInfo />
</Tooltip>
Expand Down
33 changes: 19 additions & 14 deletions src/modules/scenes/Main/Explorer/StatsInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
const lockedAmount = Number(lockHistories[lockHistories.length - 1].amount);
const floatAmount = Number(floatHistories[floatHistories.length - 1].amount);

const rewardsTotal = reward ? reward.total : 0;

Check warning on line 92 in src/modules/scenes/Main/Explorer/StatsInfo/index.tsx

View workflow job for this annotation

GitHub Actions / Build, lint, and test

'rewardsTotal' is assigned a value but never used

const dataChart = usd && [
{
Expand Down Expand Up @@ -239,26 +239,31 @@
content={
<Tooltip.Content>
<Text variant="accent">
<a
href="https://app.swingby.network/liquidity"
target="_blank"
rel="noreferrer"
>
Deposit liquidity
</a>
<ValidatorLinkSpan>
<a
href="https://app.swingby.network/liquidity"
target="_blank"
rel="noreferrer"
>
Deposit liquidity
</a>
</ValidatorLinkSpan>
&nbsp; and then stake the LP tokens in the&nbsp;
<a
href="https://farm.swingby.network"
target="_blank"
rel="noreferrer"
>
Farm
</a>
<ValidatorLinkSpan>
<a
href="https://farm.swingby.network"
target="_blank"
rel="noreferrer"
>
Farm
</a>
</ValidatorLinkSpan>
.
</Text>
</Tooltip.Content>
}
data-testid="tooltip"
interactive={true}
>
<IconInfo />
</Tooltip>
Expand Down
11 changes: 7 additions & 4 deletions src/modules/scenes/Main/SwapLegacy/SwapFees/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { useDispatch } from 'react-redux';
import { TTxRawObject } from '../../../../explorer';
import { useSdkContext } from '../../../../sdk-context';
import { toggleIsExistPreviousPage } from '../../../../store';
import { TextPrimary } from '../../../Common';
import { swingbyTextDisplay } from '../../../../coins';

import {
Expand All @@ -21,6 +20,7 @@ import {
SwapFeesContainer,
TitleText,
Top,
TextPrimary,
} from './styled';

interface Props {
Expand Down Expand Up @@ -57,13 +57,16 @@ export const SwapFees = (props: Props) => {
content={
<Tooltip.Content>
<FormattedMessage id="swap.node-explanation1" />
<TextPrimary>
<FormattedMessage id="common.click" />
</TextPrimary>
<Link href="/fees">
<TextPrimary>
<FormattedMessage id="common.click" />
</TextPrimary>
</Link>
<FormattedMessage id="swap.node-explanation2" />
</Tooltip.Content>
}
data-testid="tooltip"
interactive={true}
>
<Link href="/fees">
<IconInfo onClick={() => dispatch(toggleIsExistPreviousPage(true))} />
Expand Down
5 changes: 5 additions & 0 deletions src/modules/scenes/Main/SwapLegacy/SwapFees/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { rem } from 'polished';
import styled from 'styled-components';

import { StylingConstants } from '../../../../styles';
import { TextPrimary as CommonTextPrimary } from '../../../Common';

const { media } = StylingConstants;

Expand Down Expand Up @@ -64,3 +65,7 @@ export const Center = styled.div`
justify-content: space-between;
align-items: center;
`;

export const TextPrimary = styled(CommonTextPrimary)`
cursor: pointer;
`;
Loading