Merge branch 'master' into feature/footer-translators

pull/433/head
slowbackspace 5 years ago
commit 86594f35dc

@ -3,10 +3,9 @@
"eslint-config-airbnb", "eslint-config-airbnb",
"prettier", "prettier",
"prettier/babel", "prettier/babel",
"plugin:flowtype/recommended",
"prettier/flowtype", "prettier/flowtype",
"prettier/react", "prettier/react",
"plugin:jest/recommended", "plugin:flowtype/recommended",
"plugin:jest/recommended" "plugin:jest/recommended"
], ],
"globals": { "globals": {

@ -179,4 +179,4 @@ integration tests:
when: always when: always
expire_in: 1 week expire_in: 1 week
paths: paths:
- trezor-wallet/ - trezor-wallet/

@ -17,13 +17,6 @@
"ignoreProperties": ["composes", "font-smoothing", "font-smooth"] "ignoreProperties": ["composes", "font-smoothing", "font-smooth"]
} }
], ],
"at-rule-empty-line-before": [
"always", {
"ignoreAtRules": [
"import"
]
}
],
"at-rule-no-unknown": [ true, { "at-rule-no-unknown": [ true, {
ignoreAtRules: ["each"] ignoreAtRules: ["each"]
}] }]

@ -1,3 +1,8 @@
## 1.1.0-beta
__added__
- Ripple destination tag option
- Tezos external wallet
## 1.1.0-beta ## 1.1.0-beta
__added__ __added__
- Ripple support - Ripple support

