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

added changelog to InstallBridge + render "cancel" conditionally

This commit is contained in:
Szymon Lesisz 2018-10-05 09:24:36 +02:00
parent 3512c271e2
commit 6addcb6cde
2 changed files with 18 additions and 11 deletions

View File

@ -13,7 +13,7 @@ export type LatestBridge = {
version: Array<number>; version: Array<number>;
directory: string; directory: string;
packages: Array<{ name: string; url: string; signature?: string; preferred: boolean; }>; packages: Array<{ name: string; url: string; signature?: string; preferred: boolean; }>;
changelog: string; changelog: Array<string>;
} }
export type State = { export type State = {
@ -48,7 +48,7 @@ const initialState: State = {
version: [], version: [],
directory: '', directory: '',
packages: [], packages: [],
changelog: '', changelog: [],
}, },
}, },
browserState: {}, browserState: {},

View File

@ -115,6 +115,10 @@ export default class InstallBridge extends Component<Props, State> {
if (!this.state.target) { if (!this.state.target) {
return <Loader text="Loading" size={100} />; return <Loader text="Loading" size={100} />;
} }
const changelog = this.props.transport.bridge.changelog.map(entry => (
<li key={entry}>{entry}</li>
));
const url = `${this.state.uri}${this.state.target.value}`; const url = `${this.state.uri}${this.state.target.value}`;
return ( return (
<InstallBridgeWrapper> <InstallBridgeWrapper>
@ -140,7 +144,8 @@ export default class InstallBridge extends Component<Props, State> {
</Link> </Link>
</DownloadBridgeWrapper> </DownloadBridgeWrapper>
<P> <P>
<LearnMoreText>Learn more about latest version in</LearnMoreText> { changelog }
<LearnMoreText>Learn more about latest versions in</LearnMoreText>
<Link <Link
href="https://github.com/trezor/trezord-go/blob/master/CHANGELOG.md" href="https://github.com/trezor/trezord-go/blob/master/CHANGELOG.md"
target="_blank" target="_blank"
@ -149,14 +154,16 @@ export default class InstallBridge extends Component<Props, State> {
>Changelog >Changelog
</Link> </Link>
</P> </P>
{this.props.transport.type && (
<React.Fragment>
<P> <P>
No, i dont want to upgrade Bridge now, No, i dont want to upgrade Bridge now,
</P> </P>
<P> <P>
Take me <Link href="#/">back to the wallet</Link> Take me <Link href="#/">back to the wallet</Link>
</P> </P>
</React.Fragment>
)}
</InstallBridgeWrapper> </InstallBridgeWrapper>
); );
} }