diff --git a/src/components/News.tsx b/src/components/News.tsx index 5c84983edd786a56d306e85f56248a9fcfcd2fab..8e904cdc1ae914671e5181043b7de8068faaf8d7 100644 --- a/src/components/News.tsx +++ b/src/components/News.tsx @@ -12,6 +12,7 @@ interface INews { classname?: string } anime?: boolean + size?: "xs" | "base" | "xl" } const News = (props: INews) => { @@ -21,7 +22,7 @@ const News = (props: INews) => { news( limit: 3 filter: { status: { _eq: "published" } } - sort: "-date_published" + sort: ["-pinned", "-date_published"] ) { id slug @@ -41,7 +42,7 @@ const News = (props: INews) => { } `) - const { title = "", anime = true, action } = props + const { title = "", anime = true, action, size = "xs" } = props const news = data.directus.news.map((dtNew) => { return { @@ -49,6 +50,7 @@ const News = (props: INews) => { description: dtNew.content, image: dtNew.image?.imageFile, url: "/news/" + dtNew.slug, + size: size, } }) diff --git a/src/pages-doc/doc/news.tsx b/src/pages-doc/doc/news.tsx index dc545055bbd7281df5d2e149ac53ab0e5673a6ce..1e69eef788697e5dc2afb2be92d2bafbbea6cd23 100644 --- a/src/pages-doc/doc/news.tsx +++ b/src/pages-doc/doc/news.tsx @@ -1,7 +1,7 @@ import React, { ReactElement } from "react" -import { } from "gatsby" +import {} from "gatsby" -import { Content,Link ,News } from "@onegeo/gatsby-theme-onegeo" +import { Content, Link, News } from "@onegeo/gatsby-theme-onegeo" function news(): ReactElement { return ( @@ -23,6 +23,7 @@ interface INews { classname?: string; }; anime?: boolean; + size?: "xs" | "base" | "xl"; } GraphQL query @@ -32,7 +33,7 @@ GraphQL query news( limit: 3 filter: { status: { _eq: "published" } } - sort: "-date_published" + sort: ["-pinned", "-date_published"] ) { id content