Skip to content

Howework 3 my advanced profile#4

Open
cucumberian wants to merge 5 commits into
masterfrom
howework-3-my-advanced_profile
Open

Howework 3 my advanced profile#4
cucumberian wants to merge 5 commits into
masterfrom
howework-3-my-advanced_profile

Conversation

@cucumberian

Copy link
Copy Markdown
Owner

Есть ньансы:

  • сделал общий класс для всех компонет и передал его параметром
  • изменение счетчика проихсодит в JS стиле, через объект события event в обработчике события нажатия.
  • добавлял дополнительную запись к счетчику через css псевдоэлемент ::after
  • запутался в гите, в итоге переименовывал ветки у себя, и запушил вторую ветку с таким же названием. Наврное надо было делать rebase.
    image

@cucumberian cucumberian requested a review from takhanov August 1, 2023 18:01
const [className, setClass] = useState("counter");

function handleClick(e) {
let increase = 0;

@takhanov takhanov Aug 5, 2023

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

здесь лучше использовать слово value, т.к. inrease - переводится как увеличить.

if (e.target.dataset.role === "increase") {
increase = +1;
} else if (e.target.dataset.role === "decrease") {
if (counterValue <= 0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

проверку на CounterValue < 0 можно вынести в самое начало и сделать return

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