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

Fix cursor on placeholder for no-js #2806

Merged
merged 7 commits into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions packages/components/psammead-media-player/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| 2.4.2 | [PR#2806](https://github.com/bbc/psammead/pull/2806) Fix StyledPlaceholder cursor when Javascript is disabled |
| 2.4.1 | [PR#2773](https://github.com/bbc/psammead/pull/2773) Resolve warnings while running unit test |
| 2.4.0 | [PR#2662](https://github.com/bbc/psammead/pull/2662) Add no JS fallback & `noJsClassName` prop to Canonical MediaPlayer |
| 2.3.8 | [PR#2708](https://github.com/bbc/psammead/pull/2708) Talos - Bump Dependencies - @bbc/psammead-play-button |
Expand Down

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

2 changes: 1 addition & 1 deletion packages/components/psammead-media-player/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-media-player",
"version": "2.4.1",
"version": "2.4.2",
"description": "Provides a media player with optional placeholder",
"main": "dist/index.js",
"module": "esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,10 @@ exports[`Media Player: Placeholder should render no-js styles when noJsClassName
height: 100%;
}

.no-js .c1 {
cursor: default;
}

.c0:hover .c12,
.c0:focus .c12 {
background-color: #B80000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ const StyledPlaceholder = styled.div`
left: 0;
width: 100%;
height: 100%;

${({ noJsClassName }) =>
noJsClassName &&
css`
.${noJsClassName} & {
DenisHdz marked this conversation as resolved.
Show resolved Hide resolved
cursor: default;
}
`}
`;

const StyledPlayButton = styled(PlayButton)`
Expand Down Expand Up @@ -53,7 +61,7 @@ const Placeholder = ({
} = mediaInfo;

return (
<StyledPlaceholder onClick={onClick}>
<StyledPlaceholder onClick={onClick} noJsClassName={noJsClassName}>
<Guidance
service={service}
guidanceMessage={guidanceMessage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,10 @@ exports[`Media Player: Canonical Entry renders with no-js styles when noJsClassN
height: 100%;
}

.no-js .c2 {
cursor: default;
}

.c1:hover .c13,
.c1:focus .c13 {
background-color: #B80000;
Expand Down