@ -1,6 +1,6 @@
{ {
"name": "trezor-wallet", "name": "trezor-wallet",
"version": "1.1.0-beta", "version": "1.1.1-beta",
"author": "TREZOR <info@trezor.io>", "author": "TREZOR <info@trezor.io>",
"description": "", "description": "",
"bin": { "bin": {
@ -21,7 +21,7 @@
"lint": "run-s lint:*", "lint": "run-s lint:*",
"lint:js": "npx eslint ./src ./webpack", "lint:js": "npx eslint ./src ./webpack",
"lint:css": "npx stylelint './src/**/*.js'", "lint:css": "npx stylelint './src/**/*.js'",
"lint:prettier": "npx pretty-quick", "lint:prettier": "npx pretty-quick --bail",
"lint-fix": "npx eslint ./src ./webpack --fix", "lint-fix": "npx eslint ./src ./webpack --fix",
"prettier:check": "npx eslint --print-config ./src | eslint-config-prettier-check", "prettier:check": "npx eslint --print-config ./src | eslint-config-prettier-check",
"test": "run-s test:*", "test": "run-s test:*",

@ -1,6 +1,7 @@
{ {
"networks": [ "networks": [
{ {
"order": 2,
"type": "ethereum", "type": "ethereum",
"name": "Ethereum", "name": "Ethereum",
"symbol": "ETH", "symbol": "ETH",
@ -21,6 +22,7 @@
} }
}, },
{ {
"order": 18,
"type": "ethereum", "type": "ethereum",
"name": "Ethereum Classic", "name": "Ethereum Classic",
"symbol": "ETC", "symbol": "ETC",
@ -40,7 +42,8 @@
"address": "https://gastracker.io/addr/" "address": "https://gastracker.io/addr/"
} }
}, },
{ {
"order": 2,
"type": "ethereum", "type": "ethereum",
"name": "Ethereum Ropsten", "name": "Ethereum Ropsten",
"testnet": true, "testnet": true,
@ -74,6 +77,7 @@
} }
}, },
{ {
"order": 3,
"type": "ripple", "type": "ripple",
"name": "Ripple", "name": "Ripple",
"symbol": "XRP", "symbol": "XRP",
@ -94,6 +98,7 @@
} }
}, },
{ {
"order": 3,
"type": "ripple", "type": "ripple",
"name": "Ripple Testnet", "name": "Ripple Testnet",
"testnet": true, "testnet": true,

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -0,0 +1,70 @@
/* @flow */
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import colors from 'config/colors';
import icons from 'config/icons';
import Icon from 'components/Icon';
import Link from 'components/Link';
import Button from 'components/Button';
import { H2 } from 'components/Heading';
import P from 'components/Paragraph';
import coins from 'constants/coins';
import TezosImage from './images/xtz.png';
import type { Props as BaseProps } from '../../Container';
type Props = {
onCancel: $ElementType<$ElementType<BaseProps, 'modalActions'>, 'onCancel'>;
}
const Wrapper = styled.div`
width: 100%;
max-width: 620px;
padding: 30px 48px;
`;
const StyledButton = styled(Button)`
margin-top: 10px;
width: 100%;
`;
const StyledLink = styled(Link)`
position: absolute;
right: 15px;
top: 10px;
`;
const Img = styled.img`
display: block;
max-width: 100px;
margin: 0 auto;
height: auto;
padding-bottom: 20px;
`;
const TezosWallet = (props: Props) => (
<Wrapper>
<StyledLink onClick={props.onCancel}>
<Icon
size={24}
color={colors.TEXT_SECONDARY}
icon={icons.CLOSE}
/>
</StyledLink>
<Img src={TezosImage} />
<H2>Tezos wallet</H2>
<P isSmaller>You will be redirected to external wallet</P>
<Link href={coins.find(i => i.id === 'xtz').url}>
<StyledButton onClick={props.onCancel}>Go to external wallet</StyledButton>
</Link>
</Wrapper>
);
TezosWallet.propTypes = {
onCancel: PropTypes.func.isRequired,
};
export default TezosWallet;

@ -29,6 +29,7 @@ import WalletType from 'components/modals/device/WalletType';
import Nem from 'components/modals/external/Nem'; import Nem from 'components/modals/external/Nem';
import Cardano from 'components/modals/external/Cardano'; import Cardano from 'components/modals/external/Cardano';
import Stellar from 'components/modals/external/Stellar'; import Stellar from 'components/modals/external/Stellar';
import Tezos from 'components/modals/external/Tezos';
import QrModal from 'components/modals/QrModal'; import QrModal from 'components/modals/QrModal';
@ -168,7 +169,9 @@ const getExternalContextModal = (props: Props) => {
case 'xlm': case 'xlm':
return <Stellar onCancel={modalActions.onCancel} />; return <Stellar onCancel={modalActions.onCancel} />;
case 'ada': case 'ada':
return <Cardano onCancel={modalActions.onCancel} />; return (<Cardano onCancel={modalActions.onCancel} />);
case 'xtz':
return (<Tezos onCancel={modalActions.onCancel} />);
default: default:
return null; return null;
} }

@ -49,26 +49,6 @@ export default (props: Props) => {
} }
/> />
); );
} else if (location.state.send) {
notifications.push(
<Notification
key="xrp-warning"
type="warning"
title="Do not send to accounts requiring a destination tag!"
message={
<>
Destination tag is an arbitrary number which serves as a unique
identifier of your transaction. Some services may require this to
process your transaction. The current firmware version{' '}
<strong>does not support</strong> destination tags yet.
<br />
<br />
If the receiver requires a destination tag, do not use Trezor to send
XRP. We are working on adding this feature.
</>
}
/>
);
} }
} }

