Skip to content

Commit

Permalink
fix a couple small bugs with drag + drop plus graphic components
Browse files Browse the repository at this point in the history
  • Loading branch information
mathisonian committed Mar 19, 2021
1 parent aaa0cc3 commit b872f0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/render/idyll-display/components/author-tool-buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AuthorToolButtons extends React.PureComponent {
)}
</div>
<div className='author-view-container' id={this.domId} onMouseEnter={() => this.setState({ isHovering: true })} onMouseLeave={() => this.setState({ isHovering: false })}>
<button
{idyllASTNode.name.toLowerCase() === 'graphic' ? null : <button
className={`author-view-button`}
onClick={this.handleClickProps.bind(this)}
data-tip
Expand All @@ -90,7 +90,7 @@ class AuthorToolButtons extends React.PureComponent {
fill='white'
/>
</svg>
</button>
</button>}
</div>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion src/render/idyll-display/components/drop-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const withDropListener = (callback) => {
var tagInfo = this.context.propsMap.get(name.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('')) || { name: name };
var tagName = (tagInfo ? (tagInfo.name || name) : name).split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('')


var tag = '[' + tagName + ' ';
if (tagInfo.props !== undefined) {
tagInfo.props
Expand Down
7 changes: 4 additions & 3 deletions src/render/idyll-display/components/text-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ class TextEdit extends React.PureComponent {
}

getTag(name) {
var tagInfo = this.context.propsMap.get(name);
var tagInfo = this.context.propsMap.get(name.split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('')) || { name: name };
var tagName = (tagInfo ? (tagInfo.name || name) : name).split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('')

var tag = '[' + tagInfo.name + ' ';
var tag = '[' + tagName + ' ';
if (tagInfo.props !== undefined) {
tagInfo.props.filter(prop => prop.example !== undefined).forEach((prop) => {
tag += prop.name + ':' + prop.example + ' ';
Expand All @@ -78,7 +79,7 @@ class TextEdit extends React.PureComponent {
tag += ' /]';
} else {
var children = tagInfo.children !== undefined ? tagInfo.children[0] : '';
tag += ']' + children + '[/' + tagInfo.name + ']';
tag += ']' + children + '[/' + tagName + ']';
}

return tag;
Expand Down

0 comments on commit b872f0a

Please sign in to comment.