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

Frontend | Features/loading #196

Merged
merged 18 commits into from
May 8, 2023

Conversation

KarolinaEsepenok
Copy link
Contributor

Есть пару вопросов, которые хотелось бы обсудить:

  1. В файлs loading.tsx стоит ли переносить
    с тайтлом, чтобы отображались сразу названия блоков или вместо этого написать Loading? или не нужен этот блок?(но без него там верска "сбивается").
  2. Нужен ли скелетон на стр каталог на фильтрах? он там реализован, но зависит от загрузки games. Тот что я реализовала, просто накладывается наверх, Мне кажется будет лучше убрать тот, который я реализовала и оставить тот, который был(я не знаю как его спрятать при адаптиве, там фильтры сворачиваются на определенной ширине).
  3. У меня проблема с версткой адаптивной части, так как не всегда корректно отображается адаптив самих страниц(медленная загрузка).
  4. Скелетон на стр новости использовала тот, что для карточки игры, он очень похож на дизайн новости, но отличия в длине картинки, есть ли смысл создавать компонент на скелетон новости? я просто не смогла задать другую длину, может и так можно.
    очень жду комментарии)

@KarolinaEsepenok KarolinaEsepenok changed the base branch from main to frontend May 2, 2023 14:11
Copy link
Contributor

@paqstd-dev paqstd-dev left a comment

Choose a reason for hiding this comment

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

Loading ui должен быть максимально "обезличен" - не имеет никаких названий, все блоки повторяют примерный интерфейс страницы или блока. Текстовые названия или блоки можно делать линиями разных размеров.

Импорт всех компонентов Skeleton должен быть примерно таким:

import {SkeletonCard} from 'components/Skeleton'

Для этого нужно в файле components/Skeleton/index.ts указать импорты из components/Skeleton/*/**.

Перед созданием коммита важно проверить изменения (опечатки, лишние комментарии и отступы).

Необходимо подтянуть последние изменения frontend ветки и добавить loading файлы для news details страницы.

@@ -1,4 +1,4 @@
# GSpot Frontend
yy# GSpot Frontend
Copy link
Contributor

Choose a reason for hiding this comment

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

Это нужно убрать

Comment on lines 16 to 55
.openFilter {
@apply mb-[10px] block h-[44px] w-full flex-row items-center justify-center rounded-default
border border-solid border-main-400 bg-main-30 tracking-[0.4px] text-white hover:border-main-500 hover:bg-main-40 lg:hidden;
}

.components {
@apply mb-[10px] mt-[20px] flex flex-col items-start justify-start;

@media (min-width: 576px) {
@apply mb-[20px];
}
@media (min-width: 992px) {
@apply mt-[30px];
}
@media (min-width: 1310px) {
@apply pr-[10px];
}
}

.wrapper {
@apply hidden lg:block;

&.open {
@apply block;
}
}

.title {
@apply mb-[25px] flex h-auto w-full flex-row items-center justify-between text-base font-semibold
tracking-default text-white;
}

.clearFilters {
@apply text-[12px] font-normal tracking-[0px] text-primary;
}

.applyFilter {
@apply flex h-[44px] w-full flex-row items-center justify-center rounded-default border
border-solid border-main-400 bg-main-30 tracking-[.4px] text-white hover:border-main-500 hover:bg-main-40;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Эти стили тут не нужны, они никак не используются.

Copy link
Contributor

Choose a reason for hiding this comment

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

Для страницы тоже нужен loading ui. Повторяем примерный интерфейс страницы

Comment on lines 7 to 31
export default function Loading() {
return (
<>
<Section
title={
<>
<b>Лучшие игры</b> этого месяца
</>
}
>
<div className={s.bestGames}>
{[...new Array(2)].map((_, index) => (
<SkeletonGameBigCard key={index} />
))}
</div>
<Section title={<>Новинки и обновления</>} />
<div className={s.card}>
{[...new Array(10)].map((_, index) => (
<SkeletonCard key={index} />
))}
</div>
</Section>
</>
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Блоки не должны иметь названия. Вместо названия показываем линию или прямоугольник.

Неправильная вложенность Section:

<Section>
  <Section />
</Section>

Должно быть так:

<Section />
<Section />

Copy link
Contributor Author

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.

Или лучше скелетон текст наподобие скелетона инпута и передавать просто размер текста( в описании карточек, в тайтле и на странице детали?)

Copy link
Contributor

Choose a reason for hiding this comment

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

Название можно сделать линией

Comment on lines 4 to 11

//Skeleton styles
.bestGames {
@apply mt-3 mb-20 grid grid-cols-2 gap-4 max-lg:grid-cols-1;
}
.card {
@apply mt-3 grid grid-cols-5 gap-4 max-xl:grid-cols-3 max-sm:grid-cols-2 max-[440px]:grid-cols-1;
}
Copy link
Contributor

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.

У меня реализован скелетон на 1 карточку. В первом блоке "Лучшие игры" две карточки нужно и ниже где новинки пять, где тогда писать стили , чтобы сверстать блок с двумя и пятью картами? в каталоге для этого я использую стили самой станицы(.row, .columns), на главной же странице все реализовано через карусель.

Copy link
Contributor

Choose a reason for hiding this comment

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

Для каждого компонента скелетона стили хранятся рядом с этим компонентом

@@ -46,12 +46,14 @@ const Home = async () => {
<div className={s.sections}>
{otherGames && (
<Section title="Игры">
{' '}
Copy link
Contributor

Choose a reason for hiding this comment

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

Этот отступ не нужен, его нужно убрать. Точно такой же чуть ниже.

@@ -21,6 +21,7 @@
"classnames": "^2.3.2",
"next": "^13.3.1-canary.4",
"qs": "^6.11.1",
"rc-progress": "^3.4.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Эта библиотека/модуль нигде не используется. Нужно удалить его локально npm uninstall rc-progress и он автоматически удалится из этого и package-lock.json файла.

Comment on lines 21 to 23
{[...new Array(17)].map((_, index) => (
<SkeletonInput size={'44'} key={index} />
))}
Copy link
Contributor

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.

нужен ли этот второй скелетон на фильтры? я спрашивала в первом комментарии. и как реализовать, чтобы для моб устройств он спрятался, если в файле лоадинг нет логики? создать компонент скелетон на фильтры отдельный?

Copy link
Contributor

Choose a reason for hiding this comment

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

Прятать можно через стили. В tailwind есть классы для работы с разными размерами.

<SkeletonCard key={index} />
))}
</div>
<Pagination />
Copy link
Contributor

Choose a reason for hiding this comment

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

Нельзя использовать интерактивные компоненты для loading ui, такие как Paginaton, Carousel и тд. Такие компоненты могут делать запросы в api, делать некоторые вычисления и тд.

Loading ui обычно должен содержать стили для блоков и сами блоки. Никакой сложной js/ts логики не хранит.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Тогда можно создавать стили для лоадинг в разметке или можно для него отдельный файл со стилями? в интернете встречала стили в разметке лоадинг.

Copy link
Contributor

Choose a reason for hiding this comment

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

В идеале, конечно, делать отдельно. Можно попробовать сделать к примеру loading.module.scss файл для таких стилей

@kieled kieled reopened this May 8, 2023
@kieled kieled merged commit 90bfe57 into DJWOMS:frontend May 8, 2023
@kieled kieled added the frontend Frontend label label Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Frontend label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants