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 #3611 from bbc/add-dark-mode-image-placeholder
Browse files Browse the repository at this point in the history
Implementing 'dark mode' for psammead-image-placeholder
  • Loading branch information
RichardPK authored Jul 20, 2020
2 parents 357092c + 11f6bfc commit c8bc945
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 1.2.4 | [PR#3611](https://github.com/bbc/psammead/pull/3611) Make placeholder darkmode compatible |
| 1.2.37 | [PR#3613](https://github.com/bbc/psammead/pull/3613) Talos - Bump Dependencies - @bbc/psammead-assets |
| 1.2.36 | [PR#3467](https://github.com/bbc/psammead/pull/3467) Talos - Bump Dependencies - @bbc/psammead-styles |
| 1.2.35 | [PR#3397](https://github.com/bbc/psammead/pull/3397) Talos - Bump Dependencies - @bbc/psammead-styles |
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-image-placeholder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The `psammead-image-placeholder` component is a `div` with a base-64 encoded SVG
| Argument | Type | Required | Default | Example |
| -------- | -------------------------------------- | -------- | ------- | ------- |
| Ratio | Number, ratio between height and width | Yes | N/A | 65.625 |
| darkMode | Bool, true (dark) or false (normal) | No | false | false |

## Usage

Expand Down

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

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-image-placeholder",
"version": "1.2.37",
"version": "1.2.4",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ImagePlaceholder should render dark mode version correctly 1`] = `
.c0 {
position: relative;
height: 0;
overflow: hidden;
background-color: #3F3F42;
background-position: center center;
background-repeat: no-repeat;
background-size: 30%;
padding-bottom: 56.25%;
width: 100%;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3OCIgaGVpZ2h0PSIyMyIgdmlld0JveD0iMCAwIDc4IDIzIj4KICAgIDxnIGZpbGw9IiM2RTZFNzMiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPHBhdGggZD0iTTUzLjA2NiAyMS44MDdINzYuMDhWLjE1SDUzLjA2NnYyMS42NTh6bTE0LjUtMTguNjQ1bC0uMzExLS4wNS0uMTI1LS4wMThjLS4xNzYtLjAyNC0uMzU1LS4wNDUtLjUzNS0uMDYyLS4xMjItLjAxMS0uMjQ1LS4wMi0uMzY3LS4wMjctLjIxOC0uMDE0LS40MzMtLjAyLS42NC0uMDItLjA5NSAwLS4xNDkuMDAyLS4yNDIuMDA0LS4xNzMuMDAzLS4zNDMuMDExLS41MS4wMjEtLjA5NS4wMDYtLjE4OS4wMTUtLjI4MS4wMjMtLjEzOC4wMTItLjI3My4wMjctLjQwNi4wNDRsLS4xMTEuMDE1LS4xMjQuMDE4LS4xNTMuMDI0LS4xOTcuMDM1Yy0uMDkuMDE2LS4xOC4wMzQtLjI2OS4wNTMtLjU0Ni4xMTUtMS4wNTEuMjY5LTEuNTE3LjQ1LS4yNC4wOTUtLjQ3Mi4xOTYtLjY5Mi4zMDMtLjE4Mi4wOS0uMzU5LjE4My0uNTI3LjI4LS4xNjUuMDk1LS4zMjIuMTktLjQ3NC4yOTItLjA4Ni4wNTgtLjE3My4xMTctLjI1NS4xNzctLjA3Mi4wNTEtLjE0My4xMDMtLjIxMi4xNTYtLjE0Ni4xMTMtLjI4Ny4yMjgtLjQxOC4zNDQtLjEyNC4xMS0uMjQ0LjIyLS4zNTUuMzMxLS4wOTYuMDk2LS4xOTMuMTk0LS4yODQuMjk2LS4wOTIuM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0uMjc0IDEuMDM1LS43MjRjLjIxLS4yMTEuOTYtLjg4OC45Ni0yLjUzMSAwLTEuNjU2LTEuMTAyLTIuNjA4LTEuMTAyLTIuNjA4cy0xLjIwNi0xLjQyNi0zLjkzLTEuNDI2SDYuMDYzeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLjUgLjQ5NikiLz4KICAgIDwvZz4KPC9zdmc+Cg==);
}
<div
class="c0"
/>
`;

exports[`ImagePlaceholder should render landscape images correctly 1`] = `
.c0 {
position: relative;
Expand Down
20 changes: 14 additions & 6 deletions packages/components/psammead-image-placeholder/src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
import styled from 'styled-components';
import { number } from 'prop-types';
import { C_CHALK } from '@bbc/psammead-styles/colours';
import { BBC_BLOCKS } from '@bbc/psammead-assets/svgs';
import { number, bool } from 'prop-types';
import { C_CHALK, C_SHADOW } from '@bbc/psammead-styles/colours';
import { BBC_BLOCKS, BBC_BLOCKS_DARK_MODE } from '@bbc/psammead-assets/svgs';

const bgImageDark = `url(data:image/svg+xml;base64,${BBC_BLOCKS_DARK_MODE})`;
const bgImageRegular = `url(data:image/svg+xml;base64,${BBC_BLOCKS})`;

const ImagePlaceholder = styled.div`
position: relative;
height: 0;
overflow: hidden;
background-color: ${C_CHALK};
background-color: ${({ darkMode }) => (darkMode ? C_SHADOW : C_CHALK)};
background-position: center center;
background-repeat: no-repeat;
background-size: 30%;
padding-bottom: ${props => props.ratio}%;
width: 100%;
/* placeholder BBC blocks SVG */
background-image: url(data:image/svg+xml;base64,${BBC_BLOCKS});
background-image: ${({ darkMode }) =>
darkMode ? bgImageDark : bgImageRegular};
`;

ImagePlaceholder.propTypes = {
ratio: number.isRequired,
darkMode: bool,
};

ImagePlaceholder.defaultProps = {
darkMode: false,
};

export default ImagePlaceholder;
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ storiesOf('Components|Images/ImagePlaceholder', module)
'9x16 image placeholder',
() => <ImagePlaceholder ratio={portraitImageRatio} />,
{ notes },
)
.add(
'16x9 dark mode image placeholder',
() => <ImagePlaceholder ratio={landscapeImageRatio} darkMode />,
{ notes },
);
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ describe('ImagePlaceholder', () => {
'should render square images correctly',
<ImagePlaceholder ratio={squareImageRatio} />,
);
shouldMatchSnapshot(
'should render dark mode version correctly',
<ImagePlaceholder ratio={landscapeImageRatio} darkMode />,
);
});

0 comments on commit c8bc945

Please sign in to comment.