Merge branch 'master' into feature/footer-translators

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

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

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

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

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

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

@ -1,6 +1,7 @@
{
"networks": [
{
"order": 2,
"type": "ethereum",
"name": "Ethereum",
"symbol": "ETH",
@ -21,6 +22,7 @@
}
},
{
"order": 18,
"type": "ethereum",
"name": "Ethereum Classic",
"symbol": "ETC",
@ -40,7 +42,8 @@
"address": "https://gastracker.io/addr/"
}
},
{
{
"order": 2,
"type": "ethereum",
"name": "Ethereum Ropsten",
"testnet": true,
@ -74,6 +77,7 @@
}
},
{
"order": 3,
"type": "ripple",
"name": "Ripple",
"symbol": "XRP",
@ -94,6 +98,7 @@
}
},
{
"order": 3,
"type": "ripple",
"name": "Ripple Testnet",
"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 Cardano from 'components/modals/external/Cardano';
import Stellar from 'components/modals/external/Stellar';
import Tezos from 'components/modals/external/Tezos';
import QrModal from 'components/modals/QrModal';
@ -168,7 +169,9 @@ const getExternalContextModal = (props: Props) => {
case 'xlm':
return <Stellar onCancel={modalActions.onCancel} />;
case 'ada':
return <Cardano onCancel={modalActions.onCancel} />;
return (<Cardano onCancel={modalActions.onCancel} />);
case 'xtz':
return (<Tezos onCancel={modalActions.onCancel} />);
default:
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',
coinName: 'Bitcoin',
url: '../?coin=btc',
order: 1,
},
{
id: 'bch',
coinName: 'Bitcoin Cash',
url: '../?coin=bch',
order: 6,
},
{
id: 'btg',
coinName: 'Bitcoin Gold',
url: '../?coin=btg',
order: 27,
},
{
id: 'dash',
coinName: 'Dash',
url: '../?coin=dash',
order: 15,
},
{
id: 'dgb',
coinName: 'DigiByte',
url: '../?coin=dgb',
order: 42,
},
{
id: 'doge',
coinName: 'Dogecoin',
url: '../?coin=doge',
order: 26,
},
{
id: 'ltc',
coinName: 'Litecoin',
url: '../?coin=ltc',
order: 5,
},
{
id: 'nmc',
coinName: 'Namecoin',
url: '../?coin=nmc',
order: 255,
},
{
id: 'vtc',
coinName: 'Vertcoin',
url: '../?coin=vtc',
order: 154,
},
{
id: 'zec',
coinName: 'Zcash',
url: '../?coin=zec',
order: 20,
},
{
id: 'xem',
coinName: 'NEM',
url: 'https://nem.io/downloads/',
external: true,
order: 19,
},
{
id: 'xlm',
coinName: 'Stellar',
url: 'https://trezor.io/stellar',
external: true,
order: 9,
},
{
id: 'ada',
coinName: 'Cardano',
url: 'https://adalite.io/app',
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 = {
order: number,
type: string,
name: string,
testnet?: boolean,

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

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

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

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

Loading…
Cancel
Save