From 30ff4301bda338f0f0f65a66721c82c2b9740be0 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Tue, 16 Jun 2020 22:29:26 -0700 Subject: [PATCH] feat: Move New Relic logo to own component --- src/components/GlobalHeader.js | 8 +- src/components/GlobalHeader.module.scss | 14 +--- .../NewRelicLogo.js} | 79 ++++++++++++++++--- src/components/NewRelicLogo.module.scss | 3 + 4 files changed, 79 insertions(+), 25 deletions(-) rename src/{images/new-relic-logo.svg => components/NewRelicLogo.js} (69%) create mode 100644 src/components/NewRelicLogo.module.scss diff --git a/src/components/GlobalHeader.js b/src/components/GlobalHeader.js index 1fa3512ac..81ad67851 100644 --- a/src/components/GlobalHeader.js +++ b/src/components/GlobalHeader.js @@ -2,6 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import { Link } from 'gatsby'; +import NewRelicLogo from './NewRelicLogo'; import ExternalLink from './ExternalLink'; import styles from './GlobalHeader.module.scss'; @@ -11,8 +12,11 @@ const GlobalHeader = ({ className }) => {
- - New Relic + +
    diff --git a/src/components/GlobalHeader.module.scss b/src/components/GlobalHeader.module.scss index 15a824ad0..eea44b600 100644 --- a/src/components/GlobalHeader.module.scss +++ b/src/components/GlobalHeader.module.scss @@ -12,16 +12,10 @@ justify-content: space-between; } -.logo { - display: inline-block; - width: 79px; - height: 15px; - margin-right: 18px; - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - background-image: url('../images/new-relic-logo.svg'); - border: none; +.logoContainer { + display: flex; + align-items: center; + margin-right: 1rem; } .leftSideLinksContainer { diff --git a/src/images/new-relic-logo.svg b/src/components/NewRelicLogo.js similarity index 69% rename from src/images/new-relic-logo.svg rename to src/components/NewRelicLogo.js index c6ae7da6c..d7300ee2a 100644 --- a/src/images/new-relic-logo.svg +++ b/src/components/NewRelicLogo.js @@ -1,13 +1,66 @@ - - - - - - - - - - - - - +import React from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; +import styles from './NewRelicLogo.module.scss'; + +const NewRelicLogo = ({ className, size }) => ( + + + + + + + + + + + + + +); + +NewRelicLogo.propTypes = { + className: PropTypes.string, + size: PropTypes.string, +}; + +export default NewRelicLogo; diff --git a/src/components/NewRelicLogo.module.scss b/src/components/NewRelicLogo.module.scss new file mode 100644 index 000000000..b93d6b0f8 --- /dev/null +++ b/src/components/NewRelicLogo.module.scss @@ -0,0 +1,3 @@ +.logo { + width: var(--logo-size, 79px); +}