1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-22 09:13:35 +01:00
This commit is contained in:
Matthias Kretschmann 2019-10-05 20:20:23 +02:00
parent d33f8825fd
commit 79bc5c5bcc
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 38 additions and 48 deletions

View File

@ -17,14 +17,8 @@
background: darken($body-background-color--dark, 2%); background: darken($body-background-color--dark, 2%);
} }
@media (min-width: $screen-md) {
margin-left: -100%;
margin-right: -18%;
padding-left: 80%;
}
> div { > div {
flex: 0 0 100%; flex: 1 1 100%;
border-bottom: 1px dashed rgba($brand-grey-light, 0.3); border-bottom: 1px dashed rgba($brand-grey-light, 0.3);
&:last-child { &:last-child {
@ -32,7 +26,7 @@
} }
@media (min-width: $screen-sm) { @media (min-width: $screen-sm) {
flex: 0 0 33.33333%; flex: 0 0 33%;
border-bottom: 0; border-bottom: 0;
border-left: 1px dashed rgba($brand-grey-light, 0.3); border-left: 1px dashed rgba($brand-grey-light, 0.3);

View File

@ -7,20 +7,10 @@ import { ReactComponent as Bitcoin } from '../../images/bitcoin.svg'
import { ReactComponent as GitHub } from '../../images/github.svg' import { ReactComponent as GitHub } from '../../images/github.svg'
import { useSiteMetadata } from '../../hooks/use-site-metadata' import { useSiteMetadata } from '../../hooks/use-site-metadata'
const ActionContent = ({ const ActionContent = ({ title, text }: { title: string; text: string }) => (
title,
text,
textLink
}: {
title: string
text: string
textLink: string
}) => (
<> <>
<h1 className={styles.actionTitle}>{title}</h1> <h1 className={styles.actionTitle}>{title}</h1>
<p className={styles.actionText}> <p className={styles.actionText}>{text}</p>
{text} <span className={styles.link}>{textLink}</span>
</p>
</> </>
) )
@ -33,11 +23,7 @@ const ActionTwitter = ({ slug }: { slug: string }) => {
href={`https://twitter.com/intent/tweet?text=@kremalicious&url=${siteUrl}${slug}`} href={`https://twitter.com/intent/tweet?text=@kremalicious&url=${siteUrl}${slug}`}
> >
<Twitter /> <Twitter />
<ActionContent <ActionContent title="Have a comment?" text="Hit me up @kremalicious" />
title="Have a comment?"
text="Hit me up"
textLink="@kremalicious"
/>
</a> </a>
) )
} }
@ -47,8 +33,7 @@ const ActionCrypto = ({ toggleModal }: { toggleModal(): void }) => (
<Bitcoin /> <Bitcoin />
<ActionContent <ActionContent
title="Found something useful?" title="Found something useful?"
text="Say thanks with" text="Say thanks with Bitcoins or Ether"
textLink="Bitcoins or Ether"
/> />
</button> </button>
) )
@ -58,8 +43,7 @@ const ActionGitHub = ({ githubLink }: { githubLink: string }) => (
<GitHub /> <GitHub />
<ActionContent <ActionContent
title="Edit on GitHub" title="Edit on GitHub"
text="Contribute to this post on" text="Contribute to this post on GitHub"
textLink="GitHub"
/> />
</a> </a>
) )

View File

@ -82,4 +82,12 @@
content: '#'; content: '#';
margin-right: 1px; margin-right: 1px;
} }
:global(.dark) & {
color: $brand-grey-light;
&::before {
color: $brand-grey;
}
}
} }

View File

@ -1,4 +1,5 @@
@import 'variables'; @import 'variables';
@import 'mixins';
.postTitle { .postTitle {
display: inline-block; display: inline-block;
@ -17,13 +18,17 @@
} }
.empty { .empty {
@include media-frame;
height: 100%; height: 100%;
min-height: 80px; min-height: 80px;
display: flex; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAACaADAAQAAAABAAAACQAAAAAvQpmhAAAAHElEQVQYGWNgoBL4T8gcggoIGcBA0ASCCmhsBQBhFwX7u70C8QAAAABJRU5ErkJggg==);
align-items: center;
padding: $spacer / 4;
.postTitle { a:hover & {
margin-top: 0; border-color: $link-color;
}
@media (min-width: $screen-md) {
min-height: 110px;
} }
} }

View File

@ -17,15 +17,11 @@ export default function PostTeaser({
<li> <li>
<Link to={slug} onClick={toggleSearch && toggleSearch}> <Link to={slug} onClick={toggleSearch && toggleSearch}>
{image ? ( {image ? (
<> <Image fluid={image.childImageSharp.fluid} alt={title} />
<Image fluid={image.childImageSharp.fluid} alt={title} />
<h4 className={styles.postTitle}>{title}</h4>
</>
) : ( ) : (
<div className={styles.empty}> <div className={styles.empty} />
<h4 className={styles.postTitle}>{title}</h4>
</div>
)} )}
<h4 className={styles.postTitle}>{title}</h4>
</Link> </Link>
</li> </li>
) )

View File

@ -14,15 +14,18 @@ const page = {
} }
interface PhotoNode { interface PhotoNode {
id: string node: {
fields: { slug: string } id: string
frontmatter: { fields: { slug: string }
title: string frontmatter: {
image: { childImageSharp: { fluid: FluidObject } } title: string
type: string
image: { childImageSharp: { fluid: FluidObject } }
}
} }
} }
const PhotoThumbs = ({ edges }: { edges: [{ node: PhotoNode }] }) => const PhotoThumbs = ({ edges }: { edges: PhotoNode[] }) =>
edges.map(({ node }) => { edges.map(({ node }) => {
const { title, image } = node.frontmatter const { title, image } = node.frontmatter
const { slug } = node.fields const { slug } = node.fields
@ -42,7 +45,7 @@ export default function Photos({
data, data,
location location
}: { }: {
data: { photos: { edges: [{ node: PhotoNode }] } } data: { photos: { edges: PhotoNode[] } }
location: Location location: Location
}) { }) {
return ( return (