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

Remove unused offscreen text from psammead-media-indicator #1240

Merged
merged 16 commits into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from 12 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
21 changes: 21 additions & 0 deletions lerna-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
0 silly argv { _: [ 'exec' ],
andrew-nowak marked this conversation as resolved.
Show resolved Hide resolved
0 silly argv parallel: true,
0 silly argv args: [],
0 silly argv '--':
0 silly argv [ 'babel',
0 silly argv 'src',
0 silly argv '-d',
0 silly argv 'dist',
0 silly argv '--ignore',
0 silly argv '\'**/*.test.js,**/*.test.jsx,**/*.stories.js,**/*.stories.jsx\'',
0 silly argv '--root-mode',
0 silly argv 'upward' ],
0 silly argv lernaVersion: '3.15.0',
0 silly argv '$0':
0 silly argv '/Users/bopchy/Documents/engagement/bbc/psammead/node_modules/.bin/lerna' }
1 notice cli v3.15.0
2 verbose rootPath /Users/bopchy/Documents/engagement/bbc/psammead
3 info versioning independent
4 error JSONError: Unexpected token } in JSON at position 782 while parsing near '...tyles": "^1.1.3", }, "devDependencie...' in packages/components/psammead-media-indicator/package.json
4 error at module.exports (/Users/bopchy/Documents/engagement/bbc/psammead/node_modules/parse-json/index.js:26:19)
4 error at parse (/Users/bopchy/Documents/engagement/bbc/psammead/node_modules/@lerna/project/node_modules/load-json-file/index.js:8:29)
3 changes: 2 additions & 1 deletion packages/components/psammead-media-indicator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<!-- prettier-ignore -->
| Version | Description |
| ------- | ----------- |
| 3.0.0 | [PR#1240](https://github.com/bbc/psammead/pull/1240) Remove unused offscreen text |
| 2.2.0 | [PR#1243](https://github.com/bbc/psammead/pull/1243) Add photogallery media icon |
| 2.1.0 | [PR#1233](https://github.com/bbc/psammead/pull/1233) Add ESM modules entry |
| 2.0.2 | [PR#1181](https://github.com/bbc/psammead/pull/1181) use `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`|
| 2.0.2 | [PR#1181](https://github.com/bbc/psammead/pull/1181) use `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`|
| 2.0.1 | [PR#1082](https://github.com/bbc/psammead/pull/1082) Bump lodash security vulnerability |
| 2.0.0 | [PR#940](https://github.com/bbc/psammead/pull/940) Apply font based on service prop |
| 1.1.4 | [PR#1038](https://github.com/bbc/psammead/pull/1038) Bump dependencies |
Expand Down
2 changes: 0 additions & 2 deletions packages/components/psammead-media-indicator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ The `MediaIndicator` component provides a 'play', 'audio' or 'camera' icon as we
| ------------- | ------ | -------- | ------- | ---------------------------- |
| duration | string | No | Null | '2:15' |
| datetime | string | No | Null | 'PT2M15S' |
| offscreenText | string | No | Null | 'Video' |
| type | string | No | 'video' | 'audio' |
| topStory | boolean | No | false | true |
| service | string | Yes | N/A | `'news'` |
Expand All @@ -40,7 +39,6 @@ import MediaIndicator from '@bbc/psammead-media-indicator';
<MediaIndicator
duration="2:15"
datetime="PT2M15S"
offscreenText="Audio"
type="audio"
service="news"
/>;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions packages/components/psammead-media-indicator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-media-indicator",
"version": "2.2.0",
"version": "3.0.0",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand All @@ -20,8 +20,7 @@
"homepage": "https://github.com/bbc/psammead/blob/latest/packages/components/psammead-media-indicator/README.md",
"dependencies": {
"@bbc/gel-foundations": "^3.0.3",
"@bbc/psammead-styles": "^1.1.3",
"@bbc/psammead-visually-hidden-text": "^1.0.7"
"@bbc/psammead-styles": "^1.1.3"
},
"devDependencies": {
"@bbc/psammead-storybook-helpers": "^3.1.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
// 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;
margin: 0;
}

.c2 {
vertical-align: middle;
margin: 0 0.25rem;
Expand Down Expand Up @@ -47,7 +35,7 @@ exports[`MediaIndicator - Top Story should render a top story audio promo render
height: 100%;
}

.c4 {
.c3 {
vertical-align: middle;
margin: 0 0.25rem;
}
Expand All @@ -73,13 +61,8 @@ exports[`MediaIndicator - Top Story should render a top story audio promo render
d="M10.596.199l-.525.562c1.35 1.35 2.175 3.225 2.175 5.25s-.825 3.9-2.175 5.25l.525.525c1.5-1.462 2.4-3.525 2.4-5.775s-.9-4.312-2.4-5.812zM6.996 1.511l-2.25 2.25H.996v4.5h3.75l2.25 2.25z"
/>
</svg>
<span
class="c3"
>
Audio
</span>
<time
class="c4"
class="c3"
datetime="PT2M15S"
>
2:15
Expand All @@ -89,18 +72,6 @@ exports[`MediaIndicator - Top Story should render a top story audio promo render
`;

exports[`MediaIndicator should render audio correctly without duration details 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;
margin: 0;
}

.c2 {
vertical-align: middle;
margin: 0 0.25rem;
Expand Down Expand Up @@ -163,28 +134,11 @@ exports[`MediaIndicator should render audio correctly without duration details 1
d="M10.596.199l-.525.562c1.35 1.35 2.175 3.225 2.175 5.25s-.825 3.9-2.175 5.25l.525.525c1.5-1.462 2.4-3.525 2.4-5.775s-.9-4.312-2.4-5.812zM6.996 1.511l-2.25 2.25H.996v4.5h3.75l2.25 2.25z"
/>
</svg>
<span
class="c3"
>
Audio
</span>
</div>
</div>
`;

exports[`MediaIndicator should render audio indicator 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;
margin: 0;
}

.c2 {
vertical-align: middle;
margin: 0 0.25rem;
Expand Down Expand Up @@ -219,7 +173,7 @@ exports[`MediaIndicator should render audio indicator correctly 1`] = `
height: 100%;
}

.c4 {
.c3 {
vertical-align: middle;
margin: 0 0.25rem;
}
Expand Down Expand Up @@ -252,13 +206,8 @@ exports[`MediaIndicator should render audio indicator correctly 1`] = `
d="M10.596.199l-.525.562c1.35 1.35 2.175 3.225 2.175 5.25s-.825 3.9-2.175 5.25l.525.525c1.5-1.462 2.4-3.525 2.4-5.775s-.9-4.312-2.4-5.812zM6.996 1.511l-2.25 2.25H.996v4.5h3.75l2.25 2.25z"
/>
</svg>
<span
class="c3"
>
Audio
</span>
<time
class="c4"
class="c3"
datetime="PT2M15S"
>
2:15
Expand Down Expand Up @@ -337,18 +286,6 @@ exports[`MediaIndicator should render photogallery correctly 1`] = `
`;

exports[`MediaIndicator should render video by default 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;
margin: 0;
}

.c2 {
vertical-align: middle;
margin: 0 0.25rem;
Expand Down Expand Up @@ -408,28 +345,11 @@ exports[`MediaIndicator should render video by default 1`] = `
points="3,32 29,16 3,0"
/>
</svg>
<span
class="c3"
>
Video
</span>
</div>
</div>
`;

exports[`MediaIndicator should render video correctly without duration details 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;
margin: 0;
}

.c2 {
vertical-align: middle;
margin: 0 0.25rem;
Expand Down Expand Up @@ -489,28 +409,11 @@ exports[`MediaIndicator should render video correctly without duration details 1
points="3,32 29,16 3,0"
/>
</svg>
<span
class="c3"
>
Video
</span>
</div>
</div>
`;

exports[`MediaIndicator should render video indicator 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;
margin: 0;
}

.c2 {
vertical-align: middle;
margin: 0 0.25rem;
Expand Down Expand Up @@ -545,7 +448,7 @@ exports[`MediaIndicator should render video indicator correctly 1`] = `
height: 100%;
}

.c4 {
.c3 {
vertical-align: middle;
margin: 0 0.25rem;
}
Expand Down Expand Up @@ -575,13 +478,8 @@ exports[`MediaIndicator should render video indicator correctly 1`] = `
points="3,32 29,16 3,0"
/>
</svg>
<span
class="c3"
>
Video
</span>
<time
class="c4"
class="c3"
datetime="PT2M15S"
>
2:15
Expand Down
15 changes: 1 addition & 14 deletions packages/components/psammead-media-indicator/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import styled, { css } from 'styled-components';
import { string, oneOf, bool } from 'prop-types';
import { C_WHITE, C_EBON } from '@bbc/psammead-styles/colours';
import VisuallyHiddenText from '@bbc/psammead-visually-hidden-text';
import { GEL_SPACING, GEL_SPACING_HLF } from '@bbc/gel-foundations/spacings';
import { GEL_GROUP_1_SCREEN_WIDTH_MAX } from '@bbc/gel-foundations/breakpoints';
import { GEL_MINION } from '@bbc/gel-foundations/typography';
Expand Down Expand Up @@ -39,24 +38,14 @@ const TimeDuration = styled.time`
margin: 0 ${GEL_SPACING_HLF};
`;

const MediaIndicator = ({
datetime,
duration,
offscreenText,
type,
topStory,
service,
}) => (
const MediaIndicator = ({ datetime, duration, type, topStory, service }) => (
<MediaIndicatorWrapper
aria-hidden="true"
topStory={topStory}
service={service}
>
<FlexWrapper>
{mediaIcons[type]}
{offscreenText && (
<VisuallyHiddenText>{offscreenText}</VisuallyHiddenText>
)}
{duration && datetime && (
<TimeDuration dateTime={datetime}>{duration}</TimeDuration>
)}
Expand All @@ -67,7 +56,6 @@ const MediaIndicator = ({
MediaIndicator.propTypes = {
datetime: string,
duration: string,
offscreenText: string,
type: oneOf(['video', 'audio', 'photogallery']),
topStory: bool,
service: string.isRequired,
Expand All @@ -76,7 +64,6 @@ MediaIndicator.propTypes = {
MediaIndicator.defaultProps = {
datetime: null,
duration: null,
offscreenText: null,
type: 'video',
topStory: false,
};
Expand Down
Loading