-
Notifications
You must be signed in to change notification settings - Fork 617
Expand file tree
/
Copy pathblock.js
More file actions
29 lines (25 loc) · 845 Bytes
/
block.js
File metadata and controls
29 lines (25 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from 'react';
import { truncate } from 'lodash';
// Components
import { SlideLeftLink } from '../../../components/links';
import EditIcon from '../../../components/icons/edit';
const Block = ({ image, text, handleComponent, editPath, ...props }) => {
const Handle = handleComponent;
return (
<div className="editor-list-item">
<SlideLeftLink to={editPath}>
{image && (
<div className="editor-list-item--image" style={{ backgroundImage: `url("${image}")` }}>
</div>
)}
</SlideLeftLink>
<SlideLeftLink to={editPath} className="editor-list-item--label">
{truncate(text || props.blockDefinition.name, { length: 32 })}
</SlideLeftLink>
<div className="editor-list-item--actions">
<Handle />
</div>
</div>
)
}
export default Block;