Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4528 from bbc/section-label-mobile-divider
Browse files Browse the repository at this point in the history
Section Label - Make Mobile Divider Optional
  • Loading branch information
ryanmccombe authored Jul 30, 2021
2 parents 53a7989 + b90f26a commit 52a7bbe
Show file tree
Hide file tree
Showing 8 changed files with 797 additions and 249 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"@bbc/psammead-play-button": "3.0.22",
"@bbc/psammead-rich-text-transforms": "2.0.6",
"@bbc/psammead-script-link": "3.0.20",
"@bbc/psammead-section-label": "7.0.20",
"@bbc/psammead-section-label": "7.1.0",
"@bbc/psammead-social-embed": "3.1.16",
"@bbc/psammead-story-promo": "8.0.21",
"@bbc/psammead-story-promo-list": "6.0.19",
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-section-label/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 7.1.0 | [PR#4528](https://github.com/bbc/psammead/pull/4528) Allows the mobile divider to be toggled off |
| 7.0.20 | [PR#4497](https://github.com/bbc/psammead/pull/4497) Bump psammead-styles |
| 7.0.19 | [PR#4486](https://github.com/bbc/psammead/pull/4486) upgrade minor/patch dependencies |
| 7.0.17 | [PR#4420](https://github.com/bbc/psammead/pull/4420) bumps 3rd-party dependencies |
Expand Down
22 changes: 22 additions & 0 deletions packages/components/psammead-section-label/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The only provided child should be the title for the section, provided as a _stri
| Argument | Type | Required | Default | Example |
| --------- | ---- | -------- | ------- | ------- |
| bar | boolean | no | `true` | `false` |
| mobileDivider | boolean | no | `true` | `false` |
| visuallyHidden | boolean | no | `false` | `true` |
| children | string | yes | N/A | `'Most Read'` |
| dir | string | no | `'ltr'` | `'rtl'` |
Expand Down Expand Up @@ -70,6 +71,27 @@ const WrappingComponent = () => (
);
```

On mobile, this component places a dividing line above the title. This can be disabled by setting the `mobileDivider` prop to `false`:

```jsx
import SectionLabel from '@bbc/psammead-section-label';
import { latin } from '@bbc/gel-foundations/scripts';

const WrappingComponent = () => (
<div aria-labelledby="example-section-label">
<SectionLabel
script={latin}
dir="ltr"
mobileDivider={false}
labelId="example-section-label"
service="news"
>
Example section
</SectionLabel>
</div>
);
```

You can also visually hide the SectionLabel for all breakpoints by adding the `visuallyHidden` prop:

```jsx
Expand Down
2 changes: 1 addition & 1 deletion packages/components/psammead-section-label/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-section-label",
"version": "7.0.20",
"version": "7.1.0",
"description": "React styled component for a section label",
"main": "dist/index.js",
"module": "esm/index.js",
Expand Down
Loading

0 comments on commit 52a7bbe

Please sign in to comment.