-
Notifications
You must be signed in to change notification settings - Fork 13
/
news.51188cc99b242627d606.js
1 lines (1 loc) · 3.36 KB
/
news.51188cc99b242627d606.js
1
(this.webpackChunkBitShares2_light=this.webpackChunkBitShares2_light||[]).push([[946],{34760:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>N});var s=n(96540),a=n(10658),r=n.n(a),i=n(27064),l=n(80849),c=n.n(l),o=n(40702),m=n(87040);const d={tag:(0,n(45964).yf)(),limit:20},h={textAlign:"right"},u={textAlign:"left"},E={height:"2rem"},p={padding:"0.5rem 1rem"},g={padding:"0.85rem 1rem"},y={...u,...p},w={...h,...p},b={...u,...g},D={...h,...g},k={...y,width:"180px"},v=()=>s.createElement("p",null,s.createElement(c(),{content:"news.errors.fetch"})),f=({data:e,url:t,isLink:n=!1})=>s.createElement("a",{href:`https://steemit.com${t}`,rel:"noreferrer noopener",target:"_blank",style:{display:"block"},className:n?"external-link":"primary-text"},m.A.sanitize(e)),L=({data:e,width:t})=>s.createElement("table",{className:"table table-hover dashboard-table",style:{fontSize:"0.85rem"}},s.createElement("thead",null,s.createElement("tr",null,s.createElement("th",{style:D},s.createElement(c(),{component:"span",content:"account.votes.line"})),s.createElement("th",{style:b},s.createElement(c(),{component:"span",content:"explorer.block.date"})),s.createElement("th",{style:b},s.createElement(c(),{component:"span",content:"news.subject"})),s.createElement("th",{style:b},s.createElement(c(),{component:"span",content:"news.author"})))),s.createElement("tbody",null,e.map(((e,n)=>{const a=e.parentAuthor?e.parentAuthor:e.author,i=r().localize(new Date(e.created)),l=6*e.title.length>t-450?`${e.title.slice(0,Math.floor(t-450)/6)}...`:e.title;return s.createElement("tr",{key:`${e.title.slice(0,10)}${n}`},s.createElement("td",{style:w},s.createElement(f,{data:n+1,url:e.url})),s.createElement("td",{style:k},s.createElement(f,{data:i,url:e.url})),s.createElement("td",{style:y},s.createElement(f,{data:l,url:e.url,isLink:!0})),s.createElement("td",{style:y},s.createElement(f,{data:a,url:e.url})))}))),s.createElement("thead",null,s.createElement("tr",{style:E},s.createElement("th",{style:w}),s.createElement("th",{style:y}),s.createElement("th",{style:y}),s.createElement("th",{style:y}))));class x extends s.Component{constructor(e){super(e),this.state={isLoading:!0,isWrong:!1,discussions:[],width:1200},this.updateDimensions=this.updateDimensions.bind(this),this.orderDiscussions=this.orderDiscussions.bind(this)}updateDimensions(){this.setState({width:window.innerWidth})}orderDiscussions(e){const t=e.sort(((e,t)=>new Date(t.created)-new Date(e.created)));this.setState({discussions:t,isLoading:!1})}componentDidMount(){this.updateDimensions(),window.addEventListener("resize",this.updateDimensions),d.tag?i.api.getDiscussionsByTrending(d,((e,t)=>{if(e)return this.setState({isLoading:!1,isWrong:!0});this.orderDiscussions(t)})):setTimeout((()=>{this.setState({isLoading:!1,isWrong:!1})}),100)}componentWillUnmount(){window.removeEventListener("resize",this.updateDimensions)}render(){const{isLoading:e,isWrong:t,discussions:n,width:a}=this.state;return s.createElement("div",{className:"grid-block page-layout"},s.createElement("div",{className:"grid-block vertical"},s.createElement("div",{className:"account-tabs"},s.createElement("div",{className:"tab-content"},s.createElement("div",{className:"grid-block vertical"},t&&s.createElement(v,null),e?s.createElement(o.A,null):null,!t&&!e&&s.createElement(L,{width:a,data:n}))))))}}const N=x},40794:()=>{},47790:()=>{},73776:()=>{},98285:()=>{},38664:()=>{},21638:()=>{},92668:()=>{}}]);