-
-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow default metadata fields to be overridden and edited in place (#597
) This allows a user to see the default fields for a new or existing document, choose to "override" the defaults, and revert back to the default at any time.
- Loading branch information
Showing
15 changed files
with
170 additions
and
1,290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Icon from '../Icon'; | ||
import classnames from 'classnames'; | ||
|
||
export default class StaticMetaButton extends Component { | ||
state = { | ||
dropdown: false, | ||
}; | ||
|
||
toggleDropdownState = () => { | ||
this.setState(state => ({ dropdown: !state.dropdown })); | ||
}; | ||
|
||
render() { | ||
const { onEnableField } = this.props; | ||
|
||
const dropdownClasses = classnames('dropdown', { | ||
'showing-dropdown': this.state.dropdown, | ||
}); | ||
|
||
return ( | ||
<div className="meta-buttons"> | ||
<span className={dropdownClasses}> | ||
<a | ||
className="meta-button" | ||
tabIndex="1" | ||
onClick={this.toggleDropdownState} | ||
onBlur={() => this.setState({ dropdown: false })} | ||
> | ||
<Icon name="chevron-down" /> | ||
</a> | ||
<div className="dropdown-wrap"> | ||
<span onMouseDown={() => onEnableField()}> | ||
<Icon name="pencil" /> Override default | ||
</span> | ||
</div> | ||
</span> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
StaticMetaButton.propTypes = { | ||
onEnableField: PropTypes.func.isRequired, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.