import React, { Component } from 'react'; import { Redirect } from 'react-router'; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { getImageUrl, toPath } from 'educoder'; import moment from 'moment'; class PostItem extends Component { _toTenThousand(num) { if (num > 10000) { return ( (num - 500)/ 10000 ).toFixed(1) + '万' } return num } render() { const { match, history, currentPage, memo, user, setTop, setDown } = this.props return (
用户头像

{/* target="_blank" */} {memo.subject} { memo.sticky && 置顶 } { memo.reward && {memo.reward} }

{memo.user_name} {/*最后回复:todo{memo.username} memo.language && memo.language != 'other' && {memo.language} */} {/* {moment(memo.updated_at).fromNow()} */} {memo.tag && memo.tag.length ? 来自 {memo.tag.join('/')} : ''} {/*C++*/}

{/* data-tip-down="回复数" {memo.replies_count} {memo.praise_count}*/} {memo.replies_count ? {memo.replies_count} 回复 :''} {memo.praise_count ? {memo.praise_count} 赞 :''} {memo.viewed_count ? {this._toTenThousand(memo.viewed_count)} 浏览 :''}

{ user && (user.admin === true || user.user_id === memo.author_id) &&
}
); } } export default PostItem