mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-05 07:24:28 +01:00
feat: add shock the web section
This commit is contained in:
@@ -182,7 +182,7 @@ export type AllCategoriesQuery = { __typename?: 'Query', allCategories: Array<{
|
||||
export type ExploreProjectsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type ExploreProjectsQuery = { __typename?: 'Query', allCategories: Array<{ __typename?: 'Category', id: number, title: string, project: Array<{ __typename?: 'Project', id: number, thumbnail_image: string, title: string, votes_count: number }> }>, newProjects: Array<{ __typename?: 'Project', id: number, title: string, thumbnail_image: string, votes_count: number, category: { __typename?: 'Category', title: string, id: number } }> };
|
||||
export type ExploreProjectsQuery = { __typename?: 'Query', allCategories: Array<{ __typename?: 'Category', id: number, title: string, project: Array<{ __typename?: 'Project', id: number, thumbnail_image: string, title: string, votes_count: number, category: { __typename?: 'Category', title: string, id: number } }> }>, newProjects: Array<{ __typename?: 'Project', id: number, title: string, thumbnail_image: string, votes_count: number, category: { __typename?: 'Category', title: string, id: number } }> };
|
||||
|
||||
export type HottestProjectsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
@@ -384,6 +384,10 @@ export const ExploreProjectsDocument = gql`
|
||||
thumbnail_image
|
||||
title
|
||||
votes_count
|
||||
category {
|
||||
title
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
newProjects {
|
||||
|
||||
@@ -14,18 +14,24 @@ export default function ProjectsSection() {
|
||||
{Array(3).fill(0).map((_, idx) => <ProjectsRowSkeleton key={idx} />)}
|
||||
</div>;
|
||||
|
||||
const shockTheWebCategory = data.allCategories.find(c => c.id === 11);
|
||||
const restCategories = data.allCategories.filter(c => c.id !== 11)
|
||||
|
||||
return (
|
||||
<div className='mt-32 lg:mt-48'>
|
||||
<ProjectsRow title={shockTheWebCategory?.title}
|
||||
categoryId={shockTheWebCategory?.id!}
|
||||
projects={shockTheWebCategory?.project!} />
|
||||
<ProjectsRow title={<><span className="align-middle mr-8">Newest</span> <MdLocalFireDepartment className='inline-block text-fire scale-125 ' /></>}
|
||||
categoryId={0}
|
||||
projects={data.newProjects} />
|
||||
{data.allCategories.map(({ id, title, project, }) => {
|
||||
{restCategories.map(({ id, title, project, }) => {
|
||||
if (project)
|
||||
return <ProjectsRow
|
||||
key={id}
|
||||
categoryId={id}
|
||||
title={title}
|
||||
projects={project.map(p => ({ ...p, category: { id, title } }))} />
|
||||
projects={project} />
|
||||
else return null
|
||||
})}
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,10 @@ query ExploreProjects {
|
||||
thumbnail_image
|
||||
title
|
||||
votes_count
|
||||
category {
|
||||
title
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
newProjects {
|
||||
|
||||
Reference in New Issue
Block a user