@ -3,68 +3,87 @@ export default [
id: 'btc', id: 'btc',
coinName: 'Bitcoin', coinName: 'Bitcoin',
url: '../?coin=btc', url: '../?coin=btc',
order: 1,
}, },
{ {
id: 'bch', id: 'bch',
coinName: 'Bitcoin Cash', coinName: 'Bitcoin Cash',
url: '../?coin=bch', url: '../?coin=bch',
order: 6,
}, },
{ {
id: 'btg', id: 'btg',
coinName: 'Bitcoin Gold', coinName: 'Bitcoin Gold',
url: '../?coin=btg', url: '../?coin=btg',
order: 27,
}, },
{ {
id: 'dash', id: 'dash',
coinName: 'Dash', coinName: 'Dash',
url: '../?coin=dash', url: '../?coin=dash',
order: 15,
}, },
{ {
id: 'dgb', id: 'dgb',
coinName: 'DigiByte', coinName: 'DigiByte',
url: '../?coin=dgb', url: '../?coin=dgb',
order: 42,
}, },
{ {
id: 'doge', id: 'doge',
coinName: 'Dogecoin', coinName: 'Dogecoin',
url: '../?coin=doge', url: '../?coin=doge',
order: 26,
}, },
{ {
id: 'ltc', id: 'ltc',
coinName: 'Litecoin', coinName: 'Litecoin',
url: '../?coin=ltc', url: '../?coin=ltc',
order: 5,
}, },
{ {
id: 'nmc', id: 'nmc',
coinName: 'Namecoin', coinName: 'Namecoin',
url: '../?coin=nmc', url: '../?coin=nmc',
order: 255,
}, },
{ {
id: 'vtc', id: 'vtc',
coinName: 'Vertcoin', coinName: 'Vertcoin',
url: '../?coin=vtc', url: '../?coin=vtc',
order: 154,
}, },
{ {
id: 'zec', id: 'zec',
coinName: 'Zcash', coinName: 'Zcash',
url: '../?coin=zec', url: '../?coin=zec',
order: 20,
}, },
{ {
id: 'xem', id: 'xem',
coinName: 'NEM', coinName: 'NEM',
url: 'https://nem.io/downloads/', url: 'https://nem.io/downloads/',
external: true, external: true,
order: 19,
}, },
{ {
id: 'xlm', id: 'xlm',
coinName: 'Stellar', coinName: 'Stellar',
url: 'https://trezor.io/stellar', url: 'https://trezor.io/stellar',
external: true, external: true,
order: 9,
}, },
{ {
id: 'ada', id: 'ada',
coinName: 'Cardano', coinName: 'Cardano',
url: 'https://adalite.io/app', url: 'https://adalite.io/app',
external: true, external: true,
order: 12,
},
{
id: 'xtz',
coinName: 'Tezos',
url: 'https://wallet.simplestaking.com/tezos/wallet/start',
external: true,
}, },
]; ];

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -13,6 +13,7 @@ type NetworkFeeLevel = {
}; };
export type Network = { export type Network = {
order: number,
type: string, type: string,
name: string, name: string,
testnet?: boolean, testnet?: boolean,

@ -37,59 +37,62 @@ class CoinMenu extends PureComponent<Props> {
} }
getOtherCoins() { getOtherCoins() {
return coins.map(coin => { return coins
const row = ( .sort((a, b) => a.order - b.order)
<RowCoin .map(coin => {
network={{ const row = (
name: coin.coinName, <RowCoin
shortcut: coin.id, network={{
}} name: coin.coinName,
iconRight={{ shortcut: coin.id,
type: ICONS.SKIP, }}
color: colors.TEXT_SECONDARY, iconRight={{
size: 27, type: ICONS.SKIP,
}} color: colors.TEXT_SECONDARY,
/> size: 27,
); }}
/>
);
if (coin.external) if (coin.external)
return (
<ExternalWallet
key={coin.id}
onClick={() => this.props.gotoExternalWallet(coin.id, coin.url)}
>
{row}
</ExternalWallet>
);
return ( return (
<ExternalWallet <Link key={coin.id} href={coin.url} target="_top">
key={coin.id}
onClick={() => this.props.gotoExternalWallet(coin.id, coin.url)}
>
{row} {row}
</ExternalWallet> </Link>
); );
return ( });
<Link key={coin.id} href={coin.url} target="_top">
{row}
</Link>
);
});
} }
render() { render() {
const { config } = this.props.localStorage; const { config } = this.props.localStorage;
return ( return (
<Wrapper data-test="Main__page__coin__menu"> <Wrapper data-test="Main__page__coin__menu">
{config.networks.map(item => ( {config.networks
<NavLink .sort((a, b) => a.order - b.order)
key={item.shortcut} .map(item => (
to={`${this.getBaseUrl()}/network/${item.shortcut}/account/0`} <NavLink
> key={item.shortcut}
<RowCoin to={`${this.getBaseUrl()}/network/${item.shortcut}/account/0`}
network={{ >
name: item.name, <RowCoin
shortcut: item.shortcut, network={{
}} name: item.name,
/> shortcut: item.shortcut,
</NavLink> }}
))} />
</NavLink>
))}
<Divider <Divider
testId="Main__page__coin__menu__divider" testId="Main__page__coin__menu__divider"
textLeft={<FormattedMessage {...l10nMessages.TR_OTHER_COINS} />} textLeft={<FormattedMessage {...l10nMessages.TR_OTHER_COINS} />}
textRight={<FormattedMessage {...l10nMessages.TR_YOU_WILL_BE_REDIRECTED} />}
hasBorder hasBorder
/> />
{this.getOtherCoins()} {this.getOtherCoins()}

@ -7,10 +7,6 @@ const definedMessages: Messages = defineMessages({
id: 'TR_OTHER_COINS', id: 'TR_OTHER_COINS',
defaultMessage: 'Other coins', defaultMessage: 'Other coins',
}, },
TR_YOU_WILL_BE_REDIRECTED: {
id: 'TR_YOU_WILL_BE_REDIRECTED',
defaultMessage: '(You will be redirected)',
},
}); });
export default definedMessages; export default definedMessages;

@ -27,7 +27,7 @@ const TextLeft = styled.p`
const Divider = ({ textLeft, textRight, hasBorder = false, className, testId }) => ( const Divider = ({ textLeft, textRight, hasBorder = false, className, testId }) => (
<Wrapper data-test={testId} hasBorder={hasBorder} className={className}> <Wrapper data-test={testId} hasBorder={hasBorder} className={className}>
<TextLeft>{textLeft}</TextLeft> <TextLeft>{textLeft}</TextLeft>
<p>{textRight}</p> {textRight && <p>{textRight}</p>}
</Wrapper> </Wrapper>
); );

@ -82,16 +82,16 @@ const getFeeInputState = (feeErrors: string, feeWarnings: string): string => {
return state; return state;
}; };
// const getDestinationTagInputState = (errors: string, warnings: string): string => { const getDestinationTagInputState = (errors: string, warnings: string): string => {
// let state = ''; let state = '';
// if (warnings && !errors) { if (warnings && !errors) {
// state = 'warning'; state = 'warning';
// } }
// if (errors) { if (errors) {
// state = 'error'; state = 'error';
// } }
// return state; return state;
// }; };
const Left = styled.div` const Left = styled.div`
display: flex; display: flex;
@ -107,11 +107,11 @@ const AdvancedForm = (props: Props) => {
warnings, warnings,
infos, infos,
fee, fee,
// destinationTag, destinationTag,
} = props.sendForm; } = props.sendForm;
const { const {
onFeeChange, onFeeChange,
// onDestinationTagChange, onDestinationTagChange,
} = props.sendFormActions; } = props.sendFormActions;
return ( return (
@ -150,7 +150,7 @@ const AdvancedForm = (props: Props) => {
/> />
</InputRow> </InputRow>
{/* <InputRow> <InputRow>
<StyledInput <StyledInput
state={getDestinationTagInputState(errors.destinationTag, warnings.destinationTag)} state={getDestinationTagInputState(errors.destinationTag, warnings.destinationTag)}
autoComplete="off" autoComplete="off"
@ -180,7 +180,7 @@ const AdvancedForm = (props: Props) => {
value={destinationTag} value={destinationTag}
onChange={event => onDestinationTagChange(event.target.value)} onChange={event => onDestinationTagChange(event.target.value)}
/> />
</InputRow> */} </InputRow>
<AdvancedSettingsSendButtonWrapper>{props.children}</AdvancedSettingsSendButtonWrapper> <AdvancedSettingsSendButtonWrapper>{props.children}</AdvancedSettingsSendButtonWrapper>
</AdvancedSettingsWrapper> </AdvancedSettingsWrapper>

Loading…
Cancel
Save