Skip to content

урок JSX+CSS#141

Open
Evgeny2015 wants to merge 64 commits intospirit-drive:mainfrom
Evgeny2015:main
Open

урок JSX+CSS#141
Evgeny2015 wants to merge 64 commits intospirit-drive:mainfrom
Evgeny2015:main

Conversation

@Evgeny2015
Copy link

  • Компонент модального окна - "shared/modal-window"
  • Компонент Layout - "shared/layout"
  • Компонент Header - "shared/header"
  • Компонент Logo - "shared/logo"
  • Компонент краткого отображения операции - "shared/short-operation"
  • Компонент полного отображения операции - "shared/edit-operation"
  • Кнопка "в корзину" - "shared/add-to-basket-button"
  • Компонент краткого отображения товара - "shared/short-product"
  • Компонент полного отображения товара - "shared/long-product"
  • Компонент товара для корзины - "shared/basket-product"

Добавить
</button>

<div className={cn('button-container', {'invisible': count == 0 })}>

Choose a reason for hiding this comment

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

{'invisible': count == 0 } стоит вынести в отдельную переменную выше , читаемость лучше

Choose a reason for hiding this comment

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

Другой момент что не нужно скрывать стилями достаточно использовать

if (!count) {
   return  null
}

/**
* Компонент отображения товара для корзины
*/
const ShortProduct: FC<BasketProductProps> = ({ price, image, name, ...props }) => {

Choose a reason for hiding this comment

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

...props конструкция тут не требуется, это используется не много в других ситуациях в лекции Паттерны вам будут рассказывать

/**
* Header component
*/
const Header: FC<HeaderProps> = ({ ...props }) => {

Choose a reason for hiding this comment

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

...props убрать стоит во всем проекте

Evgeny2015 added 30 commits May 31, 2025 17:33
dev: add routes and redis with thunk
fix: move routes in component and add dialog route
Revert "fix: move routes in component and add dialog route"
# Conflicts:
#	src/app/App.tsx
#	src/features/forms/ProductForm/ProductForm.stories.tsx
#	src/features/forms/ProductForm/ProductForm.tsx
#	src/pages/product/ProductPage.tsx
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