2019-06-21 21:07:05 +03:00
|
|
|
import React, { Component } from 'react'
|
|
|
|
import classnames from 'classnames';
|
|
|
|
|
|
|
|
|
|
|
|
export default class PublishTile extends Component {
|
|
|
|
constructor(props){
|
|
|
|
super(props);
|
2020-01-10 04:11:06 +03:00
|
|
|
console.log("publish-tile", this.props);
|
2019-06-21 21:07:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-01-10 04:11:06 +03:00
|
|
|
render(){
|
2020-02-06 07:34:17 +03:00
|
|
|
|
|
|
|
let notificationsNum = this.props.data.notifications;
|
|
|
|
|
|
|
|
if (notificationsNum === 0) {
|
|
|
|
notificationsNum = "";
|
|
|
|
}
|
|
|
|
else if (notificationsNum > 99) {
|
|
|
|
notificationsNum = "99+";
|
|
|
|
}
|
|
|
|
else if (isNaN(notificationsNum)) {
|
|
|
|
notificationsNum = "";
|
|
|
|
}
|
|
|
|
|
2019-06-21 21:07:05 +03:00
|
|
|
return (
|
2020-02-22 05:58:22 +03:00
|
|
|
<div className={"w-100 h-100 relative bg-white bg-gray0-d " +
|
|
|
|
"ba b--black b--gray1-d"}>
|
2019-06-21 21:07:05 +03:00
|
|
|
<a className="w-100 h-100 db no-underline" href="/~publish">
|
2020-02-22 05:58:22 +03:00
|
|
|
<p className="black white-d f9 absolute" style={{ left: 8, top: 8 }}>
|
2020-02-06 02:16:56 +03:00
|
|
|
Publishing
|
2019-06-21 21:07:05 +03:00
|
|
|
</p>
|
|
|
|
<img
|
2020-02-22 05:58:22 +03:00
|
|
|
className="absolute invert-d"
|
2020-02-06 07:34:17 +03:00
|
|
|
style={{ left: 39, top: 39 }}
|
2019-06-21 21:07:05 +03:00
|
|
|
src="/~publish/tile.png"
|
2020-02-06 02:16:56 +03:00
|
|
|
width={48}
|
2020-02-06 07:34:17 +03:00
|
|
|
height={48}
|
|
|
|
/>
|
|
|
|
<div
|
|
|
|
className="absolute w-100 flex-col f9"
|
|
|
|
style={{ verticalAlign: "bottom", bottom: 8, left: 8 }}>
|
2020-02-22 05:58:22 +03:00
|
|
|
<span className="green2 white-d">{notificationsNum}</span>
|
2019-06-21 21:07:05 +03:00
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-12 00:46:00 +03:00
|
|
|
window.publishTile = PublishTile;
|