-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
566-refactor: Fsd widget study path #772
base: main
Are you sure you want to change the base?
Conversation
Lighthouse Report:
|
import { Stages } from '../stages/stages'; | ||
import { Paragraph } from '@/shared/ui/paragraph'; | ||
import { WidgetTitle } from '@/shared/ui/widget-title'; | ||
import type { StagePathPage } from '@/widgets/study-path/types'; |
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.
In our other components, we define the component's prop types within the component file itself
@@ -0,0 +1,23 @@ | |||
import cn from 'classnames'; |
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.
import classNames from 'classnames/bind';
...
const cx = classNames.bind(styles);
export type StagePathPage = { | ||
page: 'courses' | 'jsEn' | 'jsRu' | 'angular' | 'awsDev'; | ||
}; |
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.
I'd define a separate type for the page
property (e.g., type PageType = ...
). SinΡe this might improve reusability in other parts of the codebase (e.g. the test file).
And about the naming, I think using js-en
instead of jsEn
would be better.
import feJsStage2 from '@/shared/assets/stages/stage-2.webp'; | ||
import feJsStage3 from '@/shared/assets/stages/stage-3.webp'; | ||
|
||
export const studyPath = { |
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.
Should we add a type for the studyPath
object?
}; | ||
}; | ||
|
||
export type Module = { |
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.
I'd either remove the export or rename the type, because the current name is too generic
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.
Shouldn't we use this file to export the types as well?
const stageStep = screen.getByTestId('stage-step'); | ||
|
||
expect(stageStep).toBeVisible(); | ||
expect(stageStep.innerHTML).toBe(mockProps.id.toString()); |
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.
You could you expect(stageStep).toHaveTextContent(mockProps.id.toString());
What type of PR is this? (select all that apply)
Description
Refactor due FSD
Related Tickets & Documents
Added/updated tests?
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?