From 6a8ff3f0f1a74cf15bc47cde942bde672a5b747d Mon Sep 17 00:00:00 2001 From: zeppi Date: Tue, 7 Dec 2021 13:29:32 -0500 Subject: [PATCH] remove swap --- ui/component/router/view.jsx | 2 - ui/component/walletSwap/view.jsx | 4 + ui/page/buy/view.jsx | 207 +++++++++++++------------------ ui/page/swap/index.js | 6 - ui/page/swap/view.jsx | 21 ---- 5 files changed, 92 insertions(+), 148 deletions(-) delete mode 100644 ui/page/swap/index.js delete mode 100644 ui/page/swap/view.jsx diff --git a/ui/component/router/view.jsx b/ui/component/router/view.jsx index b77ca95b1..6de63cbcd 100644 --- a/ui/component/router/view.jsx +++ b/ui/component/router/view.jsx @@ -23,7 +23,6 @@ import SignInVerifyPage from 'page/signInVerify'; import BuyPage from 'page/buy'; import ReceivePage from 'page/receive'; import SendPage from 'page/send'; -import SwapPage from 'page/swap'; import WalletPage from 'page/wallet'; // Chunk: none @@ -300,7 +299,6 @@ function AppRouter(props: Props) { - diff --git a/ui/component/walletSwap/view.jsx b/ui/component/walletSwap/view.jsx index 9a003d4c9..a769230e9 100644 --- a/ui/component/walletSwap/view.jsx +++ b/ui/component/walletSwap/view.jsx @@ -1,4 +1,8 @@ // @flow + +/* + This component is not used at this time. + */ import React from 'react'; import Button from 'component/button'; import { FormField, Form } from 'component/common/form'; diff --git a/ui/page/buy/view.jsx b/ui/page/buy/view.jsx index 6de7242ee..699ee660c 100644 --- a/ui/page/buy/view.jsx +++ b/ui/page/buy/view.jsx @@ -1,5 +1,4 @@ // @flow -import * as ICONS from 'constants/icons'; import React from 'react'; import Page from 'component/page'; import Card from 'component/common/card'; @@ -14,8 +13,6 @@ import Button from 'component/button'; import Nag from 'component/common/nag'; import I18nMessage from 'component/i18nMessage'; import LbcSymbol from 'component/common/lbc-symbol'; -import classnames from 'classnames'; -import WalletSwap from 'component/walletSwap'; const MOONPAY_KEY = process.env.MOONPAY_SECRET_KEY; const COUNTRIES = Array.from( @@ -37,11 +34,6 @@ const COUNTRIES = Array.from( ) ); -const TAB = { - BUY: 'BUY', - SWAP: 'SWAP', -}; - type Props = { receiveAddress: ?string, gettingNewAddress: boolean, @@ -54,7 +46,6 @@ type Props = { export default function BuyPage(props: Props) { const { receiveAddress, gettingNewAddress, doGetNewAddress, email, user, doUserSetCountry } = props; const initialCountry = (user && user.country) || ''; - const [tab, setTab] = React.useState(TAB.BUY); const [url, setUrl] = React.useState(); const [country, setCountry] = React.useState(initialCountry); const [showPurchaseScreen, setShowPurchaseScreen] = React.useState(false); @@ -107,121 +98,99 @@ export default function BuyPage(props: Props) { className="main--swap" backout={{ backoutLabel: __('Done'), - title: , + title: , }} >
-
-
- {tab === TAB.SWAP && } - {tab === TAB.BUY && ( - <> - {!user && ( -
- -
- )} + <> + {!user && ( +
+ +
+ )} - {user && ( - <> - {showPurchaseScreen ? ( - -

{__('Your browser does not support iframes.')}

- - ) : ( -
- -
- ) - } - /> - ) : ( - - } - actions={ -
-
- setCountry(e.target.value)} - > - - {COUNTRIES.map((country, index) => ( - - ))} - -
- {country && ( -
- {isValid ? ( -
-
- ) : ( -
-
- )} -
- )} + {user && ( + <> + {showPurchaseScreen ? ( + +

{__('Your browser does not support iframes.')}

+ + ) : ( +
+
- } - /> - )} - - )} - - )} + ) + } + /> + ) : ( + + } + actions={ +
+
+ setCountry(e.target.value)} + > + + {COUNTRIES.map((country, index) => ( + + ))} + +
+ {country && ( +
+ {isValid ? ( +
+
+ ) : ( +
+
+ )} +
+ )} +
+ } + /> + )} + + )} +
); diff --git a/ui/page/swap/index.js b/ui/page/swap/index.js deleted file mode 100644 index 8d853b9cf..000000000 --- a/ui/page/swap/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { connect } from 'react-redux'; -import SwapPage from './view'; - -const select = (state) => ({}); - -export default connect(select, null)(SwapPage); diff --git a/ui/page/swap/view.jsx b/ui/page/swap/view.jsx deleted file mode 100644 index fe229a1b0..000000000 --- a/ui/page/swap/view.jsx +++ /dev/null @@ -1,21 +0,0 @@ -// @flow -import React from 'react'; -import Page from 'component/page'; -import WalletSwap from 'component/walletSwap'; - -type Props = {}; - -export default function SwapPage(props: Props) { - return ( - - - - ); -}