-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 👌🍑 #1884
base: master
Are you sure you want to change the base?
add task solution 👌🍑 #1884
Conversation
src/components/NewMovie/NewMovie.tsx
Outdated
const isDisabled = title.length === 0 | ||
|| imgUrl.length === 0 | ||
|| imdbUrl.length === 0 | ||
|| imdbId.length === 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use also trim here for disabling, because now i can unblock button with just 'spaces'
const isDisabled = title.length === 0 | |
|| imgUrl.length === 0 | |
|| imdbUrl.length === 0 | |
|| imdbId.length === 0; | |
const isDisabled = !title.length | |
|| !imgUrl.length | |
|| !imdbUrl.length | |
|| !imdbId.length; |
src/components/NewMovie/NewMovie.tsx
Outdated
if (newMovie.title.length === 0 | ||
|| newMovie.imgUrl.length === 0 | ||
|| newMovie.imdbUrl.length === 0 | ||
|| newMovie.imdbId.length === 0 | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (newMovie.title.length === 0 | |
|| newMovie.imgUrl.length === 0 | |
|| newMovie.imdbUrl.length === 0 | |
|| newMovie.imdbId.length === 0 | |
) { | |
if (!newMovie.title.length | |
|| !newMovie.imgUrl.length | |
|| !newMovie.imdbUrl.length | |
|| !newMovie.imdbId.length | |
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi! if you don't mind I added "trim()"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🔥
https://denys2.github.io/react_movies-list-add-form/