diff --git a/client/src/client-only-routes/ShowProfileOrFourOhFour.js b/client/src/client-only-routes/ShowProfileOrFourOhFour.js index 70940fe10b..b8a01477d5 100644 --- a/client/src/client-only-routes/ShowProfileOrFourOhFour.js +++ b/client/src/client-only-routes/ShowProfileOrFourOhFour.js @@ -1,6 +1,5 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { isEmpty } from 'lodash'; @@ -9,7 +8,8 @@ import { userByNameSelector, userProfileFetchStateSelector, fetchProfileForUser, - usernameSelector + usernameSelector, + hardGoTo as navigate } from '../redux'; import FourOhFourPage from '../components/FourOhFour'; import Profile from '../components/profile/Profile'; @@ -19,6 +19,7 @@ const propTypes = { fetchProfileForUser: PropTypes.func.isRequired, isSessionUser: PropTypes.bool, maybeUser: PropTypes.string, + navigate: PropTypes.func.isRequired, requestedUser: PropTypes.shape({ username: PropTypes.string, profileUI: PropTypes.object @@ -43,8 +44,10 @@ const makeMapStateToProps = () => (state, props) => { }; }; -const mapDispatchToProps = dispatch => - bindActionCreators({ fetchProfileForUser }, dispatch); +const mapDispatchToProps = { + fetchProfileForUser, + navigate +}; class ShowProfileOrFourOhFour extends Component { componentDidMount() { @@ -59,7 +62,7 @@ class ShowProfileOrFourOhFour extends Component { return null; } - const { isSessionUser, requestedUser, showLoading } = this.props; + const { isSessionUser, requestedUser, showLoading, navigate } = this.props; if (isEmpty(requestedUser)) { if (showLoading) { // We don't know if /:maybeUser is a user or not, we will show @@ -74,7 +77,13 @@ class ShowProfileOrFourOhFour extends Component { // We have a response from the API, and we have some state in the // store for /:maybeUser, we now handover rendering to the Profile component - return ; + return ( + + ); } } diff --git a/client/src/client-only-routes/ShowSettings.js b/client/src/client-only-routes/ShowSettings.js index 63ffdec2e3..dbc05d52c1 100644 --- a/client/src/client-only-routes/ShowSettings.js +++ b/client/src/client-only-routes/ShowSettings.js @@ -172,7 +172,7 @@ export function ShowSettings(props) {
- + - - -
-
- - -
-
+ + + + View my Portfolio + + + Update my settings + + diff --git a/client/src/components/Intro/intro.css b/client/src/components/Intro/intro.css index 8b8d7949b1..fc39cbbcdc 100644 --- a/client/src/components/Intro/intro.css +++ b/client/src/components/Intro/intro.css @@ -33,17 +33,6 @@ text-align: center; } -#learn-app-wrapper div.btn-group { - display: flex; - justify-items: center; -} - -#learn-app-wrapper .btn-group-wrap { - text-align: center; - display: flex; - justify-content: center; -} - .quote-partial .blockquote { font-size: 1.3rem; border: none; diff --git a/client/src/components/helpers/FullWidthRow.js b/client/src/components/helpers/FullWidthRow.js index c7961717f9..b55d3fdbf0 100644 --- a/client/src/components/helpers/FullWidthRow.js +++ b/client/src/components/helpers/FullWidthRow.js @@ -2,9 +2,9 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Row, Col } from '@freecodecamp/react-bootstrap'; -function FullWidthRow({ children }) { +function FullWidthRow({ children, className }) { return ( - + {children} @@ -14,7 +14,8 @@ function FullWidthRow({ children }) { FullWidthRow.displayName = 'FullWidthRow'; FullWidthRow.propTypes = { - children: PropTypes.any + children: PropTypes.any, + className: PropTypes.string }; export default FullWidthRow; diff --git a/client/src/components/layouts/global.css b/client/src/components/layouts/global.css index 4765b0352a..cf17cea191 100644 --- a/client/src/components/layouts/global.css +++ b/client/src/components/layouts/global.css @@ -240,6 +240,9 @@ fieldset[disabled] .btn-primary.focus { color: inherit; } +.button-group .btn:not(:last-child) { + margin-bottom: 10px; +} strong { color: var(--secondary-color); } diff --git a/client/src/components/profile/Profile.js b/client/src/components/profile/Profile.js index bd5639152b..018ec31d37 100644 --- a/client/src/components/profile/Profile.js +++ b/client/src/components/profile/Profile.js @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; -import { Grid, Row, Col } from '@freecodecamp/react-bootstrap'; +import { Grid, Row, Button } from '@freecodecamp/react-bootstrap'; import Helmet from 'react-helmet'; import Link from '../helpers/Link'; @@ -10,9 +10,11 @@ import HeatMap from './components/HeatMap'; import Certifications from './components/Certifications'; import Portfolio from './components/Portfolio'; import Timeline from './components/TimeLine'; +import { apiLocation } from '../../../config/env.json'; const propTypes = { isSessionUser: PropTypes.bool, + navigate: PropTypes.func.isRequired, user: PropTypes.shape({ profileUI: PropTypes.shape({ isLocked: PropTypes.bool, @@ -152,12 +154,17 @@ function renderProfile(user) { ); } -function Profile({ user, isSessionUser }) { +function Profile({ user, isSessionUser, navigate }) { const { profileUI: { isLocked = true }, username } = user; + const createHandleSignoutClick = navigate => e => { + e.preventDefault(); + return navigate(`${apiLocation}/signout`); + }; + return ( @@ -166,13 +173,21 @@ function Profile({ user, isSessionUser }) { {isSessionUser ? ( - - - - Update my settings - - - + + + Update my settings + + + ) : null} {isLocked ? renderMessage(isSessionUser, username) : null}