Skip to content

Commit

Permalink
build: upgrade Sanity Studio to v3 (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored Jul 18, 2024
1 parent 4a69d21 commit 1bdcdd2
Show file tree
Hide file tree
Showing 77 changed files with 33,336 additions and 43,379 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ yarn-error.log*

# Local Netlify folder
.netlify

# Sanity
.sanity
2 changes: 1 addition & 1 deletion components/common/SocialLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC, ReactElement } from 'react'
import Image from 'next/image'
import { SanityAboutPage } from '../../types/schema'
import { AboutPage as SanityAboutPage } from '../../sanity.types'

// Static assets
import InstagramLogoW from '../../public/logos/instagramLogoW.svg'
Expand Down
2 changes: 1 addition & 1 deletion components/common/layout/PageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityNavigation, SanitySeo } from '../../../types/schema'
import { Navigation as SanityNavigation, Seo as SanitySeo } from '../../../sanity.types'

// Components
import Header from '../../sections/navigation/Header'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/about/FollowUs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityAboutPage } from '../../../types/schema'
import { AboutPage as SanityAboutPage } from '../../../sanity.types';

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/about/Links.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC, ReactElement } from 'react'
import Image from 'next/image'
import { SanityAboutPage } from '../../../types/schema'
import { AboutPage as SanityAboutPage } from '../../../sanity.types'

// Components
import GradientBorderWrapper from '../../common/GradientBorderWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/about/about/About.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityAboutPage } from '../../../../types/schema'
import { AboutPage as SanityAboutPage } from '../../../../sanity.types'
import { getPartialString, getPartialStringFromEnd } from '../../../../utils/stringUtils'

// Components
Expand Down
2 changes: 1 addition & 1 deletion components/sections/blog/Blogs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import React, { FC, ReactElement } from 'react'
import { SanityAuthor, SanityBlog } from '../../../types/schema'
import { Author as SanityAuthor, Blog as SanityBlog } from '../../../sanity.types'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/blog/FeaturedPost.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Image from 'next/image'
import React, { FC, ReactElement } from 'react'
import { SanityAuthor, SanityBlog } from '../../../types/schema'
import { Author as SanityAuthor, Blog as SanityBlog } from '../../../sanity.types'

// Components
import GradientBorderWrapper from '../../common/GradientBorderWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/blog/[slug]/PageContent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityAuthor, SanityBlog } from '../../../../types/schema'
import { Author as SanityAuthor, Blog as SanityBlog } from '../../../../sanity.types'
import getReadTime from '../../../../utils/getReadTime'

// Components
Expand Down
2 changes: 1 addition & 1 deletion components/sections/blog/components/AuthorBio.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Image from "next/image";
import { SanityAuthor } from "../../../../types/schema";
import { Author as SanityAuthor } from "../../../../sanity.types";
import GradientBorderWrapper from "../../../common/GradientBorderWrapper";

