Skip to content

Commit

Permalink
chore: fixed eslint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline committed Aug 8, 2024
1 parent 18270cb commit 57d330a
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 87 deletions.
62 changes: 31 additions & 31 deletions components/sections/home-page/Newsletter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ import StrokeR3 from '../../../public/background-strokes/_3_rightStroke.svg'
import StrokeL3 from '../../../public/background-strokes/_3_leftStroke.svg'

const Newsletter = () => {
const handleSubscribeClick = () => {
window.open("https://news.opensauced.pizza/#/portal/signup", "_blank");
};
const handleSubscribeClick = () => {
window.open('https://news.opensauced.pizza/#/portal/signup', '_blank')
}

return (
<SectionWrapper pt={100} pb={250}>
<div className="relative w-screen">
<div className="absolute largeTablet:block top-[-14rem] largeTablet:-top-[10rem] left-[-30rem] largeTablet:left-[-15rem]">
<Image alt="Doodles" src={StrokeL3} />
</div>
<div className="absolute largeTablet:block top-[-14rem] largeTablet:-top-[22rem] right-[-34rem] largeTablet:-right-[32rem]">
<Image alt="Doodles" src={StrokeR3} />
</div>
</div>
<div className="flex flex-col items-center gap-y-8">
<Heading alignSmall="center">
$orange-to-yellowThe fast track$orange-to-yellow to open source
</Heading>
<Typography alignSmall="center" variant="body1" >
Stay up to date with the latest OpenSauced news and trends.
</Typography>
<GradientBorderWrapper>
<button
onClick={handleSubscribeClick}
className="relative box-border px-4 flex items-center justify-center w-[280px] h-[38px] text-[#FEEADD] pr-4 py-3 text-sm font-medium bg-[#211E1C] rounded-md largeTablet:w-[394px]"
>
<span className="text-brandOrange">Subscribe</span>
</button>
</GradientBorderWrapper>
</div>
</SectionWrapper>
)
return (
<SectionWrapper pt={100} pb={250}>
<div className="relative w-screen">
<div className="absolute largeTablet:block top-[-14rem] largeTablet:-top-[10rem] left-[-30rem] largeTablet:left-[-15rem]">
<Image alt="Doodles" src={StrokeL3} />
</div>
<div className="absolute largeTablet:block top-[-14rem] largeTablet:-top-[22rem] right-[-34rem] largeTablet:-right-[32rem]">
<Image alt="Doodles" src={StrokeR3} />
</div>
</div>
<div className="flex flex-col items-center gap-y-8">
<Heading alignSmall="center">
$orange-to-yellowThe fast track$orange-to-yellow to open source
</Heading>
<Typography alignSmall="center" variant="body1">
Stay up to date with the latest OpenSauced news and trends.
</Typography>
<GradientBorderWrapper>
<button
onClick={handleSubscribeClick}
className="relative box-border px-4 flex items-center justify-center w-[280px] h-[38px] text-[#FEEADD] pr-4 py-3 text-sm font-medium bg-[#211E1C] rounded-md largeTablet:w-[394px]"
>
<span className="text-brandOrange">Subscribe</span>
</button>
</GradientBorderWrapper>
</div>
</SectionWrapper>
)
}
export default Newsletter
126 changes: 70 additions & 56 deletions pages/maintainers/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import type { NextPage } from 'next'
import {
getAllBlogs,
getCommonData,
getFeaturedBlogs,
getMaintainersPageData
getAllBlogs,
getCommonData,
getFeaturedBlogs,
getMaintainersPageData,
} from '../../lib/sanity'
import {
Blog as SanityBlog,
Footer as SanityFooter,
MaintainersPage as SanityMaintainersPage,
Navigation as SanityNavigation,
Seo as SanitySeo,
User as SanityUser,
Blog as SanityBlog,
Footer as SanityFooter,
MaintainersPage as SanityMaintainersPage,
Navigation as SanityNavigation,
Seo as SanitySeo,
User as SanityUser,
} from '../../sanity.types'
import Hero from '../../components/sections/home-page/Hero'
import Logos from '../../components/sections/home-page/Logos'
Expand All @@ -23,64 +23,78 @@ import TeamsFeatures from '../../components/sections/home-page/features/TeamsFea
import CTA from '../../components/sections/teams/CTA'

