diff --git a/.github/workflows/pizza.yml b/.github/workflows/pizza.yml index 7a768d83e..565104edd 100644 --- a/.github/workflows/pizza.yml +++ b/.github/workflows/pizza.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Pizza Action - uses: open-sauced/pizza-action@v2.1.0 + uses: open-sauced/pizza-action@v2.2.0 with: + cli-version: 'v2.1.0' commit-and-pr: 'true' + pr-title: 'chore: update repository codeowners' diff --git a/components/sections/blog/FeaturedPost.tsx b/components/sections/blog/FeaturedPost.tsx index c591d39d8..2a5a2b5eb 100644 --- a/components/sections/blog/FeaturedPost.tsx +++ b/components/sections/blog/FeaturedPost.tsx @@ -17,9 +17,9 @@ const FeaturedPost: FC = ({ data }): ReactElement => {
-
- Post cover -
+
+ Cover +
diff --git a/components/sections/blog/[slug]/PageContent.tsx b/components/sections/blog/[slug]/PageContent.tsx index df6876b4d..aed039a6b 100644 --- a/components/sections/blog/[slug]/PageContent.tsx +++ b/components/sections/blog/[slug]/PageContent.tsx @@ -1,5 +1,8 @@ -import React, { FC, ReactElement } from 'react' -import { Author as SanityAuthor, Blog as SanityBlog } from '../../../../sanity.types' +import React, { FC, ReactElement, useEffect, useState } from 'react' +import { + Author as SanityAuthor, + Blog as SanityBlog, +} from '../../../../sanity.types' import getReadTime from '../../../../utils/getReadTime' // Components @@ -21,8 +24,8 @@ import { BiCalendarAlt } from 'react-icons/bi' import AuthorBio from '../components/AuthorBio' interface PageContentProps { - pageContent: Omit & { author: SanityAuthor } - blogs: (Omit & { author: SanityAuthor })[] + pageContent: Omit & { author: SanityAuthor } + blogs: (Omit & { author: SanityAuthor })[] featuredPost?: boolean } @@ -32,21 +35,53 @@ const PageContent: FC = ({ featuredPost, }): ReactElement => { const { query } = useRouter() - const { topics, title, author, published_date, coverImage, blogContent, blogUrl, ogImage, summary, slug } = - pageContent + const { + topics, + title, + author, + published_date, + coverImage, + blogContent, + blogUrl, + ogImage, + summary, + slug, + } = pageContent const src = coverImage || '' const displayBlogs = blogs.filter((item) => item.slug?.current != query.slug) || [] - const absoluteURL = "https://opensauced.pizza/blog/"+slug?.current + const absoluteURL = 'https://opensauced.pizza/blog/' + slug?.current + const [height, setHeight] = useState('30rem'); + + useEffect(() => { + const handleResize = () => { + if (window.innerWidth < 640) { + setHeight('14rem'); // Small screens + } else if (window.innerWidth < 1024) { + setHeight('25rem'); // Medium screens + } else { + setHeight('30rem'); // Large screens + } + }; + + window.addEventListener('resize', handleResize); + + // Call the function once to set the initial size + handleResize(); + + // Cleanup the event listener on unmount + return () => window.removeEventListener('resize', handleResize); + }, []); + return ( <>
@@ -69,15 +104,16 @@ const PageContent: FC = ({ Clock
- {`${getReadTime(blogContent || "")} ${ - getReadTime(blogContent || "") === 1 ? 'min' : 'mins' - } read`} + + {`${getReadTime(blogContent || '')} ${ + getReadTime(blogContent || '') === 1 ? 'min' : 'mins' + } read`} - - { published_date && ( + + {published_date && ( <>
- +
@@ -88,16 +124,20 @@ const PageContent: FC = ({
- -
+ +
Cover
+ @@ -108,12 +148,7 @@ const PageContent: FC = ({
)} {!featuredPost && !!blogUrl && ( - +

diff --git a/components/sections/blog/components/Post.tsx b/components/sections/blog/components/Post.tsx index 963502878..9a0aea79a 100644 --- a/components/sections/blog/components/Post.tsx +++ b/components/sections/blog/components/Post.tsx @@ -57,12 +57,12 @@ const Post: FC = ({ data, featured }): ReactElement => {
- Cover + Cover
-
+
{topics?.map((item) => (
{`#${item}`} @@ -79,7 +79,7 @@ const Post: FC = ({ data, featured }): ReactElement => {
-
+
Author
diff --git a/pages/cli/index.tsx b/pages/cli/index.tsx index 7a6bdd40a..c812c0f04 100644 --- a/pages/cli/index.tsx +++ b/pages/cli/index.tsx @@ -5,7 +5,7 @@ import { getCommonData } from '../../lib/sanity'; import Footer from '../../components/sections/Footer'; import { Heading, Typography } from '../../components/common/text'; import { Button } from '../../components/common'; -import { TbArrowNarrowRight, TbCopy } from "react-icons/tb"; +import { TbArrowNarrowRight } from "react-icons/tb"; import Image from 'next/image'; export async function getStaticProps() { @@ -40,12 +40,11 @@ export default function CliPage({ commonData }: CliPageProps) { Try the pizza CLI and access OpenSauced features right from your terminal. Autogenerate your CODEOWNERS and contributor insights in seconds. -