export default function AuthorBio({ author }: { author: SanityAuthor }) {
Expand Down
2 changes: 1 addition & 1 deletion components/sections/blog/components/Post.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from 'next/image'
import Link from 'next/link'
import React, { FC, ReactElement } from 'react'
import { SanityBlog, SanityAuthor } from '../../../../types/schema'
import { Blog as SanityBlog, Author as SanityAuthor } from '../../../../sanity.types'
import getReadTime from '../../../../utils/getReadTime'

// Components
Expand Down
10 changes: 5 additions & 5 deletions components/sections/changelog/Changelog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import GradientBorderWrapper from '../../common/GradientBorderWrapper'
import { IoMdGitCommit } from 'react-icons/io'
import ReactMarkdown from 'react-markdown'
import { MdOutlineExpandMore } from 'react-icons/md'
import { SanityChangelog } from '../../../types/schema'
import { Changelog as SanityChangelog } from '../../../sanity.types'
import moment from 'moment'

import Link from 'next/link'
Expand Down Expand Up @@ -35,10 +35,10 @@ const Changelog: FC<ChangelogProps> = ({
}

// check if the changelog content has an image
const hasImageInContent = changelogContent.includes('![image](')
const hasImageInContent = changelogContent?.includes('![image](')

// check the line of the changelog content
const lineCount = changelogContent.split('\n').length
const lineCount = changelogContent?.split('\n').length

return (
<article
Expand Down Expand Up @@ -116,11 +116,11 @@ const Changelog: FC<ChangelogProps> = ({
<div className="relative" ref={contentRef}>
<ReactMarkdown
className="prose prose-invert prose-img:rounded-md">
{changelogContent}
{changelogContent || ""}
</ReactMarkdown>
</div>
</div>
{(hasImageInContent || changelogContent.length > 260) && (
{(hasImageInContent || changelogContent?.length || 0 > 260) && (
<button
onClick={expandChangelog}
className="text-textPrimary font-bold flex items-center mt-8 gap-x-2 transition-all hover:text-brandOrange"
Expand Down
2 changes: 1 addition & 1 deletion components/sections/changelog/Changelogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { FC, useEffect, useState } from 'react'
import SectionWrapper from '../../common/layout/SectionWrapper'
import Changelog from './Changelog'
import { getChangelog } from '../../../lib/sanity'
import { SanityChangelog } from '../../../types/schema'
import { Changelog as SanityChangelog } from '../../../sanity.types'
import GradientBorderWrapper from '../../common/GradientBorderWrapper'

interface ChangelogsProps {
Expand Down
2 changes: 1 addition & 1 deletion components/sections/home-page/CTA.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC } from 'react'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/home-page/GitHubMock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC } from 'react'
import Image from 'next/image'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'
import useMediaQuery from '../../hooks/useMediaQuery'

// Static assets
Expand Down
2 changes: 1 addition & 1 deletion components/sections/home-page/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import Link from 'next/link'
import { SanityHomePage, SanityTeamsPage } from '../../../types/schema'
import { HomePage as SanityHomePage, TeamsPage as SanityTeamsPage } from '../../../sanity.types'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/home-page/Insights.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'

// Components
import { Button } from '../../common'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/home-page/Logos.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { SanityUser } from '../../../types/schema'
import { User as SanityUser } from '../../../sanity.types'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/home-page/blogs/Blog.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from 'next/image'
import Link from 'next/link'
import React, { FC, ReactElement } from 'react'
import { SanityBlog } from '../../../../types/schema'
import { Blog as SanityBlog } from '../../../../sanity.types'

// Components
import GradientBorderWrapper from '../../../common/GradientBorderWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/home-page/blogs/Blogs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityBlog, SanityHomePage } from '../../../../types/schema'
import { Blog as SanityBlog, HomePage as SanityHomePage } from '../../../../sanity.types'
import { useInView } from 'react-intersection-observer'
import { motion } from 'framer-motion'

Expand Down
2 changes: 1 addition & 1 deletion components/sections/home-page/features/Features.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC } from 'react'
import { SanityHomePage } from '../../../../types/schema'
import { HomePage as SanityHomePage } from '../../../../sanity.types'

// Components
import Feature from './Feature'
Expand Down
5 changes: 2 additions & 3 deletions components/sections/home-page/features/StudentsFeatures.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { SanityStudentsPage } from "../../../../types/schema";
import { SanityImageAsset, SanityImageCrop, SanityImageHotspot, StudentsPage as SanityStudentsPage } from "../../../../sanity.types";
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";
Expand All @@ -27,7 +26,7 @@ function StudentFeature({ feature } : { feature : {
description?: string,
image?: {
_type: 'image'
asset: SanityReference<SanityImageAsset>
asset?: any
crop?: SanityImageCrop
hotspot?: SanityImageHotspot
}
Expand Down
6 changes: 3 additions & 3 deletions components/sections/home-page/features/TeamsFeatures.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { SanityTeamsPage } from "../../../../types/schema";
import { SanityImageAsset, SanityImageCrop, SanityImageHotspot, TeamsPage as SanityTeamsPage } from "../../../../sanity.types";
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";
Expand Down Expand Up @@ -99,7 +99,7 @@ function TeamFeature({ feature } : { feature : {
description?: string,
image?: {
_type: 'image'
asset: SanityReference<SanityImageAsset>
asset?: any
crop?: SanityImageCrop
hotspot?: SanityImageHotspot
}
Expand Down
2 changes: 1 addition & 1 deletion components/sections/home-page/testimonials/Testimonial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { FC } from 'react'
import Image from 'next/image'
import { Transition, motion } from 'framer-motion'
import { useInView } from 'react-intersection-observer'
import { SanityTestimonial } from '../../../../types/schema'
import { Testimonial as SanityTestimonial } from '../../../../sanity.types'

// Components
import GradientBorderWrapper from '../../../common/GradientBorderWrapper'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, useState } from 'react'
import { SanityHomePage, SanityTestimonial } from '../../../../types/schema'
import { HomePage as SanityHomePage, Testimonial as SanityTestimonial } from '../../../../sanity.types'

// Components
import SectionWrapper from '../../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/maintainers/CTA.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC } from 'react'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/maintainers/GitHubMock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC } from 'react'
import Image from 'next/image'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'
import useMediaQuery from '../../hooks/useMediaQuery'

// Static assets
Expand Down
2 changes: 1 addition & 1 deletion components/sections/maintainers/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import Link from 'next/link'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/maintainers/Insights.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'

// Components
import { Button } from '../../common'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/maintainers/Logos.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { SanityUser } from '../../../types/schema'
import { User as SanityUser } from '../../../sanity.types'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/maintainers/blogs/Blog.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from 'next/image'
import Link from 'next/link'
import React, { FC, ReactElement } from 'react'
import { SanityBlog } from '../../../../types/schema'
import { Blog as SanityBlog } from '../../../../sanity.types'

// Components
import GradientBorderWrapper from '../../../common/GradientBorderWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/maintainers/blogs/Blogs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityBlog, SanityHomePage } from '../../../../types/schema'
import { Blog as SanityBlog, HomePage as SanityHomePage } from '../../../../sanity.types'
import { useInView } from 'react-intersection-observer'
import { motion } from 'framer-motion'

Expand Down
2 changes: 1 addition & 1 deletion components/sections/maintainers/features/Features.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC } from 'react'
import { SanityHomePage } from '../../../../types/schema'
import { HomePage as SanityHomePage } from '../../../../sanity.types'

// Components
import Feature from './Feature'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { FC } from 'react'
import Image from 'next/image'
import { Transition, motion } from 'framer-motion'
import { useInView } from 'react-intersection-observer'
import { SanityTestimonial } from '../../../../types/schema'
import { Testimonial as SanityTestimonial } from '../../../../sanity.types'

// Components
import GradientBorderWrapper from '../../../common/GradientBorderWrapper'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, useState } from 'react'
import { SanityHomePage, SanityTestimonial } from '../../../../types/schema'
import { HomePage as SanityHomePage, Testimonial as SanityTestimonial } from '../../../../sanity.types'

// Components
import SectionWrapper from '../../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/navigation/DesktopNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useRouter } from 'next/router'
// Components
import { Button } from '../../common'
import { Menu } from '@headlessui/react'
import { SanityNavigation } from '../../../types/schema'
import { Navigation as SanityNavigation } from '../../../sanity.types'

interface DesktopNavigationProps {
navigationItems: SanityNavigation[]
Expand Down
2 changes: 1 addition & 1 deletion components/sections/navigation/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityNavigation } from '../../../types/schema'
import { Navigation as SanityNavigation } from '../../../sanity.types'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/navigation/MobileNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, ReactElement } from 'react'
import Image from 'next/image'
import Link from 'next/link'
import { SanityNavigation } from '../../../types/schema'
import { Navigation as SanityNavigation } from '../../../sanity.types'

import DropdownMenu from './DropdownMenu'

Expand Down
2 changes: 1 addition & 1 deletion components/sections/pricing/features/Features.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC, ReactElement } from 'react'
import SectionWrapper from '../../../common/layout/SectionWrapper'
import { SanityPricingPage } from '../../../../types/schema'
import { PricingPage as SanityPricingPage } from '../../../../sanity.types'
import { getPartialString, getPartialStringFromEnd } from '../../../../utils/stringUtils'

// Components
Expand Down
2 changes: 1 addition & 1 deletion components/sections/pricing/pricing/Pricing.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityPricingPage } from '../../../../types/schema'
import { PricingPage as SanityPricingPage } from '../../../../sanity.types'
import { getPartialString, getPartialStringFromEnd } from '../../../../utils/stringUtils'
import GradientBorderWrapper from '../../../common/GradientBorderWrapper'
import SectionWrapper from '../../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/teams/CTA.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC } from 'react'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/teams/GitHubMock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC } from 'react'
import Image from 'next/image'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'
import useMediaQuery from '../../hooks/useMediaQuery'

// Static Assets
Expand Down
2 changes: 1 addition & 1 deletion components/sections/teams/Insights.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, ReactElement } from 'react'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'

// Components
import { Button } from '../../common'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/teams/TeamsHero.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import Link from 'next/link'
import { SanityHomePage } from '../../../types/schema'
import { HomePage as SanityHomePage } from '../../../sanity.types'

import SectionWrapper from '../../common/layout/SectionWrapper'
import DecoratedText from '../../common/text/utils/DecoratedText'
Expand Down
2 changes: 1 addition & 1 deletion components/sections/teams/TeamsLogos.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { SanityUser } from '../../../types/schema'
import { User as SanityUser } from '../../../sanity.types'

import SectionWrapper from '../../common/layout/SectionWrapper'

Expand Down
Loading

0 comments on commit 1bdcdd2

Please sign in to comment.