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
Add tab #11
Add tab #11
Conversation
Я пока закомментировал тесты, так как они пока вообще не писались |
.github/workflows/nodejs.yml
Outdated
- name: Run test | ||
run: make test | ||
# - name: Run test | ||
# run: make test |
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.
actions падает, так как тестов пока нет
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.
Давай простенький тест сделаем.
src/components/TabItem.jsx
Outdated
const TabItem = ({ id, name }) => { | ||
const currentTabId = useSelector((state) => state.tabs.currentTabId); | ||
const dispatch = useDispatch(); | ||
const isActive = id === currentTabId ? true : null; |
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.
давай сделаем false вместо null
src/components/Tabs.jsx
Outdated
{tabsList.map(({ id, name }) => ( | ||
<TabItem key={id} id={id} name={name} /> | ||
))} | ||
<Button variant="light" onClick={addNewTab}>+</Button> |
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.
надо бы добавить title
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.
ну пожалуйста :)
атрибут title сделает кнопку доступной - посмотри, как ведёт себя кнопка + в хроме, например
src/slices/tabs.js
Outdated
@@ -0,0 +1,33 @@ | |||
/* eslint-disable no-param-reassign */ | |||
import { createSlice } from '@reduxjs/toolkit'; | |||
import _ from 'lodash'; |
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.
#9