-
Notifications
You must be signed in to change notification settings - Fork 8
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
375-refactor: Subtitle component refactor #401
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
β¦, remove some extra styles
Lighthouse Report:
|
run visual now |
Lighthouse Report:
|
Lighthouse Report:
|
<Paragraph fontSize="large"> | ||
Are you an RS sloth fan and looking for RS merch? | ||
</Paragraph> |
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.
Could you please tell me why the line is broken in three lines?
<WidgetTitle size="large" mods="lines"> | ||
Mentors wanted! | ||
</WidgetTitle> |
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.
Could you please tell me why these lines are collapsed into one over your version?
type SubtitleProps = Pick<HTMLAttributes<HTMLHeadingElement>, 'className' | 'children'> & | ||
VariantProps<typeof subtitleVariants>; |
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 have seen the the same problem in our codebase before, but are we sure to use type SubtitleProps
, which includes type of variable subtitleVariants
, before definition of this variable?
<Subtitle key="aws cloud dev 03"> | ||
Course highlights: | ||
</Subtitle>, |
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.
Here too
<Subtitle key="aws devops 04"> | ||
What do we offer? | ||
</Subtitle>, |
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.
Here too
render(<Subtitle text="Test Subtitle" />); | ||
const subtitle = screen.getByText('Test Subtitle'); | ||
render(<Subtitle>Test Subtitle</Subtitle>); | ||
const subtitle = screen.getByTestId('subtitle'); | ||
|
||
expect(subtitle).toBeInTheDocument(); |
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.
expect(subtitle).toBeInTheDocument(); | |
expect(subtitle).toBeVisible(); |
render(<Subtitle className="custom-class">Custom Class</Subtitle>); | ||
const subtitle = screen.getByTestId('subtitle'); | ||
|
||
expect(subtitle).toHaveClass('custom-class'); |
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.
expect(subtitle).toHaveClass('custom-class'); | |
expect(subtitle).toHaveClass('custom-class', cx('gray-600'), cx('medium-font-size')); |
What type of PR is this? (select all that apply)
Description
Subtitle component refactor
Apply CSS modules \ cva
Update tests
Related Tickets & Documents
Screenshots, Recordings
Nothing really changes.
Left - prod; Right - dev.
Added/updated tests?
[optional] What gif best describes this PR or how it makes you feel?
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Subtitle
component for improved semantic structure and flexible styling options.Subtitle
component, enhancing layout control.Bug Fixes
Subtitle
component to utilize a children-based approach, improving clarity.Style
Tests
Subtitle
component to reflect the new rendering method and props structure.