mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-07 14:50:52 +00:00
Added correct url for old beta/stable wallet
This commit is contained in:
parent
f4685961ec
commit
44f5f62566
@ -2,7 +2,7 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { getOldWalletUrl } from 'utils/url';
|
||||
import icons from 'config/icons';
|
||||
import colors from 'config/colors';
|
||||
|
||||
@ -151,7 +151,7 @@ class ConfirmUnverifiedAddress extends PureComponent<Props> {
|
||||
</Content>
|
||||
<Content>
|
||||
<Row>
|
||||
<Link href="https://wallet.trezor.io/?backup">
|
||||
<Link href={`${getOldWalletUrl(device)}/?backup`}>
|
||||
<BackupButton>Create a backup in 3 minutes</BackupButton>
|
||||
</Link>
|
||||
</Row>
|
||||
|
24
src/utils/url.js
Normal file
24
src/utils/url.js
Normal file
@ -0,0 +1,24 @@
|
||||
/* @flow */
|
||||
import urlConstants from 'constants/urls';
|
||||
import type { TrezorDevice } from 'flowtype';
|
||||
|
||||
const getOldWalletUrl = (device: ?TrezorDevice): string => {
|
||||
if (!device) return urlConstants.OLD_WALLET_BETA;
|
||||
const release = device.firmwareRelease;
|
||||
const url = release.channel === 'beta' ? urlConstants.OLD_WALLET_BETA : urlConstants.OLD_WALLET;
|
||||
return url;
|
||||
};
|
||||
|
||||
// TODO: use uri template to build urls
|
||||
const getOldWalletReleaseUrl = (device: ?TrezorDevice): string => {
|
||||
if (!device || !device.firmwareRelease) return urlConstants.OLD_WALLET_BETA;
|
||||
const release = device.firmwareRelease;
|
||||
const url = getOldWalletUrl(device);
|
||||
const version = release.version.join('.');
|
||||
return `${url}?fw=${version}`;
|
||||
};
|
||||
|
||||
export {
|
||||
getOldWalletUrl,
|
||||
getOldWalletReleaseUrl,
|
||||
};
|
@ -1,3 +1,4 @@
|
||||
/* @flow */
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { H1 } from 'components/Heading';
|
||||
@ -7,10 +8,16 @@ import Button from 'components/Button';
|
||||
import P from 'components/Paragraph';
|
||||
import Link from 'components/Link';
|
||||
import ICONS from 'config/icons';
|
||||
import urlConstants from 'constants/urls';
|
||||
import { getOldWalletUrl } from 'utils/url';
|
||||
import Content from 'views/Wallet/components/Content';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import type { TrezorDevice } from 'flowtype';
|
||||
|
||||
type Props = {
|
||||
device: ?TrezorDevice;
|
||||
}
|
||||
|
||||
const Section = styled.section`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -33,7 +40,7 @@ const StyledH1 = styled(H1)`
|
||||
text-align: center;
|
||||
`;
|
||||
|
||||
const DeviceSettings = () => (
|
||||
const DeviceSettings = (props: Props) => (
|
||||
<Content>
|
||||
<Section>
|
||||
<Row>
|
||||
@ -44,7 +51,7 @@ const DeviceSettings = () => (
|
||||
/>
|
||||
<StyledH1>Device settings is under construction</StyledH1>
|
||||
<StyledP>Please use Bitcoin wallet interface to change your device settings</StyledP>
|
||||
<Link href={urlConstants.OLD_WALLET_BETA}>
|
||||
<Link href={getOldWalletUrl(props.device)}>
|
||||
<Button>Take me to the Bitcoin wallet</Button>
|
||||
</Link>
|
||||
</Row>
|
||||
|
@ -3,7 +3,7 @@
|
||||
import React from 'react';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
import urlConstants from 'constants/urls';
|
||||
import { getOldWalletReleaseUrl } from 'utils/url';
|
||||
|
||||
import styled from 'styled-components';
|
||||
import { H1 } from 'components/Heading';
|
||||
@ -50,14 +50,6 @@ const StyledP = styled(P)`
|
||||
text-align: center;
|
||||
`;
|
||||
|
||||
const getFirmwareReleaseLink = (device: ?TrezorDevice): string => {
|
||||
if (!device || !device.firmwareRelease) return urlConstants.OLD_WALLET_BETA;
|
||||
const release = device.firmwareRelease;
|
||||
const url = release.channel === 'beta' ? urlConstants.OLD_WALLET_BETA : urlConstants.OLD_WALLET;
|
||||
const version = release.version.join('.');
|
||||
return `${url}?fw=${version}`;
|
||||
};
|
||||
|
||||
const FirmwareUpdate = (props: Props) => (
|
||||
<Wrapper>
|
||||
<Image>
|
||||
@ -138,7 +130,7 @@ const FirmwareUpdate = (props: Props) => (
|
||||
</Image>
|
||||
<H1>It’s time to update your firmware</H1>
|
||||
<StyledP>Please use Bitcoin wallet interface to update your firmware.</StyledP>
|
||||
<Link href={getFirmwareReleaseLink(props.device)}>
|
||||
<Link href={getOldWalletReleaseUrl(props.device)}>
|
||||
<Button>Take me to the Bitcoin wallet</Button>
|
||||
</Link>
|
||||
{deviceUtils.isDeviceAccessible(props.device) && (
|
||||
|
@ -1,11 +1,18 @@
|
||||
/* @flow */
|
||||
import styled from 'styled-components';
|
||||
import { H1 } from 'components/Heading';
|
||||
import Button from 'components/Button';
|
||||
import urlConstants from 'constants/urls';
|
||||
import { getOldWalletUrl } from 'utils/url';
|
||||
import Paragraph from 'components/Paragraph';
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import type { TrezorDevice } from 'flowtype';
|
||||
|
||||
type Props = {
|
||||
device: ?TrezorDevice;
|
||||
}
|
||||
|
||||
const Wrapper = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -26,12 +33,12 @@ const StyledParagraph = styled(Paragraph)`
|
||||
text-align: center;
|
||||
`;
|
||||
|
||||
const Initialize = () => (
|
||||
const Initialize = (props: Props) => (
|
||||
<Wrapper data-test="Page__device__not__initialized">
|
||||
<Row>
|
||||
<H1>Your device is not initialized</H1>
|
||||
<StyledParagraph>Please use Bitcoin wallet interface to start initialization process</StyledParagraph>
|
||||
<A href={urlConstants.OLD_WALLET_BETA}>
|
||||
<A href={getOldWalletUrl(props.device)}>
|
||||
<Button>Take me to the Bitcoin wallet</Button>
|
||||
</A>
|
||||
</Row>
|
||||
|
@ -1,17 +1,22 @@
|
||||
/* @flow */
|
||||
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { H1 } from 'components/Heading';
|
||||
import P from 'components/Paragraph';
|
||||
import Link from 'components/Link';
|
||||
import { getOldWalletUrl } from 'utils/url';
|
||||
import Button from 'components/Button';
|
||||
import Icon from 'components/Icon';
|
||||
|
||||
import { FONT_SIZE } from 'config/variables';
|
||||
import colors from 'config/colors';
|
||||
import icons from 'config/icons';
|
||||
|
||||
import type { TrezorDevice } from 'flowtype';
|
||||
|
||||
type Props = {
|
||||
device: ?TrezorDevice;
|
||||
}
|
||||
|
||||
const Wrapper = styled.section`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -40,7 +45,7 @@ const Message = styled.div`
|
||||
padding: 0 0 15px 0;
|
||||
`;
|
||||
|
||||
const FirmwareUpdate = () => (
|
||||
const FirmwareUpdate = (props: Props) => (
|
||||
<Wrapper>
|
||||
<Icon
|
||||
size={128}
|
||||
@ -52,7 +57,7 @@ const FirmwareUpdate = () => (
|
||||
<StyledP>If your device is ever lost or damaged, your funds will be lost. Backup your device first, to protect your coins against such events.</StyledP>
|
||||
<P>Please use Bitcoin wallet interface to create a backup.</P>
|
||||
</Message>
|
||||
<Link href="https://wallet.trezor.io?backup=1">
|
||||
<Link href={`${getOldWalletUrl(props.device)}?backup=1`}>
|
||||
<Button>Take me to the Bitcoin wallet</Button>
|
||||
</Link>
|
||||
<StyledNavLink to="/">I’ll do that later.</StyledNavLink>
|
||||
|
@ -738,6 +738,13 @@
|
||||
dependencies:
|
||||
regenerator-runtime "^0.12.0"
|
||||
|
||||
"@babel/runtime@^7.3.1":
|
||||
version "7.3.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.4.tgz#73d12ba819e365fcf7fd152aed56d6df97d21c83"
|
||||
integrity sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g==
|
||||
dependencies:
|
||||
regenerator-runtime "^0.12.0"
|
||||
|
||||
"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2":
|
||||
version "7.2.2"
|
||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907"
|
||||
|
Loading…
Reference in New Issue
Block a user