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

Done!(try1) #2112

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

Done!(try1) #2112

wants to merge 2 commits into from

Conversation

EdenParadise
Copy link

Copy link

@DanilWeda DanilWeda left a comment

Choose a reason for hiding this comment

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

Demo link not working (
NewMovie.scss - empty.

Try to redeploy application.
Check comments for improvements.

Many thanks!

Comment on lines 29 to 33
const isDisabled = !(
fieldsOfMovie.title
&& fieldsOfMovie.imgUrl
&& fieldsOfMovie.imdbUrl
&& fieldsOfMovie.imdbId);

Choose a reason for hiding this comment

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

Try rewrite for more readability

imdbId: '',
};

type Props = {

Choose a reason for hiding this comment

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

Suggested change
type Props = {
interface Props = {

Comment on lines 39 to 43
title: fieldsOfMovie.title,
description: fieldsOfMovie.description,
imgUrl: fieldsOfMovie.imgUrl,
imdbUrl: fieldsOfMovie.imdbUrl,
imdbId: fieldsOfMovie.imdbId,

Choose a reason for hiding this comment

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

Suggested change
title: fieldsOfMovie.title,
description: fieldsOfMovie.description,
imgUrl: fieldsOfMovie.imgUrl,
imdbUrl: fieldsOfMovie.imdbUrl,
imdbId: fieldsOfMovie.imdbId,
...fieldsOfMovie,

Comment on lines 50 to 52
const changeFieldHandler = (name: Field, value: string) => {
setFieldsOfMovie(prevFields => ({ ...prevFields, [name]: value }));
};

Choose a reason for hiding this comment

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

Suggested change
const changeFieldHandler = (name: Field, value: string) => {
setFieldsOfMovie(prevFields => ({ ...prevFields, [name]: value }));
};
const changeFieldHandler = (key: Field) => ( value: string) => {
setFieldsOfMovie(prevFields => ({ ...prevFields, [key]: value }));
};

You can make it closure for best view )

value=""
onChange={() => {}}
value={fieldsOfMovie.title}
onChange={(value) => changeFieldHandler('title', value)}

Choose a reason for hiding this comment

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

Suggested change
onChange={(value) => changeFieldHandler('title', value)}
onChange={changeFieldHandler('title')}

And use it so

Copy link

@DanilWeda DanilWeda left a comment

Choose a reason for hiding this comment

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

Good job!
Approved.
Thanks!

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