Skip to content
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

[LOOM-1313][BpkSectionHeader] Class2 Fixes #3380

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
}

&__title {
@include typography.bpk-text;
@include typography.bpk-heading-2;

@include breakpoints.bpk-breakpoint-mobile {
Expand Down
19 changes: 6 additions & 13 deletions packages/bpk-component-section-header/src/BpkSectionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,12 @@ const BpkSectionHeader = ({
`bpk-section-header__title-description--${type}`,
)}
>
<BpkText
tagName="h2"
// TODO: className to be removed
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
className={getClassName('bpk-section-header__title')}
>
{title}
</BpkText>
{description && <BpkText
// TODO: className to be removed
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
className={getClassName('bpk-section-header__description')}>{description}
</BpkText>}
<h2 className={getClassName('bpk-section-header__title')}>{title}</h2>
{description && (
<span className={getClassName('bpk-section-header__description')}>
<BpkText>{description}</BpkText>
</span>
)}
</div>
{button}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`BpkSectionHeader should render correctly 1`] = `
class="bpk-section-header__title-description bpk-section-header__title-description--default"
>
<h2
class="bpk-text bpk-text--body-default bpk-section-header__title"
class="bpk-section-header__title"
>
Section title
</h2>
Expand All @@ -27,14 +27,18 @@ exports[`BpkSectionHeader should render correctly with "type" prop 1`] = `
class="bpk-section-header__title-description bpk-section-header__title-description--on-dark"
>
<h2
class="bpk-text bpk-text--body-default bpk-section-header__title"
class="bpk-section-header__title"
>
Section title
</h2>
<span
class="bpk-text bpk-text--body-default bpk-section-header__description"
class="bpk-section-header__description"
>
Section title description
<span
class="bpk-text bpk-text--body-default"
>
Section title description
</span>
</span>
</div>
<button
Expand All @@ -56,14 +60,18 @@ exports[`BpkSectionHeader should render correctly with a "description" prop 1`]
class="bpk-section-header__title-description bpk-section-header__title-description--default"
>
<h2
class="bpk-text bpk-text--body-default bpk-section-header__title"
class="bpk-section-header__title"
>
Section title
</h2>
<span
class="bpk-text bpk-text--body-default bpk-section-header__description"
class="bpk-section-header__description"
>
Section title description
<span
class="bpk-text bpk-text--body-default"
>
Section title description
</span>
</span>
</div>
</div>
Expand All @@ -79,14 +87,18 @@ exports[`BpkSectionHeader should render correctly with an "button" prop 1`] = `
class="bpk-section-header__title-description bpk-section-header__title-description--default"
>
<h2
class="bpk-text bpk-text--body-default bpk-section-header__title"
class="bpk-section-header__title"
>
Section title
</h2>
<span
class="bpk-text bpk-text--body-default bpk-section-header__description"
class="bpk-section-header__description"
>
Section title description
<span
class="bpk-text bpk-text--body-default"
>
Section title description
</span>
</span>
</div>
<button
Expand Down
Loading