diff --git a/packages/components/psammead-media-indicator/CHANGELOG.md b/packages/components/psammead-media-indicator/CHANGELOG.md index 90ff441d5e..2dc1f48d55 100644 --- a/packages/components/psammead-media-indicator/CHANGELOG.md +++ b/packages/components/psammead-media-indicator/CHANGELOG.md @@ -3,6 +3,7 @@ | Version | Description | | ------- | ----------- | +| 4.0.0 | [PR#3062](https://github.com/bbc/psammead/pull/3062) Pass Time element as a child and remove spacing from the `MediaIndicatorWrapper`| | 3.0.0 | [PR#3029](https://github.com/bbc/psammead/pull/3029) Add prop `isInline` for displaying media indicator inline. Remove boolean prop `indexAlsos` since it should be replaced with `isInline` | | 2.6.27 | [PR#3030](https://github.com/bbc/psammead/pull/3030) Talos - Bump Dependencies - @bbc/psammead-styles, @bbc/psammead-assets | | 2.6.26 | [PR#2996](https://github.com/bbc/psammead/pull/2996) Talos - Bump Dependencies - @bbc/psammead-assets | diff --git a/packages/components/psammead-media-indicator/README.md b/packages/components/psammead-media-indicator/README.md index bc914dac0a..9409109ed4 100644 --- a/packages/components/psammead-media-indicator/README.md +++ b/packages/components/psammead-media-indicator/README.md @@ -13,10 +13,7 @@ The `MediaIndicator` component provides a 'play', 'audio' or 'camera' icon as we | Argument | Type | Required | Default | Example | | ---------- | ------- | -------- | ------- | ------------ | -| duration | string | No | Null | '2:15' | -| datetime | string | No | Null | 'PT2M15S' | | type | string | No | 'video' | 'audio' | -| topStory | boolean | No | false | true | | service | string | Yes | N/A | `'news'` | | isInline | boolean | No | false | true | | children | node | No | null | | @@ -32,19 +29,14 @@ The `MediaIndicator` component provides a 'play', 'audio' or 'camera' icon as we 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. - Top story promos can also have related stories links called `Index Alsos`. When an Index Also item is a video, audio or photogallery, an icon should be displayed with the content using the `MediaIndicator` component passing the `isInline` prop. +When using this component ensure you add the relevant spacing. + ```jsx import MediaIndicator from '@bbc/psammead-media-indicator'; -; +; ``` ### When to use this component diff --git a/packages/components/psammead-media-indicator/package-lock.json b/packages/components/psammead-media-indicator/package-lock.json index 9fc01d9518..9ec5d5bc0b 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": "3.0.0", + "version": "4.0.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 7286f004b4..1800050ebd 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": "3.0.0", + "version": "4.0.0", "main": "dist/index.js", "module": "esm/index.js", "sideEffects": false, 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 c0b82a659b..f094544c7f 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,77 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`MediaIndicator - Top Story should render a top story audio promo render correctly 1`] = ` -.c2 { - vertical-align: middle; - margin: 0 0.25rem; - color: #222222; - fill: currentColor; - 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-weight: 400; - font-style: normal; - 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%; -} - -.c3 { - vertical-align: middle; - margin: 0 0.25rem; -} - - -`; - exports[`MediaIndicator should render audio correctly without duration details 1`] = ` .c2 { vertical-align: middle; @@ -83,16 +11,12 @@ exports[`MediaIndicator should render audio correctly without duration details 1 } .c0 { - padding: 0.5rem 0.25rem; + color: #222222; background-color: #FFFFFF; - display: block; font-family: ReithSans,Helvetica,Arial,sans-serif; font-weight: 400; font-style: normal; - font-size: 0.75rem; - line-height: 1rem; - color: #222222; - height: 2rem; + display: block; } .c1 { @@ -107,13 +31,6 @@ 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; - } -} - `; @@ -230,16 +125,12 @@ exports[`MediaIndicator should render photogallery correctly 1`] = ` } .c0 { - padding: 0.5rem 0.25rem; + color: #222222; background-color: #FFFFFF; - display: block; font-family: ReithSans,Helvetica,Arial,sans-serif; font-weight: 400; font-style: normal; - font-size: 0.75rem; - line-height: 1rem; - color: #222222; - height: 2rem; + display: block; } .c1 { @@ -254,13 +145,6 @@ exports[`MediaIndicator should render photogallery correctly 1`] = ` height: 100%; } -@media (max-width:24.9375rem) { - .c0 { - height: 1.25rem; - padding: 0.25rem 0.25rem 0; - } -} - `; @@ -506,18 +346,14 @@ exports[`MediaIndicator should render video indicator correctly when inline 1`] } .c0 { - padding: 0.5rem 0.25rem; + color: #222222; background-color: #FFFFFF; - display: block; font-family: ReithSans,Helvetica,Arial,sans-serif; font-weight: 400; font-style: normal; - font-size: 0.75rem; - line-height: 1rem; - color: #222222; - height: 2rem; display: inline-block; vertical-align: middle; + padding-right: 0.5rem; } .c1 { @@ -532,13 +368,6 @@ exports[`MediaIndicator should render video indicator correctly when inline 1`] height: 100%; } -@media (max-width:24.9375rem) { - .c0 { - height: 1.25rem; - padding: 0.25rem 0.25rem 0; - } -} -