Browse Source

Show version and release notes in about

master
Thibaut Boustany 7 years ago
parent
commit
c92030af03
No known key found for this signature in database GPG Key ID: 32475B11A2B13EEC
  1. 29
      src/components/SettingsPage/sections/About.js

29
src/components/SettingsPage/sections/About.js

@ -2,11 +2,16 @@
import React, { PureComponent } from 'react'
import { shell } from 'electron'
import { connect } from 'react-redux'
import type { T } from 'types/common'
import IconHelp from 'icons/Help'
import IconExternalLink from 'icons/ExternalLink'
import Button from 'components/base/Button'
import { openModal } from 'reducers/modals'
import { MODAL_RELEASES_NOTES } from 'config/constants'
import {
SettingsSection as Section,
@ -17,13 +22,20 @@ import {
type Props = {
t: T,
openModal: Function,
}
const mapDispatchToProps = {
openModal,
}
class SectionAbout extends PureComponent<Props> {
handleOpenLink = (url: string) => () => shell.openExternal(url)
render() {
const { t } = this.props
const { t, openModal } = this.props
const version = __APP_VERSION__
return (
<Section>
<Header
@ -32,6 +44,16 @@ class SectionAbout extends PureComponent<Props> {
desc="Lorem ipsum dolor sit amet"
/>
<Body>
<Row title="Version" desc={version}>
<Button
primary
onClick={() => {
openModal(MODAL_RELEASES_NOTES, version)
}}
>
Show release notes
</Button>
</Row>
<Row
onClick={this.handleOpenLink('https://support.ledgerwallet.com/hc/en-us')}
title={t('settings:about.faq')}
@ -59,4 +81,7 @@ class SectionAbout extends PureComponent<Props> {
}
}
export default SectionAbout
export default connect(
null,
mapDispatchToProps,
)(SectionAbout)

Loading…
Cancel
Save