1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 17:23:22 +01:00

social tweaks

This commit is contained in:
Matthias Kretschmann 2018-04-11 13:53:35 +02:00
parent 1418acd097
commit f9de0c8600
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 40 additions and 33 deletions

View File

@ -1,15 +1,17 @@
import React from 'react'
import PropTypes from 'prop-types'
import Social from './Social'
import './Footer.scss'
const Footer = ({ meta }) => {
const year = new Date().getFullYear()
return (
<footer className="footer">
<small>&copy; {year} {meta.title} &mdash; All Rights Reserved</small>
return <footer className="footer">
<Social meta={meta} minimal />
<small>
&copy; {year} {meta.title} &mdash; All Rights Reserved
</small>
</footer>
)
}
Footer.propTypes = {

View File

@ -9,4 +9,9 @@
small {
font-size: $font-size-mini;
}
.social {
margin-top: 0;
margin-bottom: $spacer;
}
}

View File

@ -8,17 +8,15 @@ const Header = ({ meta }) => {
const isHomepage = location.pathname === '/'
const classes = isHomepage ? 'header' : 'header header--minimal'
return (
<header className={classes}>
return <header className={classes}>
<Link className="header__name" to={'/'}>
<span className="header__logo"></span>
<h1 className="header__title">{meta.title}</h1>
<p className="header__description">{meta.tagline}</p>
</Link>
<Social meta={meta} />
<Social meta={meta} minimal={!isHomepage} />
</header>
)
}
Header.propTypes = {

View File

@ -98,27 +98,4 @@
text-align: right;
justify-content: flex-end;
}
.social__link {
width: 1rem;
height: 1rem;
padding: $spacer / 8;
margin-left: $spacer / 4;
margin-right: $spacer / 4;
background: transparent;
box-shadow: none;
transform: none;
.icon {
fill: $brand-grey-light;
transition: .2s ease-out;
}
&:hover,
&:focus {
.icon {
fill: $brand-grey;
}
}
}
}

View File

@ -14,11 +14,12 @@ const SocialIcon = ({ title }) => {
}
}
const Social = ({ meta }) => {
const Social = ({ meta, minimal }) => {
const social = meta.social
const classes = minimal ? 'social social--minimal' : 'social'
return (
<aside className="social">
<aside className={classes}>
{Object.keys(social).map((key, i) => (
<OutboundLink className="social__link" href={social[key]} key={i} title={key}>
<SocialIcon title={key} />
@ -30,6 +31,7 @@ const Social = ({ meta }) => {
Social.propTypes = {
meta: PropTypes.object,
minimal: PropTypes.bool,
}
export default Social

View File

@ -28,4 +28,27 @@
transform: translate3d(0, -.2rem, 0);
box-shadow: 0 6px 10px rgba($brand-main, .1), 0 10px 25px rgba($brand-main, .1);
}
.social--minimal & {
width: 1rem;
height: 1rem;
padding: $spacer / 8;
margin-left: $spacer / 4;
margin-right: $spacer / 4;
background: transparent;
box-shadow: none;
transform: none;
.icon {
fill: $brand-grey-light;
transition: .2s ease-out;
}
&:hover,
&:focus {
.icon {
fill: $brand-grey;
}
}
}
}