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

add task solution #2012

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

monikaprochniewicz
Copy link

Copy link

@natalia-klonowska natalia-klonowska left a comment

Choose a reason for hiding this comment

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

Great work but you forgot to import styles ;)

src/App.tsx Outdated
<div className="PostInfo">
<div className="PostInfo__header">
<h3 className="PostInfo__title">doloremque illum aliquid sunt</h3>
function getUser(userId: number): User | null {

Choose a reason for hiding this comment

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

If you are searching some entity by some filter, specify it in function/method name [checklist]

Suggested change
function getUser(userId: number): User | null {
function getUserById(userId: number): User | null {

Copy link

@Zibi95 Zibi95 left a comment

Choose a reason for hiding this comment

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

Well done. For future reference, whenever there is an opportunity to use destructuring, do so. By using destructuring, you can write cleaner, more readable, and maintainable code. It is a valuable tool in modern JavaScript development.

type Props = {
comment: Comment;
};
export const CommentInfo: React.FC<Props> = ({ comment }) => (
Copy link

Choose a reason for hiding this comment

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

Use destructuring whenever you are able to.

post: Post;
};

export const PostInfo: React.FC<Props> = ({ post }) => (
Copy link

Choose a reason for hiding this comment

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

This post could also be destructured.

user: User;
};

export const UserInfo: React.FC<Props> = ({ user }) => (
Copy link

Choose a reason for hiding this comment

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

Same here.

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.

3 participants