From b47d03cb31c4a7a96f774150d26c18502e508959 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Tue, 29 Jan 2019 17:23:54 -0500 Subject: [PATCH] Switching to an SVG for CC license logo --- jest/static-file-transform.js | 7 + package.json | 3 +- .../Footer/__snapshots__/test.js.snap | 2 +- src/components/Footer/cc-by.svg | 121 ++++++++++++++++++ src/components/Footer/index.js | 4 +- 5 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 jest/static-file-transform.js create mode 100644 src/components/Footer/cc-by.svg diff --git a/jest/static-file-transform.js b/jest/static-file-transform.js new file mode 100644 index 0000000..ccb00f8 --- /dev/null +++ b/jest/static-file-transform.js @@ -0,0 +1,7 @@ +const path = require('path'); + +module.exports = { + process(src, filename) { + return `module.exports = ${ JSON.stringify(path.basename(filename)) };`; + } +}; diff --git a/package.json b/package.json index 147e611..ba87d9b 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,8 @@ ".cache" ], "transform": { - "\\.js$": "/jest/preprocess.js" + "\\.js$": "/jest/preprocess.js", + "\\.svg$": "/jest/static-file-transform.js" }, "transformIgnorePatterns": [ "node_modules/(?!(gatsby)/)" diff --git a/src/components/Footer/__snapshots__/test.js.snap b/src/components/Footer/__snapshots__/test.js.snap index 78580f3..3d08cd0 100644 --- a/src/components/Footer/__snapshots__/test.js.snap +++ b/src/components/Footer/__snapshots__/test.js.snap @@ -27,7 +27,7 @@ exports[`Footer rendering 1`] = ` > TRANSLATE(Creative Commons CC-BY-3.0 License) diff --git a/src/components/Footer/cc-by.svg b/src/components/Footer/cc-by.svg new file mode 100644 index 0000000..4bccd14 --- /dev/null +++ b/src/components/Footer/cc-by.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/src/components/Footer/index.js b/src/components/Footer/index.js index 4ade47e..4162840 100644 --- a/src/components/Footer/index.js +++ b/src/components/Footer/index.js @@ -2,6 +2,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import { withNamespaces, Trans } from 'react-i18next'; +import ccLogo from './cc-by.svg'; + import style from './style.module.css'; export const Footer = ({ t, buildId }) => ( @@ -16,7 +18,7 @@ export const Footer = ({ t, buildId }) => ( href="http://creativecommons.org/licenses/by/3.0/" rel="license external noopener noreferrer" target="_blank"> - {