mirror of
https://github.com/wassname/talk.git
synced 2026-07-29 11:28:24 +08:00
My Comment History Working - linted
This commit is contained in:
@@ -7,12 +7,11 @@ const CommentHistory = props => {
|
||||
<div className={`${styles.header} commentHistory`}>
|
||||
<div className="commentHistory__list">
|
||||
{props.comments.map((comment, i) => {
|
||||
return <div>{comment.body}</div>
|
||||
{/*return <Comment*/}
|
||||
{/*key={i}*/}
|
||||
{/*comment={comment}*/}
|
||||
{/*link={props.link}*/}
|
||||
{/*asset={asset} />;*/}
|
||||
return <Comment
|
||||
key={i}
|
||||
comment={comment}
|
||||
link={props.link}
|
||||
asset={props.asset} />;
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
@@ -20,8 +19,8 @@ const CommentHistory = props => {
|
||||
};
|
||||
|
||||
CommentHistory.propTypes = {
|
||||
comments: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
assets: PropTypes.arrayOf(PropTypes.object).isRequired
|
||||
comments: PropTypes.array.isRequired,
|
||||
asset: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
export default CommentHistory;
|
||||
|
||||
@@ -6,8 +6,10 @@ import I18n from 'coral-framework/modules/i18n/i18n';
|
||||
import {myCommentHistory} from 'coral-framework/graphql/queries';
|
||||
import {saveBio} from 'coral-framework/actions/user';
|
||||
|
||||
import {link} from 'coral-framework/PymConnection';
|
||||
|
||||
import BioContainer from './BioContainer';
|
||||
import {TabBar, Tab, TabContent} from 'coral-ui';
|
||||
import {TabBar, Tab, TabContent, Spinner} from 'coral-ui';
|
||||
import NotLoggedIn from '../components/NotLoggedIn';
|
||||
import CommentHistory from 'coral-plugin-history/CommentHistory';
|
||||
import SettingsHeader from '../components/SettingsHeader';
|
||||
@@ -33,13 +35,15 @@ class SettingsContainer extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {loggedIn, userData, showSignInDialog, user, data} = this.props;
|
||||
const {loggedIn, userData, asset, showSignInDialog, user, data} = this.props;
|
||||
const {activeTab} = this.state;
|
||||
|
||||
if (data.loading) {
|
||||
return <div>Loading</div>
|
||||
return <Spinner/>;
|
||||
}
|
||||
|
||||
console.log(this.props);
|
||||
|
||||
return (
|
||||
<RestrictedContent restricted={!loggedIn} restrictedComp={<NotLoggedIn showSignInDialog={showSignInDialog} />}>
|
||||
<SettingsHeader {...this.props} />
|
||||
@@ -50,7 +54,11 @@ class SettingsContainer extends Component {
|
||||
<TabContent show={activeTab === 0}>
|
||||
{
|
||||
data.me.comments.length ?
|
||||
<CommentHistory comments={data.me.comments}/>
|
||||
<CommentHistory
|
||||
comments={data.me.comments}
|
||||
asset={asset}
|
||||
link={link}
|
||||
/>
|
||||
:
|
||||
<p>{lang.t('user-no-comment')}</p>
|
||||
}
|
||||
@@ -64,7 +72,8 @@ class SettingsContainer extends Component {
|
||||
}
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
user: state.user.toJS()
|
||||
user: state.user.toJS(),
|
||||
asset: state.asset.toJS()
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
Reference in New Issue
Block a user