From f12460e83ac2fc1cdede65b69e72a199c6ca3f29 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sun, 7 Oct 2018 15:55:01 +0100 Subject: [PATCH] display connected email on About page (#327) * display connected email on About page * add mailing preferences link --- app/src/page/about/index.js | 12 ++++++++++-- app/src/page/about/view.js | 25 ++++++++++++++++++------- app/src/styles/about.js | 18 ++++++++++++++++++ 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/app/src/page/about/index.js b/app/src/page/about/index.js index 56c57f9..e389db2 100644 --- a/app/src/page/about/index.js +++ b/app/src/page/about/index.js @@ -1,6 +1,14 @@ import { connect } from 'react-redux'; +import { doFetchAccessToken, selectAccessToken, selectUserEmail } from 'lbryinc'; import AboutPage from './view'; -const perform = dispatch => ({}); +const select = state => ({ + accessToken: selectAccessToken(state), + userEmail: selectUserEmail(state), +}); -export default connect(null, perform)(AboutPage); \ No newline at end of file +const perform = dispatch => ({ + fetchAccessToken: () => dispatch(doFetchAccessToken()), +}); + +export default connect(select, perform)(AboutPage); \ No newline at end of file diff --git a/app/src/page/about/view.js b/app/src/page/about/view.js index 45f4145..587284a 100644 --- a/app/src/page/about/view.js +++ b/app/src/page/about/view.js @@ -28,10 +28,12 @@ class AboutPage extends React.PureComponent { lbryId: info.installation_id, }); }); + + if (!this.props.accessToken) this.props.fetchAccessToken(); } render() { - const { navigation } = this.props; + const { accessToken, navigation, userEmail } = this.props; const loading = 'Loading...'; const ver = this.state.versionInfo ? this.state.versionInfo : null; @@ -63,7 +65,21 @@ class AboutPage extends React.PureComponent { - Release information + App info + {userEmail && userEmail.trim().length > 0 && + + + Connected Email + {userEmail} + + + + + } + App version {this.state.appVersion} @@ -74,11 +90,6 @@ class AboutPage extends React.PureComponent { {ver ? ver.lbrynet_version : loading } - - Wallet (lbryum) - {ver ? ver.lbryum_version : loading } - - Platform {ver ? ver.platform : loading } diff --git a/app/src/styles/about.js b/app/src/styles/about.js index 399f442..784bb72 100644 --- a/app/src/styles/about.js +++ b/app/src/styles/about.js @@ -16,6 +16,18 @@ const aboutStyle = StyleSheet.create({ flexDirection: 'row', justifyContent: 'space-between' }, + innerRow: { + marginBottom: 4, + flex: 1, + flexDirection: 'row', + justifyContent: 'space-between' + }, + verticalRow: { + marginBottom: 1, + backgroundColor: '#f9f9f9', + padding: 16, + flex: 1 + }, title: { color: Colors.LbryGreen, fontSize: 24, @@ -44,6 +56,12 @@ const aboutStyle = StyleSheet.create({ fontSize: 16, marginBottom: 24 }, + emailPreferencesLink: { + color: Colors.LbryGreen, + fontFamily: 'Metropolis-Regular', + fontSize: 15, + alignSelf: 'flex-end' + }, col: { alignSelf: 'stretch' },