Skip to content

Commit d7bb3ee

Browse files
author
Benjamin Kniffler
committed
Outsource some styling to css
1 parent a2bfb50 commit d7bb3ee

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

draft-js-dnd-plugin/src/Image/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class Image extends Component {
5555
data-offset-key={ `${block.get('key')}-0-0` }
5656
onDragStart={onDragStart} draggable={draggable}
5757
>
58-
<img src={blockProps.src || (`/images ${blockProps.url}`)} width="100%" height="auto" className={ theme.get('image') } />
59-
{blockProps.progress >= 0 ? <div style={{ position: 'absolute', width: `${100 - blockProps.progress}%`, right: 0, top: 0, height: '100%', backgroundColor: 'white' }} /> : null}
58+
<img src={blockProps.src || blockProps.url} width="100%" height="auto" className={ theme.get('image') } />
59+
{blockProps.progress >= 0 ? <div className={theme.get('imageLoader')} style={{ width: `${100 - blockProps.progress}%` }} /> : null}
6060
{ attachButtons ? buttons : null }
6161
</figure>
6262
);

draft-js-dnd-plugin/src/imageStyles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,11 @@
4646

4747
.image {
4848
}
49+
50+
.imageLoader{
51+
position: absolute;
52+
right: 0;
53+
top: 0;
54+
height: 100%;
55+
background-color: white;
56+
}

draft-js-dnd-plugin/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const defaultTheme = Map({
1313
imageWrapper: imageStyles.imageWrapper,
1414
image: imageStyles.image,
1515
imageButton: imageStyles.imageButton,
16+
imageLoader: imageStyles.imageLoader,
1617

1718
// This is for block-alignment-wrapper, only temporarily living here
1819
left: imageStyles.left,

0 commit comments

Comments
 (0)