1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-31 17:17:46 +01:00

remove Featured

This commit is contained in:
Matthias Kretschmann 2020-09-12 16:06:57 +02:00
parent 2d20a5a1b1
commit 96f43a4fb0
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 0 additions and 59 deletions

View File

@ -1,12 +0,0 @@
@import 'variables';
@import 'mixins';
.featured {
display: grid;
gap: $spacer;
grid-template-columns: repeat(2, 1fr);
@media (min-width: $screen-md) {
grid-template-columns: repeat(3, 1fr);
}
}

View File

@ -1,10 +0,0 @@
import React from 'react'
import { render } from '@testing-library/react'
import Featured from './Featured'
describe('Featured', () => {
it('renders correctly', () => {
const { container } = render(<Featured />)
expect(container.firstChild).toBeInTheDocument()
})
})

View File

@ -1,32 +0,0 @@
import React, { ReactElement } from 'react'
import { graphql, useStaticQuery } from 'gatsby'
import styles from './Featured.module.scss'
import { Post } from '../../@types/Post'
import PostTeaser from './PostTeaser'
const query = graphql`
query {
allMarkdownRemark(
filter: { frontmatter: { featured: { eq: true } } }
sort: { fields: [fields___date], order: DESC }
) {
edges {
node {
...PostTeaser
}
}
}
}
`
export default function Featured(): ReactElement {
const data = useStaticQuery(query)
return (
<div className={styles.featured}>
{data.allMarkdownRemark.edges.map(({ node }: { node: Post }) => (
<PostTeaser key={node.id} post={node} />
))}
</div>
)
}

View File

@ -10,11 +10,6 @@ import PostMore from '../components/templates/Post/More'
export default function Home(props: PageProps): ReactElement {
return (
<>
<section className={styles.section}>
<h2 className={styles.title}>Featured</h2>
<Featured />
</section>
<section className={styles.section}>
<h2 className={styles.title}>
Latest Articles <PostMore to="/archive">All Articles</PostMore>