1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

added change log and pgp signature to InstallBridge

This commit is contained in:
Szymon Lesisz 2018-10-05 09:46:11 +02:00
parent be34d85fdd
commit 796db24890
2 changed files with 20 additions and 5 deletions

View File

@ -1,10 +1,13 @@
/* @flow */ /* @flow */
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as RouterActions from 'actions/RouterActions';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux'; import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import type { State, Dispatch } from 'flowtype'; import type { State, Dispatch } from 'flowtype';
import LandingPage from './index'; import LandingPage from './index';
export type StateProps = { export type StateProps = {
localStorage: $ElementType<State, 'localStorage'>, localStorage: $ElementType<State, 'localStorage'>,
modal: $ElementType<State, 'modal'>, modal: $ElementType<State, 'modal'>,
@ -34,8 +37,8 @@ const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: St
devices: state.devices, devices: state.devices,
}); });
const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps> = (/* dispatch: Dispatch */): DispatchProps => ({ const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps> = (dispatch: Dispatch): DispatchProps => ({
selectFirstAvailableDevice: bindActionCreators(RouterActions.selectFirstAvailableDevice, dispatch),
}); });
export default connect(mapStateToProps, mapDispatchToProps)(LandingPage); export default connect(mapStateToProps, mapDispatchToProps)(LandingPage);

View File

@ -109,14 +109,15 @@ export default class InstallBridge extends Component<Props, State> {
} }
render() { render() {
if (!this.state.target) { const { target } = this.state;
if (!target) {
return <Loader text="Loading" size={100} />; return <Loader text="Loading" size={100} />;
} }
const changelog = this.props.transport.bridge.changelog.map(entry => ( const changelog = this.props.transport.bridge.changelog.map(entry => (
<li key={entry}>{entry}</li> <li key={entry}>{entry}</li>
)); ));
const url = `${this.state.uri}${this.state.target.value}`; const url = `${this.state.uri}${target.value}`;
return ( return (
<InstallBridgeWrapper> <InstallBridgeWrapper>
<TitleHeader>TREZOR Bridge.<BridgeVersion>{this.state.currentVersion}</BridgeVersion></TitleHeader> <TitleHeader>TREZOR Bridge.<BridgeVersion>{this.state.currentVersion}</BridgeVersion></TitleHeader>
@ -125,7 +126,7 @@ export default class InstallBridge extends Component<Props, State> {
<SelectWrapper <SelectWrapper
isSearchable={false} isSearchable={false}
isClearable={false} isClearable={false}
value={this.state.target} value={target}
onChange={v => this.onChange(v)} onChange={v => this.onChange(v)}
options={this.state.installers} options={this.state.installers}
/> />
@ -140,6 +141,17 @@ export default class InstallBridge extends Component<Props, State> {
</DownloadBridgeButton> </DownloadBridgeButton>
</Link> </Link>
</DownloadBridgeWrapper> </DownloadBridgeWrapper>
{target.signature && (
<P>
<Link
href={this.state.uri + target.signature}
target="_blank"
rel="noreferrer noopener"
isGreen
>Check PGP signature
</Link>
</P>
)}
<P> <P>
{ changelog } { changelog }
<LearnMoreText>Learn more about latest versions in</LearnMoreText> <LearnMoreText>Learn more about latest versions in</LearnMoreText>