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

social component

This commit is contained in:
Matthias Kretschmann 2018-03-27 10:01:24 +02:00
parent 52943311e8
commit 7bcdc750a0
Signed by: m
GPG Key ID: 606EEEF3C479A91F
5 changed files with 55 additions and 37 deletions

View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import { CSSTransition } from 'react-transition-group' import CSSTransition from 'react-transition-group/CSSTransition'
import './FadeIn.css' import './FadeIn.css'
const FadeIn = (props) => ( const FadeIn = (props) => (

View File

@ -1,17 +1,7 @@
import React from 'react' import React from 'react'
import Social from './Social'
import './Header.css' import './Header.css'
import { meta, social } from '../../constants' import { meta } from '../../constants'
import { Twitter, GitHub, Facebook } from '../atoms/Icons'
const SocialIcon = ({title}) => {
if (title === 'Twitter') {
return <Twitter />
} else if (title === 'GitHub') {
return <GitHub />
} else if (title === 'Facebook') {
return <Facebook />
}
}
const Header = () => ( const Header = () => (
<header className="header"> <header className="header">
@ -20,13 +10,8 @@ const Header = () => (
<h1 className="header__title">{meta.title}</h1> <h1 className="header__title">{meta.title}</h1>
<p className="header__description">{meta.tagline}</p> <p className="header__description">{meta.tagline}</p>
</hgroup> </hgroup>
<aside className="social">
{social.map(link => ( <Social />
<a className="social__link" href={link.url} key={link.title} title={link.title}>
<SocialIcon title={link.title} />
</a>
))}
</aside>
</header> </header>
) )

View File

@ -37,20 +37,3 @@
.header__description { .header__description {
font-size: $font-size-large; font-size: $font-size-large;
} }
.social { // stylelint-disable-line
margin-top: $spacer;
}
.social__link {
margin-left: $spacer / 2;
margin-right: $spacer / 2;
background: $brand-grey-dimmed;
padding: $spacer / 4;
text-align: center;
display: inline-block;
width: 1.35rem;
height: 1.35rem;
box-shadow: 0 1px 3px rgba($brand-main, .2), 0 5px 16px rgba($brand-main, .15);
border-radius: .25rem;
}

View File

@ -0,0 +1,26 @@
import React from 'react'
import { Twitter, GitHub, Facebook } from '../atoms/Icons'
import { social } from '../../constants'
import './Social.css'
const SocialIcon = ({ title }) => {
if (title === 'Twitter') {
return <Twitter />
} else if (title === 'GitHub') {
return <GitHub />
} else if (title === 'Facebook') {
return <Facebook />
}
}
const Social = () => (
<aside className="social">
{social.map(link => (
<a className="social__link" href={link.url} key={link.title} title={link.title}>
<SocialIcon title={link.title} />
</a>
))}
</aside>
)
export default Social

View File

@ -0,0 +1,24 @@
@import 'variables';
.social {
margin-top: $spacer;
}
.social__link {
margin-left: $spacer / 2;
margin-right: $spacer / 2;
background: $brand-grey-dimmed;
padding: $spacer / 4;
text-align: center;
display: inline-block;
width: 1.35rem;
height: 1.35rem;
box-shadow: 0 3px 5px rgba($brand-main, .1), 0 5px 16px rgba($brand-main, .1);
border-radius: .25rem;
&:hover,
&:focus {
transform: translate3d(0, -.2rem, 0);
box-shadow: 0 6px 10px rgba($brand-main, .1), 0 10px 25px rgba($brand-main, .1);
}
}