From 05176b8bd247d0d94fa0dfc8ed0926c65e92ea5b Mon Sep 17 00:00:00 2001 From: Stuart Taylor Date: Mon, 28 May 2018 22:02:41 +0100 Subject: [PATCH] feat(user-data): Add a 'download data' button to privacy section (#17252) Closes #17123 --- .../Settings/components/Privacy-Settings.jsx | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/common/app/routes/Settings/components/Privacy-Settings.jsx b/common/app/routes/Settings/components/Privacy-Settings.jsx index 0dae1d4fa1..96b038c541 100644 --- a/common/app/routes/Settings/components/Privacy-Settings.jsx +++ b/common/app/routes/Settings/components/Privacy-Settings.jsx @@ -3,20 +3,20 @@ import PropTypes from 'prop-types'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; +import { Button } from 'react-bootstrap'; import { updateMyProfileUI } from '../redux'; import { userSelector } from '../../../redux'; -import { FullWidthRow } from '../../../helperComponents'; +import { FullWidthRow, Spacer } from '../../../helperComponents'; import SectionHeader from './SectionHeader.jsx'; import ToggleSetting from './ToggleSetting.jsx'; const mapStateToProps = createSelector( userSelector, - ({ - profileUI = {} - }) => ({ - ...profileUI + user => ({ + ...user.profileUI, + user }) ); @@ -33,7 +33,8 @@ const propTypes = { showPoints: PropTypes.bool, showPortfolio: PropTypes.bool, showTimeLine: PropTypes.bool, - updateMyProfileUI: PropTypes.func.isRequired + updateMyProfileUI: PropTypes.func.isRequired, + user: PropTypes.object }; function PrivacySettings(props) { @@ -47,7 +48,8 @@ function PrivacySettings(props) { showPoints, showPortfolio, showTimeLine, - updateMyProfileUI + updateMyProfileUI, + user } = props; const toggleFlag = flag => () => updateMyProfileUI({ profileUI: { [flag]: !props[flag] } }); @@ -56,9 +58,10 @@ function PrivacySettings(props) { Privacy Settings

- The settings in this section enable you to control what is show on{' '} + The settings in this section enable you to control what is shown on{' '} your freeCodeCamp public portfolio.

+

There is also a button to see what data we hold on your account

+ + + + ); }