import React from 'react' import {graphql} from 'gatsby' import Container from '../components/container' import GraphQLErrorList from '../components/graphql-error-list' import ProjectPreviewGrid from '../components/project-preview-grid' import SEO from '../components/seo' import Layout from '../containers/layout' import {mapEdgesToNodes, filterOutDocsWithoutSlugs} from '../lib/helpers' import {responsiveTitle1} from '../components/typography.module.css' export const query = graphql` query ArchivePageQuery { projects: allSanityProject( limit: 12 sort: {fields: [publishedAt], order: DESC} filter: {slug: {current: {ne: null}}, publishedAt: {ne: null}} ) { edges { node { id mainImage { asset { _id } alt } title _rawExcerpt slug { current } } } } } ` const ArchivePage = props => { const {data, errors} = props if (errors) { return ( ) } const projectNodes = data && data.projects && mapEdgesToNodes(data.projects).filter(filterOutDocsWithoutSlugs) return (

Projects

{projectNodes && projectNodes.length > 0 && }
) } export default ArchivePage