-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: /students
marketing page
#223
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
components/sections/home-page/features/StudentsFeatures.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { SanityStudentsPage } from "../../../../types/schema"; | ||
import { Heading } from '../../../common/text' | ||
import ContainerWithLine from '../../../common/ContainerWithLine' | ||
import { motion } from 'framer-motion' | ||
import { useInView } from 'react-intersection-observer' | ||
import type { SanityImageAsset, SanityImageCrop, SanityImageHotspot, SanityReference } from "sanity-codegen"; | ||
|
||
import EndingLine from "../../../common/EndingLine"; | ||
import SectionWrapper from "../../../common/layout/SectionWrapper"; | ||
|
||
type TeamsFeaturesProps = { | ||
features: SanityStudentsPage['features']; | ||
}; | ||
|
||
export default function StudentsFeatures({ features } : TeamsFeaturesProps) { | ||
return ( | ||
<SectionWrapper pbs={0}> | ||
{ features!.map((feature) => <StudentFeature feature={feature!} />) } | ||
<EndingLine /> | ||
</SectionWrapper> | ||
); | ||
} | ||
|
||
function StudentFeature({ feature } : { feature : { | ||
title?: string, | ||
heading?: string, | ||
description?: string, | ||
image?: { | ||
_type: 'image' | ||
asset: SanityReference<SanityImageAsset> | ||
crop?: SanityImageCrop | ||
hotspot?: SanityImageHotspot | ||
} | ||
}}) { | ||
const { title, heading, description, image } = feature!; | ||
const [ refIcon, iconInView ] = useInView(); | ||
|
||
// text animation | ||
const initPosY = 5; | ||
const posY = iconInView ? 0 : initPosY; | ||
|
||
return ( | ||
<ContainerWithLine> | ||
<div className="pb-14 largeTablet:mb-32"> | ||
<div className="flex gap-y-24 py-10 flex-col-reverse largeTablet:flex-col"> | ||
<div ref={refIcon} className=" flex flex-col px-6 gap-y-12"> | ||
<div className="relative max-w-[650px]"> | ||
<motion.img | ||
initial={{ opacity: 0, scale: 0.2 }} | ||
animate={{ opacity: iconInView ? 1 : 0, scale: iconInView ? 1 : 0.5 }} | ||
transition={{ duration: 0.5, delay: 0.1, ease: 'easeInOut' }} | ||
className="absolute -left-[56px] largeTablet:-left-[77px] -top-[8px] largeTablet:-top-[4px]" | ||
src={'/icons/find_icon.svg'} | ||
alt="Find" | ||
/> | ||
|
||
<motion.div | ||
initial={{ opacity: 0, y: initPosY, x: -10 }} | ||
animate={{ opacity: iconInView ? 1 : 0, y: posY, x: iconInView ? 0 : -10 }} | ||
transition={{ duration: 0.7, delay: 0.2, ease: 'easeInOut' }} | ||
> | ||
<div className="flex flex-col gap-4"> | ||
<p className="w-fit text-base px-3 py-1 text-darkOrange border border-darkOrange rounded-full"> | ||
{title} | ||
</p> | ||
<Heading component="h2" alignLarge="left"> | ||
{heading} | ||
</Heading> | ||
</div> | ||
</motion.div> | ||
</div> | ||
|
||
<div className=""> | ||
<motion.div | ||
initial={{ opacity: 0, y: initPosY, x: 10 }} | ||
animate={{ opacity: iconInView ? 1 : 0, y: posY, x: iconInView ? 0 : 10 }} | ||
transition={{ duration: 0.7, delay: 0.2, ease: 'easeInOut' }} | ||
> | ||
<p className="text-start font-light max-w-2xl text-lg text-neutral-300"> | ||
{description} | ||
</p> | ||
</motion.div> | ||
</div> | ||
|
||
<motion.div | ||
initial={{ opacity: 0, y: initPosY, x: 10 }} | ||
animate={{ opacity: iconInView ? 1 : 0, y: posY, x: iconInView ? 0 : 10 }} | ||
transition={{ duration: 0.7, delay: 0.2, ease: 'easeInOut' }} | ||
> | ||
<img src={image as unknown as string} /> | ||
</motion.div> | ||
</div> | ||
</div> | ||
</div> | ||
</ContainerWithLine> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import React, { FC } from 'react' | ||
import PageLayout from '../../components/common/layout/PageLayout' | ||
import { getAllBlogs, getCommonData, getFeaturedBlogs, getStudentsPageData } from '../../lib/sanity' | ||
import Background from '../../components/sections/about/Background' | ||
import { SanityBlog, SanityFooter, SanityNavigation, SanitySeo, SanityStudentsPage, SanityUser } from '../../types/schema' | ||
import Blogs from '../../components/sections/home-page/blogs/Blogs' | ||
import Hero from '../../components/sections/home-page/Hero' | ||
import Logos from '../../components/sections/home-page/Logos' | ||
import CTA from '../../components/sections/teams/CTA' | ||
import StudentsFeatures from "../../components/sections/home-page/features/StudentsFeatures"; | ||
|
||
interface Props { | ||
data: { | ||
commonData: { | ||
navigationLinks: SanityNavigation[] | ||
seoData: SanitySeo | ||
footer: SanityFooter[] | ||
} | ||
studentsPageData: SanityStudentsPage | ||
blogs: SanityBlog[] | ||
featuredBlogs: SanityBlog[] | ||
} | ||
} | ||
|
||
export async function getStaticProps() { | ||
const [commonData, studentsPageData, featuredBlogs, blogs] = await Promise.all([ | ||
getCommonData(), | ||
getStudentsPageData(), | ||
getFeaturedBlogs(), | ||
getAllBlogs(), | ||
]) | ||
|
||
const data = { commonData, studentsPageData, featuredBlogs, blogs } | ||
|
||
return { | ||
props: { | ||
data, | ||
}, | ||
revalidate: 30, | ||
} | ||
} | ||
|
||
const Index: FC<Props> = ({ | ||
data: { commonData, studentsPageData, blogs, featuredBlogs }, | ||
}) => { | ||
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={studentsPageData.hero as unknown as SanityStudentsPage['hero']} /> | ||
<Logos data={studentsPageData.hero?.users as unknown as SanityUser[] || []} /> | ||
<StudentsFeatures features={studentsPageData.features} /> | ||
<CTA data={studentsPageData.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)} /> | ||
</PageLayout> | ||
) | ||
} | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related: #227