From 3e9abbd5fc1c13b2842a57d6c209b46178020a51 Mon Sep 17 00:00:00 2001 From: Linda <lifaythegoblin@googlemail.com> Date: Tue, 11 Sep 2018 17:04:01 -0400 Subject: [PATCH] move class from child to parent NOT WORKING --- src/components/menu-bar/menu-bar.css | 5 +++++ src/components/menu-bar/menu-bar.jsx | 1 + src/components/menu-bar/project-title-input.css | 5 ----- src/components/menu-bar/project-title-input.jsx | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/menu-bar/menu-bar.css b/src/components/menu-bar/menu-bar.css index 67d94725b..ef463ad4c 100644 --- a/src/components/menu-bar/menu-bar.css +++ b/src/components/menu-bar/menu-bar.css @@ -90,6 +90,11 @@ flex: 1; } +.title-field-growable { + flex-grow: 1; + width: 2rem; +} + .file-group { display: flex; flex-direction: row; diff --git a/src/components/menu-bar/menu-bar.jsx b/src/components/menu-bar/menu-bar.jsx index 5c1af68d6..b6313cfa7 100644 --- a/src/components/menu-bar/menu-bar.jsx +++ b/src/components/menu-bar/menu-bar.jsx @@ -399,6 +399,7 @@ class MenuBar extends React.Component { id="title-field" > <ProjectTitleInput + className={classNames(styles.titleFieldGrowable)} onUpdateProjectTitle={this.props.onUpdateProjectTitle} /> </MenuBarItemTooltip> diff --git a/src/components/menu-bar/project-title-input.css b/src/components/menu-bar/project-title-input.css index b1584a374..92a3599a0 100644 --- a/src/components/menu-bar/project-title-input.css +++ b/src/components/menu-bar/project-title-input.css @@ -2,8 +2,6 @@ @import "../../css/units.css"; @import "../../css/z-index.css"; -$title-width: 12rem; - .title-field { border: 1px dashed $ui-black-transparent; border-radius: $form-radius; @@ -12,11 +10,8 @@ $title-width: 12rem; background-color: $ui-white-transparent; background-clip: padding-box; -webkit-background-clip: padding-box; - width: $title-width; height: auto; padding: .5rem; - flex-grow: 1; - width: 2rem; } .title-field { diff --git a/src/components/menu-bar/project-title-input.jsx b/src/components/menu-bar/project-title-input.jsx index 8b927417f..b9b5aa6d8 100644 --- a/src/components/menu-bar/project-title-input.jsx +++ b/src/components/menu-bar/project-title-input.jsx @@ -36,7 +36,7 @@ class ProjectTitleInput extends React.Component { render () { return ( <BufferedInput - className={classNames(styles.titleField)} + className={classNames(styles.titleField, this.props.className)} maxLength="100" placeholder={this.props.intl.formatMessage(messages.projectTitlePlaceholder)} tabIndex="0" @@ -49,6 +49,7 @@ class ProjectTitleInput extends React.Component { } ProjectTitleInput.propTypes = { + className: PropTypes.string, intl: intlShape.isRequired, onUpdateProjectTitle: PropTypes.func, projectTitle: PropTypes.string -- GitLab