interface MaintainersPageProps {
data: {
commonData: {
navigationLinks: SanityNavigation[]
seoData: SanitySeo
footer: SanityFooter[]
}
maintainersPageData: SanityMaintainersPage
blogs: SanityBlog[]
featuredBlogs: SanityBlog[]
data: {
commonData: {
navigationLinks: SanityNavigation[]
seoData: SanitySeo
footer: SanityFooter[]
}
maintainersPageData: SanityMaintainersPage
blogs: SanityBlog[]
featuredBlogs: SanityBlog[]
}
}

const MaintainersPage: NextPage<MaintainersPageProps> = ({
data: { commonData, maintainersPageData, blogs, featuredBlogs },
data: { commonData, maintainersPageData, blogs, featuredBlogs },
}) => {
const displayBlogs = [...blogs, ...featuredBlogs].sort(
(a, b) => +new Date(b._createdAt) - +new Date(a._createdAt)
)
const displayBlogs = [...blogs, ...featuredBlogs].sort(
(a, b) => +new Date(b._createdAt) - +new Date(a._createdAt)
)

return (
<PageLayout
seoData={commonData.seoData}
navigationURLs={commonData.navigationLinks}
BackgroundWrapper={Background}
>
<Hero data={maintainersPageData.hero as unknown as SanityMaintainersPage['hero']} />
<Logos data={maintainersPageData.hero?.users as unknown as SanityUser[] || []} />
<TeamsFeatures topUseCase={maintainersPageData.topUseCase} features={maintainersPageData.features} />
<CTA data={maintainersPageData.ctaSection} />
<Blogs
data={{
// _type: "blogSection",
title: "Our secret sauce",
heading: "$yellow-to-orange OpenSauced$yellow-to-orange Blog",
description: "Musings on the open-source community, engineering, and the future of talent acquisition."
}}
blogs={displayBlogs.slice(0, 4)} />
<Newsletter />
</PageLayout>
)
return (
<PageLayout
seoData={commonData.seoData}
navigationURLs={commonData.navigationLinks}
BackgroundWrapper={Background}
>
<Hero
data={
maintainersPageData.hero as unknown as SanityMaintainersPage['hero']
}
/>
<Logos
data={
(maintainersPageData.hero?.users as unknown as SanityUser[]) || []
}
/>
<TeamsFeatures
topUseCase={maintainersPageData.topUseCase}
features={maintainersPageData.features}
/>
<CTA data={maintainersPageData.ctaSection} />
<Blogs
data={{
// _type: "blogSection",
title: 'Our secret sauce',
heading: '$yellow-to-orange OpenSauced$yellow-to-orange Blog',
description:
'Musings on the open-source community, engineering, and the future of talent acquisition.',
}}
blogs={displayBlogs.slice(0, 4)}
/>
<Newsletter />
</PageLayout>
)
}

export default MaintainersPage

export async function getStaticProps() {
const [commonData, maintainersPageData, featuredBlogs, blogs] = await Promise.all([
getCommonData(),
getMaintainersPageData(),
getFeaturedBlogs(),
getAllBlogs(),
const [commonData, maintainersPageData, featuredBlogs, blogs] =
await Promise.all([
getCommonData(),
getMaintainersPageData(),
getFeaturedBlogs(),
getAllBlogs(),
])

const data = { commonData, maintainersPageData, featuredBlogs, blogs }
const data = { commonData, maintainersPageData, featuredBlogs, blogs }

return {
props: {
data,
},
revalidate: 30,
}
return {
props: {
data,
},
revalidate: 30,
}
}

0 comments on commit 57d330a

Please sign in to comment.