From 40359c5c73cf00d795473e3960f1fd979bae719e Mon Sep 17 00:00:00 2001 From: zmagod Date: Fri, 15 Sep 2017 16:34:05 +0200 Subject: [PATCH] fixed edit name modal --- .../team/SettingsTeamPageContainer.jsx | 56 ++++++++++++------- .../team/components/UpdateTeamNameModal.jsx | 6 +- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/app/javascript/packs/src/settings/components/team/SettingsTeamPageContainer.jsx b/app/javascript/packs/src/settings/components/team/SettingsTeamPageContainer.jsx index 71bf218fc..e54e8f08c 100644 --- a/app/javascript/packs/src/settings/components/team/SettingsTeamPageContainer.jsx +++ b/app/javascript/packs/src/settings/components/team/SettingsTeamPageContainer.jsx @@ -9,10 +9,7 @@ import prettysize from "prettysize"; import axios from "../../../../app/axios"; import { TEAM_DETAILS_PATH, SETTINGS_TEAMS } from "../../../../app/routes"; -import { - BORDER_LIGHT_COLOR, - COLOR_CONCRETE -} from "../../../../app/constants/colors"; +import { BORDER_LIGHT_COLOR } from "../../../../app/constants/colors"; import TeamsMembers from "./components/TeamsMembers"; import UpdateTeamDescriptionModal from "./components/UpdateTeamDescriptionModal"; @@ -38,6 +35,16 @@ const BadgeWrapper = styled.div` `; const StyledWell = styled(Well)` + padding: 9px; + & > span { + padding-left: 5px; + }`; + +const StyledDescriptionWell = styled(Well)` + padding: 9px; + & > span { + padding-left: 5px; + } &:hover { text-decoration: underline; cursor: pointer; @@ -77,6 +84,7 @@ class SettingsTeamPageContainer extends Component { this.updateUsersCallback = this.updateUsersCallback.bind(this); this.showNameModal = this.showNameModal.bind(this); this.hideNameModalCallback = this.hideNameModalCallback.bind(this); + this.renderEditNameModel = this.renderEditNameModel.bind(this); } componentDidMount() { @@ -121,6 +129,19 @@ class SettingsTeamPageContainer extends Component { ); } + renderEditNameModel() { + if (this.state.showNameModal) { + return( + + ); + } + } + render() { return ( @@ -144,7 +165,7 @@ class SettingsTeamPageContainer extends Component { - + - + - + - + - + - + @@ -185,9 +206,11 @@ class SettingsTeamPageContainer extends Component { - - {this.renderDescription()} - + + + {this.renderDescription()} + + - + {this.renderEditNameModel()} ); } diff --git a/app/javascript/packs/src/settings/components/team/components/UpdateTeamNameModal.jsx b/app/javascript/packs/src/settings/components/team/components/UpdateTeamNameModal.jsx index 0be8539e0..6452a900b 100644 --- a/app/javascript/packs/src/settings/components/team/components/UpdateTeamNameModal.jsx +++ b/app/javascript/packs/src/settings/components/team/components/UpdateTeamNameModal.jsx @@ -24,17 +24,13 @@ const StyledHelpBlock = styled(HelpBlock)` class UpdateTeamNameModal extends Component { constructor(props) { super(props); - this.state = { errorMessage: "", name: "" }; + this.state = { errorMessage: "", name: props.team.name}; this.onCloseModal = this.onCloseModal.bind(this); this.updateName = this.updateName.bind(this); this.handleName = this.handleName.bind(this); this.getValidationState = this.getValidationState.bind(this); } - componentDidMount() { - this.setState({ name: this.props.team.name }); - } - onCloseModal() { this.setState({ errorMessage: "", name: "" }); this.props.hideModal();