-
Notifications
You must be signed in to change notification settings - Fork 1
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
Отрисуй меня полностью #6
Отрисуй меня полностью #6
Conversation
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
js/photos.js
Outdated
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.
Лучше всего стараться всегда писать весь код внутри функций. Даже если в файле больше нет функций. Так проще масштабировать код, экспортировать, изолировать переменные. Поэтому здесь тоже лучше создать как минимум одну функцию для создания мениатюр. Может быть ты захочешь создать и больше, чем одну, почему нет)
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.
👍🏻
js/main.js
Outdated
import {createArrayOfPhotos} from './data.js'; | ||
|
||
createArrayOfPhotos(); | ||
import './photos.js'; |
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.
Когда создашь функцию в модуле, стоит импортировать ее и вызвать в главном модуле)
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.
Исправил)
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.
👍🏻
js/photos.js
Outdated
photos.forEach((photo) => { | ||
const picture = pictureTemplate.cloneNode(true); | ||
|
||
picture.querySelector(".picture__img").src = photo.url; |
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.
У фото еще alt нужно заполнить по заданию
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.
как-то пропустил, исправил)
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.
👍🏻
js/photos.js
Outdated
|
||
picture.querySelector(".picture__img").src = photo.url; | ||
picture.querySelector(".picture__comments").textContent = photo.comments.length; | ||
picture.querySelector(".picture__likes").textContent = photo.likes; |
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.
Можно в начале развернуть массив, чтобы проще было обращаться ко всем свойствам. Пример const [likes] = photo
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.
Добавил
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.
Заметил мою ошибку с массивом) Конечно же у нас объект, сделал все правильно
👍🏻
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
js/main.js
Outdated
import {createArrayOfPhotos} from './data.js'; | ||
|
||
createArrayOfPhotos(); | ||
import {generatePictures} from './photos.js'; |
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.
Давай выберем или photo, или pictures, а то несогласованность какая-то)
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.
Переименовал
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.
👍🏻
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
b231d5f
into
htmlacademy-univer-javascript-1:master
🎓 Отрисуй меня полностью
💥 https://htmlacademy-univer-javascript-1.github.io/2579201-kekstagram-5/6/