Skip to content

Commit

Permalink
Refactor: Removed unnecessary SVGs and imports, and sorted imports by…
Browse files Browse the repository at this point in the history
… file type (#127)
  • Loading branch information
shamimbinnur authored May 21, 2023
1 parent 9524fa0 commit 353af20
Show file tree
Hide file tree
Showing 76 changed files with 158 additions and 1,968 deletions.
2 changes: 2 additions & 0 deletions components/common/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Link from 'next/link'
import React, { FC, ReactElement } from 'react'

// Icons
import { AiFillGithub } from 'react-icons/ai'

interface ButtonProps {
Expand Down
4 changes: 3 additions & 1 deletion components/common/SocialLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { FC, ReactElement } from 'react'
import Image from 'next/image'
import { SanityAboutPage } from '../../types/schema'

// Static assets
import InstagramLogoW from '../../public/logos/instagramLogoW.svg'
import TwitterLogoW from '../../public/logos/twitterLogoW.svg'
import GithubLogoW from '../../public/logos/githubLogoW.svg'
import DiscordLogoW from '../../public/logos/discordLogoW.svg'
import DevLogoW from '../../public/logos/devLogoW.svg'
import YoutubeLogoW from '../../public/logos/youtubeLogoW.svg'
import { SanityAboutPage } from '../../types/schema'

const data = [
{
Expand Down
2 changes: 2 additions & 0 deletions components/common/SocialShare.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { FC } from 'react'

// Icons
import { BsTwitter, BsLinkedin, BsFacebook } from 'react-icons/bs'
import { FaHackerNewsSquare } from 'react-icons/fa'

Expand Down
3 changes: 2 additions & 1 deletion components/common/layout/PageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Head from 'next/head'
import React, { FC, ReactElement } from 'react'
import { SanityNavigation, SanitySeo } from '../../../types/schema'

// Components
import Header from '../../sections/navigation/Header'
import Footer from '../../sections/Footer'
import Subscribe from '../../sections/Subscribe'
Expand Down
2 changes: 2 additions & 0 deletions components/common/text/Heading.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { FC, ReactElement } from 'react'
import useMediaQuery from '../../hooks/useMediaQuery'

// Components
import DecoratedText from './utils/DecoratedText'

interface HeadingProps {
Expand Down
12 changes: 8 additions & 4 deletions components/sections/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import Image from 'next/image'
import Link from 'next/link'
import React, { FC } from 'react'
import OpenSaucedLogo from '../../public/logos/brandLogo.svg'
import Link from 'next/link'
import Image from 'next/image'

// Components
import SectionWrapper from '../common/layout/SectionWrapper'
import SocialLinks from '../common/SocialLinks'
import { navigationLinks } from './navigation/Header'

import OpenSaucedLogo from '../../public/logos/brandLogo.svg'


const footerContext = {
pages: [
{
Expand Down Expand Up @@ -45,7 +49,7 @@ const Footer: FC<FooterProps> = ({ pressPage }) => {
<SectionWrapper pbs={0}>
<div className="w-full pt-10 pb-16 largeTablet:pt-12">
<div className="w-[140px] h-6 relative">
<Image layout="fill" alt="Brand logo" src={OpenSaucedLogo} />
<Image alt="Brand logo" src={OpenSaucedLogo} />
</div>
</div>
<div className="w-full flex flex-col largeTablet:flex-row">
Expand Down
6 changes: 5 additions & 1 deletion components/sections/Subscribe.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import React, { FC, ReactElement, useRef, useState, useEffect } from 'react'
import Image from 'next/image'

// Components
import GradientBorderWrapper from '../common/GradientBorderWrapper'
import SectionWrapper from '../common/layout/SectionWrapper'
import { Heading, Typography } from '../common/text'
import Image from 'next/image'

// Static Assets
import StrokeR3 from '../../public/background-strokes/stroke_r_3.svg'
import StrokeL3 from '../../public/background-strokes/stroke_l_3.svg'
import StrokeMobile2 from '../../public/background-strokes/stroke_mobile_2.svg'
Expand Down
4 changes: 3 additions & 1 deletion components/sections/about/Background.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Image from 'next/image'
import React, { FC } from 'react'
import Image from 'next/image'

// Static Assets
import StrokeL4 from '../../../public/background-strokes/stroke_l_4.svg'
import StrokeR3 from '../../../public/background-strokes/stroke_r_3.svg'
import StrokeMobile1 from '../../../public/background-strokes/stroke_mobile_1.svg'
Expand Down
4 changes: 3 additions & 1 deletion components/sections/about/FollowUs.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { FC, ReactElement } from 'react'
import { SanityAboutPage } from '../../../types/schema'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
import GradientBorderWrapper from '../../common/GradientBorderWrapper'
import SocialLinks from '../../common/SocialLinks'
import { SanityAboutPage } from '../../../types/schema'

interface FollowUsProps {
social: SanityAboutPage['socialLinks']
Expand Down
7 changes: 5 additions & 2 deletions components/sections/about/Links.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import React, { FC, ReactElement } from 'react'
import Image from 'next/image'
import { SanityAboutPage } from '../../../types/schema'

// Components
import GradientBorderWrapper from '../../common/GradientBorderWrapper'
import SectionWrapper from '../../common/layout/SectionWrapper'
import { Typography } from '../../common/text'
import Image from 'next/image'
import OrangeRightArrow from '../../../public/orange_right_arrow.png'
import OrangeRightArrowSmall from '../../../public/orange_right_arrow_small.png'
import useMediaQuery from '../../hooks/useMediaQuery'
import Link from 'next/link'
import { SanityAboutPage } from '../../../types/schema'

interface LinksProps {
services: SanityAboutPage['services']
}
Expand Down
2 changes: 2 additions & 0 deletions components/sections/about/about/About.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { FC, ReactElement } from 'react'
import { SanityAboutPage } from '../../../../types/schema'
import { getPartialString, getPartialStringFromEnd } from '../../../../utils/stringUtils'

// Components
import SectionWrapper from '../../../common/layout/SectionWrapper'
import { Heading, Typography } from '../../../common/text'
import MetricCard from './MetricCard'
Expand Down
3 changes: 2 additions & 1 deletion components/sections/about/about/MetricCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { FC, ReactElement } from 'react'
import { SanityAboutPage } from '../../../../types/schema'

// Components
import { Typography } from '../../../common/text'
import DecoratedText from '../../../common/text/utils/DecoratedText'

Expand Down
4 changes: 3 additions & 1 deletion components/sections/blog/Background.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Image from 'next/image'
import React, { FC } from 'react'
import Image from 'next/image'

// Static Assets
import StrokeL5 from '../../../public/background-strokes/stroke_l_5.svg'
import StrokeR4 from '../../../public/background-strokes/stroke_r_4.svg'
import StrokeMobile1 from '../../../public/background-strokes/stroke_mobile_1.svg'
Expand Down
2 changes: 2 additions & 0 deletions components/sections/blog/Blogs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

import React, { FC, ReactElement } from 'react'
import { SanityBlog } from '../../../types/schema'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
import { Heading, Typography } from '../../common/text'
import Post from './components/Post'
Expand Down
2 changes: 2 additions & 0 deletions components/sections/blog/FeaturedPost.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Image from 'next/image'
import React, { FC, ReactElement } from 'react'
import { SanityBlog } from '../../../types/schema'

// Components
import GradientBorderWrapper from '../../common/GradientBorderWrapper'
import Blog from './components/Post'

Expand Down
12 changes: 7 additions & 5 deletions components/sections/blog/[slug]/PageContent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { FC, ReactElement } from 'react'
import { SanityBlog } from '../../../../types/schema'
import getReadTime from '../../../../utils/getReadTime'

// Components
import SectionWrapper from '../../../common/layout/SectionWrapper'
import { Heading, Typography } from '../../../common/text'
import OrangeClock from '../../../../public/orange_clock.png'
Expand All @@ -13,7 +16,6 @@ import Blog from '../components/Post'
import ReactPlayer from 'react-player'
import DecoratedText from '../../../common/text/utils/DecoratedText'
import OgData from '../../../common/OgData'
import getReadTime from '../../../../utils/getReadTime'
import SocialShare from '../../../common/SocialShare'

interface PageContentProps {
Expand Down Expand Up @@ -57,12 +59,12 @@ const PageContent: FC<PageContentProps> = ({
</div>
<div className="w-full flex justify-start pb-4 largeTablet:pb-6 largeTablet:justify-center">
<div className="flex-shrink-0 mr-2">
<Image src={OrangeAuthor} alt="Author" />
<Image width={16} height={16} src={OrangeAuthor} alt="Author" />
</div>

<LocalTypography>{author}</LocalTypography>
<div className="flex-shrink-0 mr-2 ml-4">
<Image src={OrangeClock} alt="Clock" />
<Image width={16} height={16} src={OrangeClock} alt="Clock" />
</div>

<LocalTypography>{`${getReadTime(blogContent || "")} ${
Expand All @@ -76,9 +78,9 @@ const PageContent: FC<PageContentProps> = ({
<GradientBorderWrapper style={{ width: '100%', borderRadius: '8px' }}>
<div className="w-full h-[304px] relative rounded-[5px] overflow-hidden largeTablet:h-[496px] ">
<Image
width={1206}
height={496}
src={src as string}
layout="fill"
objectFit="cover"
alt="Cover"
/>
</div>
Expand Down
6 changes: 4 additions & 2 deletions components/sections/blog/components/Post.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import Image from 'next/image'
import React, { FC, ReactElement } from 'react'
import { SanityBlog } from '../../../../types/schema'
import getReadTime from '../../../../utils/getReadTime'

// Components
import GradientBorderWrapper from '../../../common/GradientBorderWrapper'
import { Typography } from '../../../common/text'
import OrangeClock from '../../../../public/orange_clock.png'
import OrangeAuthor from '../../../../public/orange_author.png'
import { Button } from '../../../common'
import LocalTypography from './LocalTypography'
import getReadTime from '../../../../utils/getReadTime'

interface PostProps {
data: SanityBlog
Expand Down Expand Up @@ -44,7 +46,7 @@ const Post: FC<PostProps> = ({ data, featured }): ReactElement => {
<div className={`${featured && 'largeTablet:hidden'}`}>
<GradientBorderWrapper style={{ width: '100%', borderRadius: '5px' }}>
<div className="w-full h-[304px] relative rounded-[5px] overflow-hidden ">
<Image src={src as string} layout="fill" objectFit="cover" alt="Cover"/>
<Image width="580" height={304} src={src as string} alt="Cover"/>
</div>
</GradientBorderWrapper>
</div>
Expand Down
8 changes: 4 additions & 4 deletions components/sections/home-page/Background.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Image from 'next/image'
import React, { FC } from 'react'
import upperStroke from '../../../public/upperStroke.svg'
import Image from 'next/image'

// Static assets
import upperStroke from '../../../public/background-strokes/upperStroke.svg'
import left_2_stroke from '../../../public/background-strokes/left_2_stroke.svg'
import right_2_stroke from '../../../public/background-strokes/right_2_stroke.svg'
import right_3_stroke from '../../../public/background-strokes/right_3_stroke.svg'
import StrokeMobile2 from '../../../public/background-strokes/stroke_mobile_2.svg'
import StrokeMobile3 from '../../../public/background-strokes/stroke_mobile_3.svg'

const Background: FC = ({ children }) => {
return (
Expand Down
4 changes: 3 additions & 1 deletion components/sections/home-page/CTA.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { FC } from 'react'
import { SanityHomePage } from '../../../types/schema'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
import { SanityCalender, SanityHomePage } from '../../../types/schema'
import { Heading, Typography } from '../../common/text'
import { Button } from '../../common'

Expand Down
13 changes: 9 additions & 4 deletions components/sections/home-page/GitHubMock.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import Image from 'next/image'
import React, { FC } from 'react'
import { SanityGithubMock, SanityHomePage } from '../../../types/schema'
import Image from 'next/image'
import { SanityHomePage } from '../../../types/schema'
import useMediaQuery from '../../hooks/useMediaQuery'

// Static assets
import GreenSquares from '../../../public/greenSquares.svg'
import GreenSquaresSmall from '../../../public/greenSquares_small.svg'
import TrueImpactIMG from '../../../public/trueImpact.png'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
import { Heading, Typography } from '../../common/text'
import useMediaQuery from '../../hooks/useMediaQuery'
import DecoratedText from '../../common/text/utils/DecoratedText'
import BackgroundStroke from '../../../public/middleRight.svg'
import BackgroundStroke from '../../../public/background-strokes/middleRight.svg'


interface GitHubMockProps {
moreHeading: string[]
Expand Down
4 changes: 3 additions & 1 deletion components/sections/home-page/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react'
import Link from 'next/link'
import { SanityHomePage } from '../../../types/schema'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
import ContainerWithLine from '../../common/ContainerWithLine'
import { Heading, Typography } from '../../common/text'
import { Button } from '../../common'
import DecoratedText from '../../common/text/utils/DecoratedText'
import Link from 'next/link'
interface HeroProps {
data: SanityHomePage['hero']
}
Expand Down
2 changes: 2 additions & 0 deletions components/sections/home-page/Insights.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { FC, ReactElement } from 'react'
import { SanityHomePage } from '../../../types/schema'

// Components
import { Button } from '../../common'
import SectionWrapper from '../../common/layout/SectionWrapper'
import { Heading, Typography } from '../../common/text'
Expand Down
4 changes: 3 additions & 1 deletion components/sections/home-page/Logos.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react'
import SectionWrapper from '../../common/layout/SectionWrapper'
import { SanityUser } from '../../../types/schema'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
import ContainerWithLine from '../../common/ContainerWithLine'
import { Typography } from '../../common/text'

Expand Down
9 changes: 6 additions & 3 deletions components/sections/home-page/Newsletter.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React from 'react'
import Image from 'next/image'

// Components
import SectionWrapper from '../../common/layout/SectionWrapper'
import { Heading, Typography } from '../../common/text'
import GradientBorderWrapper from '../../common/GradientBorderWrapper'
import Image from 'next/image'

import StrokeR3 from '../../../public/_3_rightStroke.svg'
import StrokeL3 from '../../../public/_3_leftStroke.svg'
// Static assets
import StrokeR3 from '../../../public/background-strokes/_3_rightStroke.svg'
import StrokeL3 from '../../../public/background-strokes/_3_leftStroke.svg'

const Newsletter = () => {
return (
Expand Down
2 changes: 2 additions & 0 deletions components/sections/home-page/blogs/Blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Image from 'next/image'
import Link from 'next/link'
import React, { FC, ReactElement } from 'react'
import { SanityBlog } from '../../../../types/schema'

// Components
import GradientBorderWrapper from '../../../common/GradientBorderWrapper'

interface BlogProps {
Expand Down
6 changes: 4 additions & 2 deletions components/sections/home-page/blogs/Blogs.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { FC, ReactElement } from 'react'
import { SanityBlog, SanityHomePage } from '../../../../types/schema'
import { useInView } from 'react-intersection-observer'
import { motion } from 'framer-motion'

// Components
import { Button } from '../../../common'
import SectionWrapper from '../../../common/layout/SectionWrapper'
import { Heading, Typography } from '../../../common/text'
import Blog from './Blog'
import { useInView } from 'react-intersection-observer'

import { motion } from 'framer-motion'

interface BlogsProps {
blogs: SanityBlog[]
Expand Down
2 changes: 2 additions & 0 deletions components/sections/home-page/features/Features.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { FC } from 'react'
import { SanityHomePage } from '../../../../types/schema'

// Components
import Feature from './Feature'
import SectionWrapper from '../../../common/layout/SectionWrapper'
import EndingLine from '../../../common/EndingLine'
Expand Down
8 changes: 5 additions & 3 deletions components/sections/home-page/testimonials/Testimonial.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import Image from 'next/image'
import React, { FC } from 'react'
import Image from 'next/image'
import { motion } from 'framer-motion'
import { useInView } from 'react-intersection-observer'
import { SanityTestimonial } from '../../../../types/schema'

// Components
import GradientBorderWrapper from '../../../common/GradientBorderWrapper'

import { motion } from 'framer-motion'
import { useInView } from 'react-intersection-observer'

interface TestimonialProps {
testimonial: SanityTestimonial
Expand Down
Loading

0 comments on commit 353af20

Please sign in to comment.