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

Отрисуй меня полностью #6

Merged

Conversation

skyfxllen
Copy link
Contributor

@skyfxllen skyfxllen commented Dec 4, 2024

@keksobot keksobot changed the title module7 Отрисуй меня полностью Dec 4, 2024
@keksobot
Copy link
Contributor

keksobot commented Dec 7, 2024

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Dec 7, 2024
js/photos.js Outdated

Choose a reason for hiding this comment

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

Лучше всего стараться всегда писать весь код внутри функций. Даже если в файле больше нет функций. Так проще масштабировать код, экспортировать, изолировать переменные. Поэтому здесь тоже лучше создать как минимум одну функцию для создания мениатюр. Может быть ты захочешь создать и больше, чем одну, почему нет)

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';

Choose a reason for hiding this comment

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

Когда создашь функцию в модуле, стоит импортировать ее и вызвать в главном модуле)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Исправил)

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;

Choose a reason for hiding this comment

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

У фото еще alt нужно заполнить по заданию

Copy link
Contributor Author

Choose a reason for hiding this comment

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

как-то пропустил, исправил)

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;

Choose a reason for hiding this comment

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

Можно в начале развернуть массив, чтобы проще было обращаться ко всем свойствам. Пример const [likes] = photo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Добавил

Choose a reason for hiding this comment

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

Заметил мою ошибку с массивом) Конечно же у нас объект, сделал все правильно
👍🏻

@keksobot
Copy link
Contributor

keksobot commented Dec 9, 2024

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Dec 9, 2024
js/main.js Outdated
import {createArrayOfPhotos} from './data.js';

createArrayOfPhotos();
import {generatePictures} from './photos.js';

Choose a reason for hiding this comment

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

Давай выберем или photo, или pictures, а то несогласованность какая-то)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Переименовал

Choose a reason for hiding this comment

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

👍🏻

@keksobot
Copy link
Contributor

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Dec 10, 2024
@keksobot keksobot merged commit b231d5f into htmlacademy-univer-javascript-1:master Dec 10, 2024
1 check passed
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