From c43b9b138c8c1eea96513569cf411d511d3e8cf6 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Mon, 3 Dec 2018 18:14:09 +0100 Subject: [PATCH] removr advanced view from ripple/SendForm component --- .../Wallet/views/Account/Send/ripple/index.js | 95 +++---------------- 1 file changed, 12 insertions(+), 83 deletions(-) diff --git a/src/views/Wallet/views/Account/Send/ripple/index.js b/src/views/Wallet/views/Account/Send/ripple/index.js index 97638549..ac088be4 100644 --- a/src/views/Wallet/views/Account/Send/ripple/index.js +++ b/src/views/Wallet/views/Account/Send/ripple/index.js @@ -14,7 +14,6 @@ import P from 'components/Paragraph'; import { H2 } from 'components/Heading'; import Content from 'views/Wallet/components/Content'; import type { Token } from 'flowtype'; -import AdvancedForm from '../components/AdvancedForm'; import PendingTransactions from '../components/PendingTransactions'; import type { Props } from './Container'; @@ -122,14 +121,6 @@ const ToggleAdvancedSettingsWrapper = styled.div` } `; -const ToggleAdvancedSettingsButton = styled(Button)` - min-height: 40px; - padding: 0; - display: flex; - align-items: center; - font-weight: ${FONT_WEIGHT.BIGGER}; -`; - const SendButton = styled(Button)` min-width: ${props => (props.isAdvancedSettingsHidden ? '50%' : '100%')}; font-size: 13px; @@ -139,10 +130,6 @@ const SendButton = styled(Button)` } `; -const AdvancedSettingsIcon = styled(Icon)` - margin-left: 10px; -`; - // render helpers const getAddressInputState = (address: string, addressErrors: string, addressWarnings: string): string => { let state = ''; @@ -192,10 +179,8 @@ const AccountSend = (props: Props) => { amount, setMax, networkSymbol, - currency, feeLevels, selectedFeeLevel, - gasPriceNeedsUpdate, total, errors, warnings, @@ -205,7 +190,6 @@ const AccountSend = (props: Props) => { } = props.sendForm; const { - toggleAdvanced, onAddressChange, onAmountChange, onSetMax, @@ -217,21 +201,8 @@ const AccountSend = (props: Props) => { const { type, title, message } = loader; if (!device || !account || !discovery || !network || !shouldRender) return ; - const isCurrentCurrencyToken = networkSymbol !== currency; - - let selectedTokenBalance = 0; - const selectedToken = tokens.find(t => t.symbol === currency); - if (selectedToken) { - selectedTokenBalance = selectedToken.balance; - } - let isSendButtonDisabled: boolean = Object.keys(errors).length > 0 || total === '0' || amount.length === 0 || address.length === 0 || sending; - let sendButtonText: string = 'Send'; - if (networkSymbol !== currency && amount.length > 0 && !errors.amount) { - sendButtonText += ` ${amount} ${currency.toUpperCase()}`; - } else if (networkSymbol === currency && total !== '0') { - sendButtonText += ` ${total} ${network.symbol}`; - } + let sendButtonText: string = ` ${total} ${network.symbol}`; if (!device.connected) { sendButtonText = 'Device is not connected'; @@ -244,14 +215,16 @@ const AccountSend = (props: Props) => { isSendButtonDisabled = true; } - const tokensSelectData = getTokensSelectData(tokens, network); - const tokensSelectValue = tokensSelectData.find(t => t.value === currency); + isSendButtonDisabled = false; + + const tokensSelectData: Array<{ value: string, label: string }> = [{ value: network.symbol, label: network.symbol }]; + const tokensSelectValue = tokensSelectData[0]; const isAdvancedSettingsHidden = !advanced; return ( -

Send Ethereum or tokens

+

Send Ripple

{ autoCorrect="off" autoCapitalize="off" spellCheck="false" - topLabel={( - - Amount - {(isCurrentCurrencyToken && selectedToken) && ( - You have: {selectedTokenBalance} {selectedToken.symbol} - )} - - )} value={amount} onChange={event => onAmountChange(event.target.value)} bottomText={errors.amount || warnings.amount || infos.amount} @@ -326,16 +291,6 @@ const AccountSend = (props: Props) => { Fee - {gasPriceNeedsUpdate && ( - - - Recommended fees updated. Click here to use them - - )}