Skip to content

Conversation

@Hustred
Copy link
Owner

@Hustred Hustred commented Sep 11, 2023

No description provided.

Comment on lines +12 to +18
if (id === "playerOne") {
return userNameOne;
}
if (id === "playerTwo") {
return userNameTwo;
}
return "";

Choose a reason for hiding this comment

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

` if (id === "playerOne") return userNameOne;

    if (id === "playerTwo") return userNameTwo;
    
    return "";`

Copy link
Owner Author

Choose a reason for hiding this comment

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

thats java code style - always use { ... } after if

Comment on lines +23 to +27
if (id === "playerOne") {
onSubmit(id, userNameOne);
} else {
onSubmit(id, userNameTwo);
}

Choose a reason for hiding this comment

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

const player = id === "playerOne" ? userNameOne : userNameTwo
onSubmit(id, player);

Comment on lines +19 to +33
<TableRow>
<TableCell>Id</TableCell>
<TableCell>Name</TableCell>
<TableCell>Stars</TableCell>
</TableRow>
</TableHead>
<TableBody>
{profiles.map((profile) => {
return (
<TableRow key={profile.id}>
<TableCell>{profile.id}</TableCell>
<TableCell>{profile.profileName}</TableCell>
<TableCell>{profile.starsCount}</TableCell>
</TableRow>
);

Choose a reason for hiding this comment

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

what happened with tabulations?

Comment on lines +19 to +23
dispatch(setLoading(true));
fetchPopularRepos(selectedLanguageIndex)
.then((repos) => dispatch(setRepos(repos)))
.catch((error) => dispatch(setErrors(error)))
.finally(() => dispatch(setLoading(false)));

Choose a reason for hiding this comment

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

better to cover in callback

Comment on lines +26 to +28
if (error) {
return <p>{error}</p>;
}

Choose a reason for hiding this comment

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

if (error) return <p>{error}</p>;

Comment on lines +30 to +44
if (loading) {
return (
<div>
<LanguageSelector selectedLanguageIndex={selectedLanguageIndex} />
<Loading isLoading={loading} />
</div>
);
} else {
return (
<div>
<LanguageSelector selectedLanguageIndex={selectedLanguageIndex} />
<Repositories repos={repos} />
</div>
);
}

Choose a reason for hiding this comment

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

    if (loading) return ( 
    <>
                <LanguageSelector selectedLanguageIndex={selectedLanguageIndex} />
                <Loading isLoading={loading} />
            </>
        );
        
        return (
            <div>
                <LanguageSelector selectedLanguageIndex={selectedLanguageIndex} />
                <Repositories repos={repos} />
            </div>
        );
        
        

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