Skip to content

Commit 6bda429

Browse files
author
jonisaa
committed
#2 Updating styles on FileInfo
1 parent bbab54c commit 6bda429

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/components/common/FileInfo.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,31 @@ export default class FileUploadItem extends Component {
1818
render() {
1919
let { file, height, width } = this.props;
2020

21+
const imgStyle = {
22+
display: 'block',
23+
marginLeft: 'auto',
24+
marginRight: 'auto'
25+
};
26+
2127
let image = null;
2228

2329
if (file.type.match(/image/)) {
24-
image = <img height={height} width={width} src={file.preview}/>;
30+
image = <img height={height} width={width} src={file.preview} style={imgStyle}/>;
2531
}
2632

2733
return (
2834
<Col xs={4} md={4}>
29-
{image}
30-
<p>{file.name}</p>
31-
<p>{filesize(file.size)}</p>
35+
<div style={{backgroundColor: "#e0e0e0"}}>
36+
<div>
37+
{image}
38+
</div>
39+
<div>
40+
<p style={{textAlign: 'center'}}>
41+
<a>{file.name}</a>
42+
</p>
43+
<p style={{textAlign: 'right'}}>{filesize(file.size)}</p>
44+
</div>
45+
</div>
3246
</Col>
3347
);
3448
}

0 commit comments

Comments
 (0)