diff --git a/client/components/Dropdown.jsx b/client/components/Dropdown.jsx index 5ca33ab1..bd2169b8 100644 --- a/client/components/Dropdown.jsx +++ b/client/components/Dropdown.jsx @@ -16,6 +16,9 @@ const DropdownWrapper = styled.ul` right: ${props => (props.right ? 0 : 'initial')}; left: ${props => (props.left ? 0 : 'initial')}; + ${props => (props.align === 'right' && 'right: 0;')} + ${props => (props.align === 'left' && 'left: 0;')} + text-align: left; width: ${remSize(180)}; @@ -57,8 +60,8 @@ const DropdownWrapper = styled.ul` // TODO: Add Icon to the left of the items in the menu // const MaybeIcon = (Element, label) => Element && ; -const Dropdown = ({ items, right, left }) => ( - +const Dropdown = ({ items, align }) => ( + {/* className="nav__items-left" */} {items && items.map(({ title, icon, href }) => (
  • @@ -73,8 +76,7 @@ const Dropdown = ({ items, right, left }) => ( ); Dropdown.propTypes = { - right: PropTypes.bool, - left: PropTypes.bool, + align: PropTypes.oneOf(['left', 'right']), items: PropTypes.arrayOf(PropTypes.shape({ action: PropTypes.func, icon: PropTypes.func, @@ -84,8 +86,7 @@ Dropdown.propTypes = { Dropdown.defaultProps = { items: [], - right: false, - left: false, + align: null }; export default Dropdown; diff --git a/client/components/Nav.jsx b/client/components/Nav.jsx index 4c27d6fa..16617112 100644 --- a/client/components/Nav.jsx +++ b/client/components/Nav.jsx @@ -100,11 +100,11 @@ class Nav extends React.PureComponent { const { unsavedChanges, warnIfUnsavedChanges } = this.props; if (!unsavedChanges) { this.props.showToast(1500); - this.props.setToastText('Opened new sketch.'); + this.props.setToastText('Toast.OpenedNewSketch'); this.props.newProject(); } else if (warnIfUnsavedChanges && warnIfUnsavedChanges()) { this.props.showToast(1500); - this.props.setToastText('Opened new sketch.'); + this.props.setToastText('Toast.OpenedNewSketch'); this.props.newProject(); } this.setDropdown('none'); @@ -172,7 +172,7 @@ class Nav extends React.PureComponent { handleLangSelection(event) { i18next.changeLanguage(event.target.value); this.props.showToast(1500); - this.props.setToastText('LangChange'); + this.props.setToastText('Toast.LangChange'); this.setDropdown('none'); } @@ -240,13 +240,13 @@ class Nav extends React.PureComponent { return (
    • - +
    • @@ -258,7 +258,7 @@ class Nav extends React.PureComponent { return (
      • - +
        • @@ -281,7 +281,7 @@ class Nav extends React.PureComponent { onFocus={this.handleFocusForFile} onBlur={this.handleBlur} > - {this.props.t('New')} + {this.props.t('Nav.File.New')} { getConfig('LOGIN_ENABLED') && (!this.props.project.owner || this.isUserOwner()) && @@ -291,7 +291,7 @@ class Nav extends React.PureComponent { onFocus={this.handleFocusForFile} onBlur={this.handleBlur} > - {this.props.t('Save')} + {this.props.t('Common.Save')} {metaKeyName}+S } @@ -302,7 +302,7 @@ class Nav extends React.PureComponent { onFocus={this.handleFocusForFile} onBlur={this.handleBlur} > - {this.props.t('Duplicate')} + {this.props.t('Nav.File.Duplicate')} } { this.props.project.id && @@ -312,7 +312,7 @@ class Nav extends React.PureComponent { onFocus={this.handleFocusForFile} onBlur={this.handleBlur} > - {this.props.t('Share')} + {this.props.t('Nav.File.Share')} } { this.props.project.id && @@ -322,7 +322,7 @@ class Nav extends React.PureComponent { onFocus={this.handleFocusForFile} onBlur={this.handleBlur} > - {this.props.t('Download')} + {this.props.t('Nav.File.Download')} } { this.props.user.authenticated && @@ -333,7 +333,7 @@ class Nav extends React.PureComponent { onBlur={this.handleBlur} onClick={this.setDropdownForNone} > - {this.props.t('Open')} + {this.props.t('Nav.File.Open')} } {getConfig('UI_COLLECTIONS_ENABLED') && @@ -346,7 +346,7 @@ class Nav extends React.PureComponent { onBlur={this.handleBlur} onClick={this.setDropdownForNone} > - {this.props.t('AddToCollection')} + {this.props.t('Nav.File.AddToCollection')} } { getConfig('EXAMPLES_ENABLED') && @@ -357,7 +357,7 @@ class Nav extends React.PureComponent { onBlur={this.handleBlur} onClick={this.setDropdownForNone} > - {this.props.t('Examples')} + {this.props.t('Nav.File.Examples')} }
        @@ -373,7 +373,7 @@ class Nav extends React.PureComponent { } }} > - {this.props.t('Edit')} + {this.props.t('Nav.Edit.Title')}