Skip to content

Commit

Permalink
feat: added links in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
zstix committed Jun 16, 2020
1 parent 6875798 commit 24cea99
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 9 deletions.
33 changes: 28 additions & 5 deletions src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'gatsby';
import cx from 'classnames';
import styles from './Footer.module.scss';

const Footer = () => (
const Footer = ({ showEdit }) => (
<footer className={styles.footer}>
<div className={styles.leftColumn}>
<Link to="/" className={`${styles.logo} logo`} />
<div className={styles.copyright}>
Copyright &copy; 2020 New Relic Inc.
<div className={cx('container', styles.container)}>
<div className={styles.left}>
<Link to="/" className={`${styles.logo} logo`} />
<div className={styles.copyright}>
Copyright &copy; 2020 New Relic Inc.
</div>
</div>

<div className={styles.right}>
{showEdit && (
<Link to="/" className={styles.edit}>
Edit this page
</Link>
)}
<Link to="/" className={styles.issue}>
Create an issue
</Link>
</div>
</div>
</footer>
);

Footer.propTypes = {
showEdit: PropTypes.bool,
};

Footer.defaultProps = {
showEdit: true,
};

export default Footer;
44 changes: 40 additions & 4 deletions src/components/Footer.module.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
.footer {
--footer-text-color: #7da5a8;

--footer-text-color: #70ccd3;
background-color: var(--color-neutrals-800);
color: var(--footer-text-color);
padding: 1.5rem 0;
margin-top: 10rem;
font-size: 0.75rem;
}

.leftColumn {
.container {
display: flex;
justify-content: space-between;
align-items: center;
}

.left {
display: flex;
align-items: center;

Expand All @@ -25,7 +31,6 @@
}

.copyright {
font-size: 0.75rem;
margin-left: 1rem;
padding: 0.75rem 0.5rem;
border-left: 1px dotted var(--color-neutrals-700);
Expand All @@ -36,3 +41,34 @@
padding: 0.5rem;
}
}

.right {
display: flex;

a {
color: var(--footer-text-color);
margin-left: 1rem;
padding: 0.2rem;
padding-right: 0;
display: flex;
align-items: center;

&:before {
content: '';
display: inline-block;
height: 1rem;
width: 1rem;
background-repeat: no-repeat;
background-position: center center;
margin-right: 0.5rem;
}
}
}

.edit:before {
background-image: url('../images/edit.svg');
}

.issue:before {
background-image: url('../images/github.svg');
}
5 changes: 5 additions & 0 deletions src/components/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,9 @@ code {
font-size: 1.125rem;
line-height: 2rem;
}

.container {
max-width: 1200px;
margin: auto;
}
}

0 comments on commit 24cea99

Please sign in to comment.