mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-30 20:28:09 +00:00
clearing ripple/SendForm componenent
This commit is contained in:
parent
2cc28c4bf6
commit
2e89624b27
@ -6,14 +6,11 @@ import { Select } from 'components/Select';
|
|||||||
import Button from 'components/Button';
|
import Button from 'components/Button';
|
||||||
import Input from 'components/inputs/Input';
|
import Input from 'components/inputs/Input';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import Link from 'components/Link';
|
|
||||||
import ICONS from 'config/icons';
|
import ICONS from 'config/icons';
|
||||||
import { FONT_SIZE, FONT_WEIGHT, TRANSITION } from 'config/variables';
|
import { FONT_SIZE, FONT_WEIGHT, TRANSITION } from 'config/variables';
|
||||||
import colors from 'config/colors';
|
import colors from 'config/colors';
|
||||||
import P from 'components/Paragraph';
|
|
||||||
import { H2 } from 'components/Heading';
|
import { H2 } from 'components/Heading';
|
||||||
import Content from 'views/Wallet/components/Content';
|
import Content from 'views/Wallet/components/Content';
|
||||||
import type { Token } from 'flowtype';
|
|
||||||
import PendingTransactions from '../components/PendingTransactions';
|
import PendingTransactions from '../components/PendingTransactions';
|
||||||
|
|
||||||
import type { Props } from './Container';
|
import type { Props } from './Container';
|
||||||
@ -22,16 +19,6 @@ import type { Props } from './Container';
|
|||||||
// and put it inside config/variables.js
|
// and put it inside config/variables.js
|
||||||
const SmallScreenWidth = '850px';
|
const SmallScreenWidth = '850px';
|
||||||
|
|
||||||
const AmountInputLabelWrapper = styled.div`
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const AmountInputLabel = styled.span`
|
|
||||||
text-align: right;
|
|
||||||
color: ${colors.TEXT_SECONDARY};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const InputRow = styled.div`
|
const InputRow = styled.div`
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
`;
|
`;
|
||||||
@ -79,34 +66,6 @@ const CurrencySelect = styled(Select)`
|
|||||||
flex: 0.2;
|
flex: 0.2;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const FeeOptionWrapper = styled.div`
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const FeeLabelWrapper = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const FeeLabel = styled.span`
|
|
||||||
color: ${colors.TEXT_SECONDARY};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const UpdateFeeWrapper = styled.span`
|
|
||||||
margin-left: 8px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-size: ${FONT_SIZE.SMALLER};
|
|
||||||
color: ${colors.WARNING_PRIMARY};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const StyledLink = styled(Link)`
|
|
||||||
margin-left: 4px;
|
|
||||||
white-space: nowrap;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const ToggleAdvancedSettingsWrapper = styled.div`
|
const ToggleAdvancedSettingsWrapper = styled.div`
|
||||||
min-height: 40px;
|
min-height: 40px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
@ -156,13 +115,6 @@ const getAmountInputState = (amountErrors: string, amountWarnings: string): stri
|
|||||||
return state;
|
return state;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTokensSelectData = (tokens: Array<Token>, accountNetwork: any): Array<{ value: string, label: string }> => {
|
|
||||||
const tokensSelectData: Array<{ value: string, label: string }> = tokens.map(t => ({ value: t.symbol, label: t.symbol }));
|
|
||||||
tokensSelectData.unshift({ value: accountNetwork.symbol, label: accountNetwork.symbol });
|
|
||||||
|
|
||||||
return tokensSelectData;
|
|
||||||
};
|
|
||||||
|
|
||||||
// stateless component
|
// stateless component
|
||||||
const AccountSend = (props: Props) => {
|
const AccountSend = (props: Props) => {
|
||||||
const device = props.wallet.selectedDevice;
|
const device = props.wallet.selectedDevice;
|
||||||
@ -170,7 +122,6 @@ const AccountSend = (props: Props) => {
|
|||||||
account,
|
account,
|
||||||
network,
|
network,
|
||||||
discovery,
|
discovery,
|
||||||
tokens,
|
|
||||||
shouldRender,
|
shouldRender,
|
||||||
loader,
|
loader,
|
||||||
} = props.selectedAccount;
|
} = props.selectedAccount;
|
||||||
@ -178,9 +129,6 @@ const AccountSend = (props: Props) => {
|
|||||||
address,
|
address,
|
||||||
amount,
|
amount,
|
||||||
setMax,
|
setMax,
|
||||||
networkSymbol,
|
|
||||||
feeLevels,
|
|
||||||
selectedFeeLevel,
|
|
||||||
total,
|
total,
|
||||||
errors,
|
errors,
|
||||||
warnings,
|
warnings,
|
||||||
@ -193,9 +141,6 @@ const AccountSend = (props: Props) => {
|
|||||||
onAddressChange,
|
onAddressChange,
|
||||||
onAmountChange,
|
onAmountChange,
|
||||||
onSetMax,
|
onSetMax,
|
||||||
onCurrencyChange,
|
|
||||||
onFeeLevelChange,
|
|
||||||
updateFeeLevels,
|
|
||||||
onSend,
|
onSend,
|
||||||
} = props.sendFormActions;
|
} = props.sendFormActions;
|
||||||
const { type, title, message } = loader;
|
const { type, title, message } = loader;
|
||||||
@ -279,8 +224,7 @@ const AccountSend = (props: Props) => {
|
|||||||
isSearchable={false}
|
isSearchable={false}
|
||||||
isClearable={false}
|
isClearable={false}
|
||||||
value={tokensSelectValue}
|
value={tokensSelectValue}
|
||||||
isDisabled={tokensSelectData.length < 2}
|
isDisabled
|
||||||
onChange={onCurrencyChange}
|
|
||||||
options={tokensSelectData}
|
options={tokensSelectData}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@ -288,25 +232,6 @@ const AccountSend = (props: Props) => {
|
|||||||
/>
|
/>
|
||||||
</InputRow>
|
</InputRow>
|
||||||
|
|
||||||
<InputRow>
|
|
||||||
<FeeLabelWrapper>
|
|
||||||
<FeeLabel>Fee</FeeLabel>
|
|
||||||
</FeeLabelWrapper>
|
|
||||||
<Select
|
|
||||||
isSearchable={false}
|
|
||||||
isClearable={false}
|
|
||||||
value={selectedFeeLevel}
|
|
||||||
onChange={onFeeLevelChange}
|
|
||||||
options={feeLevels}
|
|
||||||
formatOptionLabel={option => (
|
|
||||||
<FeeOptionWrapper>
|
|
||||||
<P>{option.value}</P>
|
|
||||||
<P>{option.label}</P>
|
|
||||||
</FeeOptionWrapper>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</InputRow>
|
|
||||||
|
|
||||||
<ToggleAdvancedSettingsWrapper
|
<ToggleAdvancedSettingsWrapper
|
||||||
isAdvancedSettingsHidden={isAdvancedSettingsHidden}
|
isAdvancedSettingsHidden={isAdvancedSettingsHidden}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user