Skip to content

Commit

Permalink
fix problem with loading poisition + hide/show profiile
Browse files Browse the repository at this point in the history
fix problem with loading poisition + hide/show profiile
  • Loading branch information
suppermancool committed Apr 17, 2020
1 parent f878f10 commit 33e7d71
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
30 changes: 20 additions & 10 deletions src/projects/create/components/FillProjectDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,15 @@ class FillProjectDetails extends Component {
}

closeUserSettings() {
this.setState({ showUpdateUser: false })
const { isMissingUserInfo } = this.props
this.setState({
showUpdateUser: false,
... (
isMissingUserInfo ? {
requireCheckUserSetting: false
} : {}
)
})
}

onRequireCheckUserSetting(isRequire, cb) {
Expand Down Expand Up @@ -139,7 +147,9 @@ class FillProjectDetails extends Component {
const projectTemplateId = _.get(project, 'templateId')
const projectTemplate = _.find(projectTemplates, { id: projectTemplateId })
const formDisclaimer = _.get(projectTemplate, 'scope.formDisclaimer')

const showLoading = (isSavingProject ||
profileSettings.isLoading ||
profileSettings.pending)
const template = projectTemplate.scope

let header = null
Expand Down Expand Up @@ -176,13 +186,15 @@ class FillProjectDetails extends Component {
})}
>
{showUpdateUser && (
<UpdateUserInfo
{...this.props}
closeUserSettings={this.closeUserSettings}
/>
<div className={`${showLoading ? 'hide': ''}`}>
<UpdateUserInfo
{...this.props}
closeUserSettings={this.closeUserSettings}
/>
</div>
)}

<div className={`FillProjectDetails ${showUpdateUser ? 'hide' : ''}`}>
<div className={`FillProjectDetails ${(showUpdateUser || showLoading) ? 'hide' : ''}`}>
<div className="header">{header}</div>
<section className="two-col-content content">
<div className="container">
Expand Down Expand Up @@ -225,9 +237,7 @@ class FillProjectDetails extends Component {
</section>
</div>

{(isSavingProject ||
profileSettings.isLoading ||
profileSettings.pending) && (
{showLoading && (
<div className="loading-container">
<div className="loading">
<LoadingIndicator />
Expand Down
4 changes: 2 additions & 2 deletions src/projects/create/components/FillProjectDetails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
.FillProjectDetailsWrapper {
// @extend .wizardWrapper;
position: relative;
min-height: 85px;

&.form-theme-light {
.FillProjectDetails {
Expand All @@ -38,13 +39,12 @@
display: flex;
justify-content: center;
align-items: center;
padding-top: 20px;
}
}

.FillProjectDetails {

&.hide {
.hide {
display: none;
}

Expand Down
4 changes: 3 additions & 1 deletion src/projects/create/components/UpdateUserInfo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
}

.user-container {
padding: 20px 50px 50px;
padding: 20px 0;
display: flex;
flex-direction: column;
align-items: center;
margin-top: -67px;
max-width: 760px;
margin: 0 auto;

> * {
width: 100%;
Expand Down

0 comments on commit 33e7d71

Please sign in to comment.