Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added comments to posts #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

atusia
Copy link
Collaborator

@atusia atusia commented Mar 27, 2020

No description provided.

@atusia atusia requested a review from AlyonaPianykh March 27, 2020 12:13
const CN = 'loading-center';
export const LoadingIndicator = () => {
return (

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty lines on lines 4,8,13 are useless and can be deleted

animation: loadingspin 2s linear infinite;
}


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line can be deleted

100% {
transform: rotate(360deg)
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line can be deleted

import { PostImage } from '../PostImage/PostImage';
import { accessToken } from '../../constants';
import React, {Component} from "react";
import {accessToken} from '../../constants';
import "./Post.scss";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Styling import should be the last one on line 7

if (!commentsLoaded) {
return this.onLoadComments()
} else {
return this.setState({commentsSectionExpanded: !commentsSectionExpanded});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can skip return here just use
this.onLoadComments()
and
this.setState({commentsSectionExpanded: !commentsSectionExpanded});

<div className={`${CN}__link-btn`} onClick={this.onShowComments}>
{commentsSectionExpanded ? "Hide comments" : "Show comments"}
</div>
<div>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This div is not needed and can be deleted

}
{
{commentsSectionExpanded && !isCommentsLoading && commentsLoaded && !comments.length &&
<div className={`${CN}__no-results`}>{"No comments for this post yet"}</div>}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brackets are not needed here inside tag cause you are putting simple string as a child
can be just
<div className={${CN}__no-results}>"No comments for this post yet"</div>

@@ -1,9 +1,9 @@
import React, { Component } from 'react';

import { Post } from '../Post/Post';
import { List } from '../List/List';
import { accessToken } from '../../constants';
import './UserDetails.scss';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Styling import should be the last one among imports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants