Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase author link visibility & link avatars in blog posts + previews #5813

Merged
merged 6 commits into from
Jun 27, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 18 additions & 6 deletions www/src/components/blog-post-preview-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,21 @@ class BlogPostPreviewItem extends React.Component {
marginBottom: rhythm(2),
}}
>
<Img
<Link
to={post.frontmatter.author.fields.slug}
css={{
position: `relative`,
zIndex: 1,
"&&": {
boxShadow: `none !important`,
borderBottom: `0 !important`,
fontWeight: `normal`,
":hover": {
background: `transparent`,
},
},
}}
><Img
alt=""
resolutions={avatar}
css={{
Expand All @@ -37,7 +51,7 @@ class BlogPostPreviewItem extends React.Component {
// prevents image twitch in Chrome when hovering the card
transform: `translateZ(0)`,
}}
/>
/></Link>
<div
css={{
display: `inline-block`,
Expand All @@ -56,15 +70,13 @@ class BlogPostPreviewItem extends React.Component {
<Link
to={post.frontmatter.author.fields.slug}
css={{
boxShadow: `none !important`,
borderBottom: `0 !important`,
position: `relative`,
zIndex: 1,
"&&": {
color: `${colors.gatsby} !important`,
fontWeight: `normal`,
":hover": {
color: colors.gatsby,
background: `transparent`,
background: colors.ui.bright,
},
},
}}
Expand Down
17 changes: 14 additions & 3 deletions www/src/templates/template-blog-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class BlogPostTemplate extends React.Component {
flex: `0 0 auto`,
}}
>
<Img
<Link to={post.frontmatter.author.fields.slug}><Img
resolutions={
post.frontmatter.author.avatar.childImageSharp.resolutions
}
Expand All @@ -147,7 +147,7 @@ class BlogPostTemplate extends React.Component {
display: `inline-block`,
verticalAlign: `middle`,
}}
/>
/></Link>
</div>
<div
css={{
Expand All @@ -161,9 +161,20 @@ class BlogPostTemplate extends React.Component {
...scale(0),
fontWeight: 400,
margin: 0,
color: `${colors.gatsby} !important`,
}}
>
{post.frontmatter.author.id}
<span css={{
borderBottom: `1px solid ${colors.ui.bright}`,
boxShadow: `inset 0 -2px 0 0 ${colors.ui.bright}`,
transition: `all ${presets.animation.speedFast} ${
presets.animation.curveDefault
}`,
"&:hover": {
background: colors.ui.bright,
},
}}
>{post.frontmatter.author.id}</span>
</h4>
</Link>
<BioLine>{post.frontmatter.author.bio}</BioLine>
Expand Down