mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-31 17:17:46 +01:00
remove Featured
This commit is contained in:
parent
2d20a5a1b1
commit
96f43a4fb0
@ -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);
|
||||
}
|
||||
}
|
@ -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()
|
||||
})
|
||||
})
|
@ -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>
|
||||
)
|
||||
}
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user