From 8e5275ca567e5011f0a3c7d5d71567c8950c44b5 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Fri, 12 Jan 2018 16:57:26 -0800 Subject: [PATCH] fix(Settings): Always use ChildContainer othersize content is rendered off screen --- .../app/routes/Settings/Settings-Skeleton.jsx | 2 +- common/app/routes/Settings/Settings.jsx | 341 +++++++++--------- common/app/routes/Settings/Show.jsx | 38 ++ common/app/routes/Settings/settings.less | 3 + 4 files changed, 207 insertions(+), 177 deletions(-) create mode 100644 common/app/routes/Settings/Show.jsx diff --git a/common/app/routes/Settings/Settings-Skeleton.jsx b/common/app/routes/Settings/Settings-Skeleton.jsx index f05797a826..c50223ddde 100644 --- a/common/app/routes/Settings/Settings-Skeleton.jsx +++ b/common/app/routes/Settings/Settings-Skeleton.jsx @@ -19,7 +19,7 @@ const shortString = ( export default function SettingsSkeleton() { return ( -
+
- - - - -

Settings for your Account

-

Actions

- - - - - - - - - - -
-

Account Settings

- - - - - -
-

Privacy Settings

- - + + + + - - - + Edit my pledge + + + +
+

Privacy Settings

+ + + + + +
+

Job Search Settings

+ + + + + +
+

Email Settings

+ + + + + +
+

Display challenges in:

+ + + + + +
+

Danger Zone

+ + + + + +
- ); } } diff --git a/common/app/routes/Settings/Show.jsx b/common/app/routes/Settings/Show.jsx new file mode 100644 index 0000000000..7778df01b2 --- /dev/null +++ b/common/app/routes/Settings/Show.jsx @@ -0,0 +1,38 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { connect } from 'react-redux'; + +import ns from './ns.json'; +import { showUpdateEmailViewSelector } from './redux'; +import Settings from './Settings.jsx'; +import UpdateEmail from './routes/update-email'; +import ChildContainer from '../../Child-Container.jsx'; + +const mapStateToProps = state => ({ + showUpdateEmailView: showUpdateEmailViewSelector(state) +}); +const mapDispatchToProps = null; +const propTypes = { + showUpdateEmailView: PropTypes.bool +}; + +export function ShowSettings({ showUpdateEmailView }) { + let Comp = Settings; + if (showUpdateEmailView) { + Comp = UpdateEmail; + } + return ( + +
+ +
+
+ ); +} +ShowSettings.displayName = 'ShowSettings'; +ShowSettings.propTypes = propTypes; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(ShowSettings); diff --git a/common/app/routes/Settings/settings.less b/common/app/routes/Settings/settings.less index 7be26e4713..cf021ebc08 100644 --- a/common/app/routes/Settings/settings.less +++ b/common/app/routes/Settings/settings.less @@ -15,6 +15,9 @@ } } +.@{ns}-container { + .center(@value: @container-xl, @padding: @grid-gutter-width); +} .@{ns}-skeleton { background-color: #fff; z-index: 10;