Skip to content

Commit

Permalink
feat: Create Logo component and render inline instead of using a back…
Browse files Browse the repository at this point in the history
…ground image
  • Loading branch information
jerelmiller committed Jun 16, 2020
1 parent aac116c commit 57d1c15
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 8 deletions.
37 changes: 37 additions & 0 deletions src/components/Logo.js

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

3 changes: 3 additions & 0 deletions src/components/Logo.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.logo {
fill: none;
}
5 changes: 4 additions & 1 deletion src/components/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { Link } from 'gatsby';
import cx from 'classnames';

import Logo from './Logo';
import { link } from '../types';
import styles from './Sidebar.module.scss';

Expand All @@ -22,7 +23,9 @@ const renderNav = (page, index) => (

const Sidebar = ({ className, pages, isOpen, toggle }) => (
<aside className={cx(styles.sidebar, className, { [styles.isOpen]: isOpen })}>
<Link to="/" className={styles.logo} />
<Link to="/">
<Logo className={styles.logo} />
</Link>
<div className={styles.top}>
<h3>Pages</h3>
<button
Expand Down
10 changes: 3 additions & 7 deletions src/components/Sidebar.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.sidebar {
padding: 2rem 0;
border-right: 1px solid var(--color-neutrals-100);

ul {
margin: 0;
padding-left: 1rem;
Expand All @@ -9,7 +12,6 @@
text-decoration: none;
color: var(--color-black);
display: inline-block;
padding: 0.2rem 0;

&:hover {
text-decoration: underline;
Expand Down Expand Up @@ -59,11 +61,5 @@
}

.logo {
padding: 0;
background-size: contain;
background-repeat: no-repeat;
width: 247px;
height: 64px;
margin-right: 1rem;
background-image: url('../images/developers-logo.svg');
}

0 comments on commit 57d1c15

Please sign in to comment.