-
-
Save jeremeylduvall/d04e65ff196bb56abc94ab920d68c907 to your computer and use it in GitHub Desktop.
header.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import Link from 'gatsby-link'; | |
const Header = ( props ) => { | |
const bio = props.bio; | |
const username = props.username; | |
const src = props.src; | |
return ( | |
<div | |
style={ { | |
display: 'flex', | |
alignItems: 'center', | |
justifyContent: 'center', | |
flexWrap: 'wrap', | |
margin: '2em 2em', | |
} } | |
> | |
<span | |
style={ { | |
flexBasis: '120px', | |
height: '96px', | |
} } | |
> | |
<img | |
src={ src } | |
alt={ `Jeremey DuVall` } | |
style={ { | |
marginBottom: 0, | |
borderRadius: "50%", | |
width: '96px', | |
} } | |
/> | |
</span> | |
<span | |
style={ { | |
flexBasis: '500px', | |
flexGrow: 1, | |
} } | |
> | |
<Link | |
to='/' | |
activeStyle={ { | |
textDecoration: 'none', | |
color: '#000000' | |
} } | |
> | |
<h3 | |
dangerouslySetInnerHTML={ { __html: ( username ) } } | |
style={ { marginBottom: '0.2em' } } | |
/> | |
</Link> | |
<p | |
style={ { marginBottom: 0 } } | |
dangerouslySetInnerHTML={ { __html: ( bio ) } } | |
/> | |
</span> | |
</div> | |
) | |
} | |
Header.PropTypes = { | |
src: PropTypes.string, | |
username: PropTypes.string, | |
bio: PropTypes.string, | |
} | |
export default Header; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment