diff --git a/packages/components/psammead-media-indicator/CHANGELOG.md b/packages/components/psammead-media-indicator/CHANGELOG.md index 1d539e94cd..a9c8bdba08 100644 --- a/packages/components/psammead-media-indicator/CHANGELOG.md +++ b/packages/components/psammead-media-indicator/CHANGELOG.md @@ -3,6 +3,7 @@ | Version | Description | | ------- | ----------- | +| 1.1.0 | [PR#776](https://github.com/bbc/psammead/pull/776) Add `topStory` prop, change padding <400px and bump dependencies | | 1.0.5 | [PR#788](https://github.com/BBC/psammead/pull/788) Use rem for the width and height of the Media SVGs | | 1.0.4 | [PR#769](https://github.com/bbc/psammead/pull/769) Fix stories not appearing in storybook when using `install:packages:link` | | 1.0.3 | [PR#713](https://github.com/bbc/psammead/pull/713) Update `styled-components` to 4.3.2 | diff --git a/packages/components/psammead-media-indicator/README.md b/packages/components/psammead-media-indicator/README.md index 9b676b2cc5..8fb403ecbe 100644 --- a/packages/components/psammead-media-indicator/README.md +++ b/packages/components/psammead-media-indicator/README.md @@ -17,11 +17,14 @@ The `MediaIndicator` component provides a 'play' or 'audio' icon as well as a du | datetime | string | No | Null | 'PT2M15S' | | offscreenText | string | No | Null | 'Video' | | type | string | No | 'video' | 'audio' | +| topStory | boolean | No | false | true | ## Usage The typical use-case of this component is on top of images within promos for articles that contains a video asset at the top of the page. It indicates to the user that the link is to a video and how long the video is in duration. +For top story promos, we should pass the `topStory` prop to the `Media Indicator` to keep the same padding, otherwise this will be modified under 400px. + ```jsx import MediaIndicator from '@bbc/psammead-media-indicator'; diff --git a/packages/components/psammead-media-indicator/package-lock.json b/packages/components/psammead-media-indicator/package-lock.json index 85c33c2ef5..c6b2eaa7fd 100644 --- a/packages/components/psammead-media-indicator/package-lock.json +++ b/packages/components/psammead-media-indicator/package-lock.json @@ -1,6 +1,6 @@ { "name": "@bbc/psammead-media-indicator", - "version": "1.0.5", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/components/psammead-media-indicator/package.json b/packages/components/psammead-media-indicator/package.json index fe25325edc..27553a175c 100644 --- a/packages/components/psammead-media-indicator/package.json +++ b/packages/components/psammead-media-indicator/package.json @@ -1,6 +1,6 @@ { "name": "@bbc/psammead-media-indicator", - "version": "1.0.5", + "version": "1.1.0", "main": "dist/index.js", "description": "Provides a play icon and media duration for media page promos", "repository": { diff --git a/packages/components/psammead-media-indicator/src/__snapshots__/index.test.jsx.snap b/packages/components/psammead-media-indicator/src/__snapshots__/index.test.jsx.snap index e5d768f1ca..9702ca018c 100644 --- a/packages/components/psammead-media-indicator/src/__snapshots__/index.test.jsx.snap +++ b/packages/components/psammead-media-indicator/src/__snapshots__/index.test.jsx.snap @@ -1,5 +1,89 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`MediaIndicator - Top Story should render a top story audio promo render correctly 1`] = ` +.c3 { + -webkit-clip-path: inset(100%); + clip-path: inset(100%); + -webkit-clip: rect(1px,1px,1px,1px); + clip: rect(1px,1px,1px,1px); + height: 1px; + overflow: hidden; + position: absolute; + width: 1px; +} + +.c2 { + vertical-align: middle; + margin: 0 0.25rem; + fill: #222222; + width: 0.8125rem; + height: 0.75rem; +} + +.c0 { + padding: 0.5rem 0.25rem; + background-color: #FFFFFF; + display: block; + font-family: ReithSans,Helvetica,Arial,sans-serif; + font-size: 0.75rem; + line-height: 1rem; + color: #222222; + height: 2rem; +} + +.c1 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + height: 100%; +} + +.c4 { + vertical-align: middle; + margin: 0 0.25rem; +} + + +`; + exports[`MediaIndicator should render audio correctly without duration details 1`] = ` .c3 { -webkit-clip-path: inset(100%); @@ -43,6 +127,13 @@ exports[`MediaIndicator should render audio correctly without duration details 1 height: 100%; } +@media (max-width:24.9375rem) { + .c0 { + height: 1.25rem; + padding: 0.25rem 0.25rem 0; + } +} +