Initial commit
This commit is contained in:
36
src/common/pages/EmptyState/index.js
Normal file
36
src/common/pages/EmptyState/index.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import React from 'react';
|
||||
|
||||
import './style.scss';
|
||||
|
||||
export default class EmptyStateComponent extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.props = props;
|
||||
this.state = {
|
||||
uniqId: (this.props.key) ? this.props.key : (new Date).getTime()
|
||||
};
|
||||
this.defaultState = Object.assign({}, this.state);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
console.log(this.props);
|
||||
|
||||
const ele = document.getElementById(this.state.uniqId);
|
||||
|
||||
ele.style.top = (ele.clientHeight / 2) + 'px;'
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="empty-state">
|
||||
<div id={this.state.uniqId} className="message-container">
|
||||
<img src="https://www.gstatic.com/mobilesdk/160505_mobilesdk/zerostate/2x/storage.png" alt="Empty" height="100" />
|
||||
<br/>
|
||||
{this.props.message}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
9
src/common/pages/EmptyState/style.scss
Normal file
9
src/common/pages/EmptyState/style.scss
Normal file
@@ -0,0 +1,9 @@
|
||||
.empty-state {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
|
||||
.message-container {
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user