summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-01 16:42:13 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:56 +0200
commit17ae0a3fafd806a5a533bf1d51a3ac708a8cf978 (patch)
treec3687bd08891ef3698f4773e44a6920856229dfe /src/components
parenteea529f57e3ee39d2f492062688b2848ced0a747 (diff)
Implement room name edit
Diffstat (limited to 'src/components')
-rw-r--r--src/components/modals/TextInputModal.js15
-rw-r--r--src/components/navigation/Navbar.js2
2 files changed, 12 insertions, 5 deletions
diff --git a/src/components/modals/TextInputModal.js b/src/components/modals/TextInputModal.js
index 97986fe2..e4a55372 100644
--- a/src/components/modals/TextInputModal.js
+++ b/src/components/modals/TextInputModal.js
@@ -11,14 +11,20 @@ class TextInputModal extends React.Component {
initialValue: PropTypes.string,
};
+ componentDidUpdate() {
+ if (this.props.initialValue) {
+ this.textInput.value = this.props.initialValue;
+ }
+ }
+
onSubmit() {
- this.props.callback(this.refs.textInput.value);
- this.refs.textInput.value = "";
+ this.props.callback(this.textInput.value);
+ this.textInput.value = "";
}
onCancel() {
this.props.callback(undefined);
- this.refs.textInput.value = "";
+ this.textInput.value = "";
}
render() {
@@ -33,7 +39,8 @@ class TextInputModal extends React.Component {
}}>
<div className="form-group">
<label className="form-control-label">{this.props.label}:</label>
- <input type="text" className="form-control" ref="textInput" value={this.props.initialValue}/>
+ <input type="text" className="form-control"
+ ref={textInput => this.textInput = textInput}/>
</div>
</form>
</Modal>
diff --git a/src/components/navigation/Navbar.js b/src/components/navigation/Navbar.js
index 68fa2ab1..2358e146 100644
--- a/src/components/navigation/Navbar.js
+++ b/src/components/navigation/Navbar.js
@@ -7,7 +7,7 @@ import Logout from "../../containers/auth/Logout";
import ProfileName from "../../containers/auth/ProfileName";
import "./Navbar.css";
-export const NAVBAR_HEIGHT = 62;
+export const NAVBAR_HEIGHT = 60;
export const NavItem = withRouter(props => <NavItemWithoutRoute {...props}/>);
export const LoggedInSection = withRouter(props => <LoggedInSectionWithoutRoute {...props}/>);