Skip to content

Commit

Permalink
TASK: cleanup the new view component
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaip committed Mar 17, 2018
1 parent 896af49 commit da8e3f4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 47 deletions.
41 changes: 19 additions & 22 deletions Resources/Private/JavaScript/AnchorView/src/AnchorView.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {$get} from 'plow-js';
@connect(state => ({
documentNode: selectors.UI.ContentCanvas.documentNodeSelector(state),
focusedNode: selectors.CR.Nodes.focusedSelector(state),
transientSectionId: $get(['sectionId', 'value'], selectors.UI.Inspector.transientValues(state))
transientSectionId: $get('sectionId.value', selectors.UI.Inspector.transientValues(state))
}))
export default class AnchorView extends Component {
static propTypes = {
Expand Down Expand Up @@ -38,27 +38,24 @@ export default class AnchorView extends Component {

render() {
return this.getSetionId() && (
<div class="neos-inspector-field">
<Button style="brand" onClick={this.copyToClipboard}>
<I18n
id={`Flownative.Anchorlinks:Main:${this.state.isCopied ? 'copied' : 'copy'}`}
fallback="Copy link"
/>
&nbsp;
<div style={{
display: 'inline-block',
width: '16px',
height: '16px',
fill: 'white',
marginLeft: '3px',
verticalAlign: 'sub'
}}>
<svg viewBox="0 0 896 1024" width="100%" xmlns="http://www.w3.org/2000/svg">
<path d="M128 768h256v64H128v-64z m320-384H128v64h320v-64z m128 192V448L384 640l192 192V704h320V576H576z m-288-64H128v64h160v-64zM128 704h160v-64H128v64z m576 64h64v128c-1 18-7 33-19 45s-27 18-45 19H64c-35 0-64-29-64-64V192c0-35 29-64 64-64h192C256 57 313 0 384 0s128 57 128 128h192c35 0 64 29 64 64v320h-64V320H64v576h640V768zM128 256h512c0-35-29-64-64-64h-64c-35 0-64-29-64-64s-29-64-64-64-64 29-64 64-29 64-64 64h-64c-35 0-64 29-64 64z" />
</svg>
</div>
</Button>
</div>
<Button style="brand" onClick={this.copyToClipboard}>
<I18n
id={`Flownative.Anchorlinks:Main:${this.state.isCopied ? 'copied' : 'copy'}`}
fallback="Copy link"
/>
<div style={{
display: 'inline-block',
width: '16px',
height: '16px',
fill: 'white',
marginLeft: '3px',
verticalAlign: 'sub'
}}>
<svg viewBox="0 0 896 1024" width="100%" xmlns="http://www.w3.org/2000/svg">
<path d="M128 768h256v64H128v-64z m320-384H128v64h320v-64z m128 192V448L384 640l192 192V704h320V576H576z m-288-64H128v64h160v-64zM128 704h160v-64H128v64z m576 64h64v128c-1 18-7 33-19 45s-27 18-45 19H64c-35 0-64-29-64-64V192c0-35 29-64 64-64h192C256 57 313 0 384 0s128 57 128 128h192c35 0 64 29 64 64v320h-64V320H64v576h640V768zM128 256h512c0-35-29-64-64-64h-64c-35 0-64-29-64-64s-29-64-64-64-64 29-64 64-29 64-64 64h-64c-35 0-64 29-64 64z" />
</svg>
</div>
</Button>
);
}
}
43 changes: 19 additions & 24 deletions Resources/Public/JavaScript/AnchorView/Plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit da8e3f4

Please sign in to comment.