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: components for only infra or ipfs render modes #240

Merged
Merged
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
29 changes: 16 additions & 13 deletions features/withdrawals/request/form/options/lido-option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
LidoOptionValue,
LidoOptionInlineLoader,
} from './styles';
import { OnlyInfraRender } from 'shared/components/only-infra-render';

const TooltipWithdrawalAmount = () => {
const { navigateInpageAnchor } = useInpageNavigation();
Expand All @@ -29,19 +30,21 @@ const TooltipWithdrawalAmount = () => {
title={
<>
The final amount of claimable ETH can differ
<br /> For more info, please read{' '}
<a
data-testid="lidoOptionToolTipFAQ"
href="#amountDifferentFromRequested"
onClick={(e) => {
trackMatomoEvent(
MATOMO_CLICK_EVENTS_TYPES.withdrawalFAQtooltipEthAmount,
);
navigateInpageAnchor(e);
}}
>
FAQ
</a>
<OnlyInfraRender>
<br /> For more info, please read{' '}
<a
data-testid="lidoOptionToolTipFAQ"
href="#amountDifferentFromRequested"
onClick={(e) => {
trackMatomoEvent(
MATOMO_CLICK_EVENTS_TYPES.withdrawalFAQtooltipEthAmount,
);
navigateInpageAnchor(e);
}}
>
FAQ
</a>
</OnlyInfraRender>
</>
}
>
Expand Down
30 changes: 17 additions & 13 deletions features/withdrawals/request/wallet/wallet-queue-tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
import { QueueInfoStyled, DataTableRowStyled } from './styles';
import { useRequestFormData } from '../request-form-context';
import { useInpageNavigation } from 'providers/inpage-navigation';
import { OnlyIpfsRender } from 'shared/components/only-ipfs-render';
import { OnlyInfraRender } from 'shared/components/only-infra-render';

export const WalletQueueTooltip = () => {
const waitingTime = useWaitingTime('');
Expand Down Expand Up @@ -38,19 +40,21 @@ export const WalletQueueTooltip = () => {
const tooltipTitle = (
<>
The withdrawal request time depends on the mode, overall amount of stETH
in queue and{' '}
<a
href="#withdrawalsPeriod"
data-testid="otherFactorsLink"
onClick={(e) => {
trackMatomoEvent(
MATOMO_CLICK_EVENTS_TYPES.withdrawalOtherFactorsTooltipMode,
);
navigateInpageAnchor(e);
}}
>
other factors
</a>
in queue and <OnlyIpfsRender>other factors</OnlyIpfsRender>
<OnlyInfraRender>
<a
href="#withdrawalsPeriod"
data-testid="otherFactorsLink"
onClick={(e) => {
trackMatomoEvent(
MATOMO_CLICK_EVENTS_TYPES.withdrawalOtherFactorsTooltipMode,
);
navigateInpageAnchor(e);
}}
>
other factors
</a>
</OnlyInfraRender>
.{queueInfo}
</>
);
Expand Down
1 change: 1 addition & 0 deletions shared/components/only-infra-render/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './only-infra-render';
5 changes: 5 additions & 0 deletions shared/components/only-infra-render/only-infra-render.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { dynamics } from 'config';

export const OnlyInfraRender = ({ children }: React.PropsWithChildren) => {
return !dynamics.ipfsMode ? <>{children}</> : null;
};
1 change: 1 addition & 0 deletions shared/components/only-ipfs-render/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './only-ipfs-render';
5 changes: 5 additions & 0 deletions shared/components/only-ipfs-render/only-ipfs-render.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { dynamics } from 'config';

export const OnlyIpfsRender = ({ children }: React.PropsWithChildren) => {
return dynamics.ipfsMode ? <>{children}</> : null;
};
Loading