Skip to content

Commit

Permalink
Merge pull request #457 from swim-io/ui/remove-eth-merge-warning
Browse files Browse the repository at this point in the history
Remove Ethereum merge-related code
  • Loading branch information
wormat authored Oct 25, 2022
2 parents 58b95d9 + d954aa4 commit c04e0c2
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 118 deletions.
16 changes: 0 additions & 16 deletions apps/ui/src/components/molecules/EthereumMergeWarning.tsx

This file was deleted.

179 changes: 87 additions & 92 deletions apps/ui/src/pages/PoolPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { RemoveForm } from "../components/RemoveForm";
import { SlippageButton } from "../components/SlippageButton";
import { StatList } from "../components/StatList";
import { TokenConfigIcon, TokenIcon } from "../components/TokenIcon";
import { EthereumMergeWarning } from "../components/molecules/EthereumMergeWarning";
import type { PoolSpec } from "../config";
import { getSolanaTokenDetails, getTokenDetailsForEcosystem } from "../config";
import { selectConfig } from "../core/selectors";
Expand Down Expand Up @@ -239,97 +238,93 @@ export const PoolPageInner = ({

<EuiSpacer size="m" />

{process.env.REACT_APP_ETHEREUM_MERGE === "true" ? (
<EthereumMergeWarning />
) : (
<EuiFlexGroup justifyContent="spaceAround" gutterSize="xl">
<EuiFlexItem style={{ minWidth: "50%" }}>
<EuiTabbedContent
expand={true}
size="m"
tabs={[
{
id: "add",
name: poolSpec.isStakingPool
? t("glossary.stake_tokens")
: t("general.add_tokens_to_pool"),
content: (
<AddForm
poolSpec={poolSpec}
maxSlippageFraction={slippageFraction}
/>
),
},
{
id: "remove",
name: poolSpec.isStakingPool
? t("glossary.unstake_tokens")
: t("general.remove_tokens_from_pool"),
content: (
<RemoveForm
poolSpec={poolSpec}
maxSlippageFraction={slippageFraction}
/>
),
},
]}
/>
</EuiFlexItem>
<EuiFlexItem grow={false} className="statList">
<EuiTitle size="xxs">
<h4>
{t("pool_page.pool_balance", { count: reserveStats.length })}
</h4>
</EuiTitle>
<EuiSpacer size="s" />
<StatList listItems={reserveStats} />
<EuiSpacer />
<EuiTitle size="xxs">
<h4>
{t("pool_page.user_balance", { count: userLpStats.length })}
</h4>
</EuiTitle>
<EuiSpacer size="s" />
<StatList listItems={userLpStats} />
<EuiSpacer />
{!poolSpec.isStakingPool && (
<>
<EuiTitle size="xxs">
<h4>{t("pool_page.pool_info")}</h4>
</EuiTitle>
<EuiSpacer size="s" />
<StatList listItems={poolInfoStats} />
</>
)}
{getTokenDetailsForEcosystem(lpToken, EvmEcosystemId.Ethereum) !==
null && (
<EuiButtonEmpty
flush="left"
style={{ width: "fit-content" }}
onClick={() => {
showRegisterEthereumTokenPrompt(lpToken).catch(console.error);
}}
iconType={ETHEREUM_SVG}
>
{t("pool_page.add_lp_token_to_metamask")}
</EuiButtonEmpty>
)}
{getTokenDetailsForEcosystem(lpToken, EvmEcosystemId.Bnb) !==
null && (
<EuiButtonEmpty
flush="left"
style={{ width: "fit-content" }}
onClick={() => {
showRegisterBnbTokenPrompt(lpToken).catch(console.error);
}}
iconType={BNB_SVG}
>
{t("pool_page.add_lp_token_to_metamask")}
</EuiButtonEmpty>
)}
</EuiFlexItem>
</EuiFlexGroup>
)}
<EuiFlexGroup justifyContent="spaceAround" gutterSize="xl">
<EuiFlexItem style={{ minWidth: "50%" }}>
<EuiTabbedContent
expand={true}
size="m"
tabs={[
{
id: "add",
name: poolSpec.isStakingPool
? t("glossary.stake_tokens")
: t("general.add_tokens_to_pool"),
content: (
<AddForm
poolSpec={poolSpec}
maxSlippageFraction={slippageFraction}
/>
),
},
{
id: "remove",
name: poolSpec.isStakingPool
? t("glossary.unstake_tokens")
: t("general.remove_tokens_from_pool"),
content: (
<RemoveForm
poolSpec={poolSpec}
maxSlippageFraction={slippageFraction}
/>
),
},
]}
/>
</EuiFlexItem>
<EuiFlexItem grow={false} className="statList">
<EuiTitle size="xxs">
<h4>
{t("pool_page.pool_balance", { count: reserveStats.length })}
</h4>
</EuiTitle>
<EuiSpacer size="s" />
<StatList listItems={reserveStats} />
<EuiSpacer />
<EuiTitle size="xxs">
<h4>
{t("pool_page.user_balance", { count: userLpStats.length })}
</h4>
</EuiTitle>
<EuiSpacer size="s" />
<StatList listItems={userLpStats} />
<EuiSpacer />
{!poolSpec.isStakingPool && (
<>
<EuiTitle size="xxs">
<h4>{t("pool_page.pool_info")}</h4>
</EuiTitle>
<EuiSpacer size="s" />
<StatList listItems={poolInfoStats} />
</>
)}
{getTokenDetailsForEcosystem(lpToken, EvmEcosystemId.Ethereum) !==
null && (
<EuiButtonEmpty
flush="left"
style={{ width: "fit-content" }}
onClick={() => {
showRegisterEthereumTokenPrompt(lpToken).catch(console.error);
}}
iconType={ETHEREUM_SVG}
>
{t("pool_page.add_lp_token_to_metamask")}
</EuiButtonEmpty>
)}
{getTokenDetailsForEcosystem(lpToken, EvmEcosystemId.Bnb) !==
null && (
<EuiButtonEmpty
flush="left"
style={{ width: "fit-content" }}
onClick={() => {
showRegisterBnbTokenPrompt(lpToken).catch(console.error);
}}
iconType={BNB_SVG}
>
{t("pool_page.add_lp_token_to_metamask")}
</EuiButtonEmpty>
)}
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer />
</>
);
Expand Down
7 changes: 1 addition & 6 deletions apps/ui/src/pages/PoolsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import shallow from "zustand/shallow.js";

import { atomicToTvlString } from "../amounts";
import { PoolListItem } from "../components/PoolListItem";
import { EthereumMergeWarning } from "../components/molecules/EthereumMergeWarning";
import {
getPoolTokenEcosystems,
hasTokenEcosystem,
Expand Down Expand Up @@ -364,11 +363,7 @@ const PoolsPage = (): ReactElement => {
</EuiShowFor>

<EuiSpacer />
{process.env.REACT_APP_ETHEREUM_MERGE === "true" ? (
<EthereumMergeWarning />
) : (
content
)}
{content}
</EuiPageContentBody>
</EuiPageContent>
</EuiPageBody>
Expand Down
5 changes: 1 addition & 4 deletions apps/ui/src/pages/SwapPage/SwapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { MultiConnectButton } from "../../components/ConnectButton";
import { RecentInteractions } from "../../components/RecentInteractions";
import { SlippageButton } from "../../components/SlippageButton";
import { SwapForm } from "../../components/SwapForm";
import { EthereumMergeWarning } from "../../components/molecules/EthereumMergeWarning";
import { ECOSYSTEMS } from "../../config";
import { selectConfig } from "../../core/selectors";
import { useEnvironment } from "../../core/store";
Expand Down Expand Up @@ -80,9 +79,7 @@ const SwapPage = (): ReactElement => {
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer />
{process.env.REACT_APP_ETHEREUM_MERGE === "true" ? (
<EthereumMergeWarning />
) : nonStakingPools.length > 0 ? (
{nonStakingPools.length > 0 ? (
<SwapForm maxSlippageFraction={slippageFraction} />
) : (
<EuiEmptyPrompt
Expand Down

0 comments on commit c04e0c2

Please sign in to comment.