Skip to content

Commit

Permalink
Merge branch 'open-sauced:main' into creating-custom-css-with-SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
CBID2 committed Apr 17, 2024
2 parents c77a016 + c9ec532 commit 6634167
Show file tree
Hide file tree
Showing 55 changed files with 5,129 additions and 2,663 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/auto-add-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Adds all issues opened in the /landing-page repo to the Team Dashboard

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.OS_GITHUB_APP_ID }}
private_key: ${{ secrets.OS_GITHUB_APP_PRIVATE_KEY }}

- name: add issue to team dashboard
uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/open-sauced/projects/25
github-token: ${{ steps.generate_token.outputs.token }}
4 changes: 2 additions & 2 deletions components/common/SocialLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const SocialLinks: FC<SocialLinksProps> = ({ aboutPage, social }): ReactElement
? <div className={wrapperStyle}>
{social.map(({ socialUrl, socialIcon, socialLinkPlaceholder }) => (
<div key={socialLinkPlaceholder} className="flex items-center cursor-pointer">
<a href={socialUrl} target="_blank" rel="noreferrer" className="opacity-70">
<a href={socialUrl} target="_blank" className="opacity-70">
<Image width={37} height={37} alt={socialLinkPlaceholder as string} src={socialIcon as unknown as string || ""} />
</a>
</div>
Expand All @@ -67,7 +67,7 @@ const SocialLinks: FC<SocialLinksProps> = ({ aboutPage, social }): ReactElement
: <div className={wrapperStyle}>
{data.map(({ url, icon, label }) => (
<div key={label} className="flex items-center cursor-pointer">
<a href={url} target="_blank" rel="noreferrer" className="opacity-70">
<a href={url} target="_blank" className="opacity-70">
<Image width={18} height={18} alt={label} src={icon} />
</a>
</div>
Expand Down
20 changes: 20 additions & 0 deletions components/common/StarTheRepo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AiOutlineStar } from "react-icons/ai";

export const StarTheRepo = (): JSX.Element | null => {
return (
<div className={`hidden sm:flex items-center text-osGrey transition-opacity font-Inter`}>
<a
href="https://github.com/open-sauced/app"

target="_blank"
>
<AiOutlineStar className="inline-block mr-2.5" />

FOOLALA
<span className="text-md font-light mr-2.5">
Star us on GitHub
</span>
</a>
</div>
);
};
2 changes: 1 addition & 1 deletion components/common/layout/SectionWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const SectionWrapper: FC<SectionWrapperProps> = ({
paddingBottom: isLargeTablet ? `${pb}px` : `${pbs}px`,
paddingTop: isLargeTablet ? `${pt}px` : `${pts}px`,
}}
className={`w-full max-w-[1256px] mx-auto px-${px} flex justify-${justify} flex-${direction} items-center`}
className={`w-full max-w-[1256px] mx-auto px-${px} h-fit flex justify-${justify} flex-${direction} items-center`}
>
{children}
</div>
Expand Down
4 changes: 4 additions & 0 deletions components/common/text/utils/DecoratedText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ const gradientROKey = '$red-to-orange'
const gradientORKey = '$orange-to-red'
const orangeKey = '$orange'
const yellowKey = '$yellow'
const boldKey = '$bold'

const gradientYOStyle = `bg-gradient-to-r from-brandYellow via-brandRed to-brandRed text-transparent bg-clip-text`
const gradientOYStyle = `bg-gradient-to-r from-brandRed to-brandYellow text-transparent bg-clip-text`
const gradientROStyle = `bg-gradient-to-r from-brandRed via-brandRed to-brandOrange text-transparent bg-clip-text`
const gradientORStyle = `bg-gradient-to-r from-brandOrange via-brandRed to-brandRed text-transparent bg-clip-text`
const orangeStyle = `bg-brandRed text-transparent bg-clip-text`
const yellowStyle = `bg-brandYellow text-transparent bg-clip-text`
const boldStyle = 'text-white font-semibold'

const getStyle = (value: string) => {
if (value.includes(gradientYOKey)) {
Expand All @@ -27,6 +29,8 @@ const getStyle = (value: string) => {
return { key: orangeKey, style: orangeStyle }
} else if (value.includes(yellowKey)) {
return { key: yellowKey, style: yellowStyle }
} else if (value.includes(boldKey)) {
return { key: boldKey, style: boldStyle }
} else {
return { key: '', style: '' }
}
Expand Down
8 changes: 4 additions & 4 deletions components/sections/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const footerContext = {
label: 'hot.opensauced.pizza',
},
{
url: 'https://insights.opensauced.pizza',
label: 'insights.opensauced.pizza',
url: 'https://app.opensauced.pizza',
label: 'app.opensauced.pizza',
},
{
url: 'https://docs.opensauced.pizza',
Expand Down Expand Up @@ -84,7 +84,7 @@ const Footer: FC<FooterProps> = ({ pressPage }) => {
<LocalTypography variant="title">More Sauce</LocalTypography>
<div className="w-full flex flex-col">
{apps.map(({ label, url }) => (
<a key={url} href={url} target="_blank" rel="noreferrer">
<a key={url} href={url} target="_blank" >
<LocalTypography variant="item1">{label}</LocalTypography>
</a>
))}
Expand All @@ -111,7 +111,7 @@ const Footer: FC<FooterProps> = ({ pressPage }) => {
<div className="flex mb-5 largeTablet:mb-0 ">
{pages.map(({ url, label }, i) => (
<div key={label} className="flex">
<a href={url} target="_blank" rel="noreferrer">
<a href={url} target="_blank" >
<LocalTypography variant="item2">{label}</LocalTypography>
</a>
{i < pages.length - 1 && (
Expand Down
2 changes: 1 addition & 1 deletion components/sections/about/Links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Links: FC<LinksProps> = ({ services }): ReactElement => {
<Link href={serviceUrl as unknown as string} legacyBehavior passHref>
<a
target={internalLink ? '_self' : '_blank'}
rel="noreferrer"

>
<div className="flex justify-center items-center pl-6 cursor-pointer">
<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
Expand Up @@ -96,7 +96,7 @@ const PageContent: FC<PageContentProps> = ({
className="w-full max-w-[780px]"
href={blogUrl}
target="_blank"
rel="noreferrer"

>
<p className="text-left font-bold text-2xl border-b-[1px] w-fit tracking-[0.14em] pt-6">
<DecoratedText content="$yellow-to-orangeRead entire article" />
Expand Down
6 changes: 5 additions & 1 deletion components/sections/blog/components/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ const Post: FC<PostProps> = ({ data, featured }): ReactElement => {
))}
</div>
<div className=" min-h-[55px] largeTablet:min-h-[90px]">
<LocalTypography featured={featured} variant="title">{title}</LocalTypography>
<LocalTypography featured={featured} variant="title">
<a href={href} className="hover:text-brandOrange hover:decoration-brandOrange transition-all">
{title}
</a>
</LocalTypography>
</div>
<div className="flex items-center pb-6 largeTablet:pb-10 ">
<div className="flex-shrink-0 mr-2">
Expand Down
35 changes: 35 additions & 0 deletions components/sections/changelog/Background.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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'

interface BackgroundProps {
children: React.ReactNode
}

const Background: FC<BackgroundProps> = ({ children }) => {
return (
<div className="bg-darkBG text-white h-fit relative">
<div className="absolute hidden largeTablet:block largeTablet:top-[0rem] largeTablet:right-0">
<Image alt="Doodles" src={StrokeR4} />
</div>

<div className="absolute hidden largeTablet:block largeTablet:top-[1rem] largeTablet:left-0">
<Image alt="Doodles" src={StrokeL5} />
</div>

{/* MOBILE */}

<div className="absolute top-0 right-0 largeTablet:hidden">
<Image alt="Doodles" src={StrokeMobile1} />
</div>

<div className="relative">{children}</div>
</div>
)
}

export default Background
118 changes: 118 additions & 0 deletions components/sections/changelog/Changelog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import React, { FC, useRef, useState } from 'react'
import { Typography } from '../../common/text'
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 moment from 'moment';

interface ChangelogProps {
changelog: SanityChangelog
index: number
count: number
}

const Changelog: FC<ChangelogProps> = ({
changelog: {
title,
date,
changelogCategory,
changelogContent,
topics,
slug
},
index,
count
}) => {
const [isExpanded, setIsExpanded] = useState(false)
const contentRef = useRef<HTMLDivElement>(null)

// function to expand the changelog
const expandChangelog = () => {
setIsExpanded(!isExpanded)
}

const containerHeightStyle = {
overflow: "hidden",
transition: "height 0.5s ease-in-out",
height: isExpanded ? `${contentRef.current?.clientHeight}px` : "360px",
}

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

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

return (
<article className={`flex pb-24 gap-x-10 h-full relative border-textPrimary border-opacity-50 ${index+1 === count ? "" : "border-l-2"}`}>
<div className="relative pb-28">
<section className={`hidden self-start sticky top-8 tablet:flex flex-1 pl-10 max-w-md flex-col `}>
<span>
<IoMdGitCommit className="absolute -left-3 rounded-3xl text-2xl p-1 text-white bg-gradient-to-tr from-[#ED5432] to-[#EDA232] drop-shadow-[0_0_4px_#ED5432]" />
</span>
<Typography alignLarge="left" variant="title3">
<a href={`/changelog/${slug?.current}`} className="hover:text-brandOrange hover:decoration-brandOrange transition-all">
{title}
</a>
</Typography>
<span className="py-4">
<Typography alignLarge="left" variant="body4">
{moment(date).format("DD MMM YYYY")}
</Typography>
</span>
<div className="flex gap-3">
{topics && topics.map((category, index) => (
<GradientBorderWrapper key={index} style={{borderRadius: "16px"}}>
<div className="bg-darkBG rounded-2xl text-sm px-2 py-1">
{category}
</div>
</GradientBorderWrapper>
))}
</div>
</section>
</div>

<section className={`flex-1 relative pb-10 tablet:border-0 tablet:pl-0 pl-6 ${index+1 === count ? "" : "border-l-2"}`}>
<div className="tablet:hidden relative flex-col flex gap-y-2 pb-4">
<span className=" -left-6 -top-4 z-50 absolute">
<IoMdGitCommit className="absolute -left-4 top-4 bg-darkBG text-3xl" />
</span>
<Typography alignLarge="left" variant="title3">
{title}
</Typography>
<Typography alignLarge="left" variant="body4">
{moment(date).format("DD MMM YYYY")}
</Typography>
<div className="flex gap-2">
{topics && topics.map((category, index) => (
<GradientBorderWrapper key={index} style={{ borderRadius: "16px"}}>
<div className="bg-darkBG rounded-2xl text-sm px-2 py-1">
{ category }
</div>
</GradientBorderWrapper>
))}
</div>
</div>

<div style={containerHeightStyle}>
<div className="relative" ref={contentRef}>
<ReactMarkdown
className="prose prose-headings:text-textPrimary prose-li:text-textPrimary prose-p:text-textPrimary prose-ul:text-textPrimary prose-p:text-base prose-strong:text-textPrimary prose-img:rounded-md">
{changelogContent}
</ReactMarkdown>
</div>
</div>
{(hasImageInContent || changelogContent.length > 260) && (
<button onClick={expandChangelog} className="text-textPrimary font-bold flex items-center mt-8 gap-x-2 transition-all hover:text-brandOrange">
{isExpanded ? "Collapse" : "See more"}
{isExpanded ? <MdOutlineExpandMore className="transform rotate-180" /> : <MdOutlineExpandMore />}
</button>
)}
</section>
</article>
)
}

export default Changelog
51 changes: 51 additions & 0 deletions components/sections/changelog/Changelogs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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 GradientBorderWrapper from '../../common/GradientBorderWrapper'

interface ChangelogsProps {
totalChangelogCount: number
}

const Changelogs: FC<ChangelogsProps> = ({
totalChangelogCount
}) => {
const [changelogs, setChangelogs] = useState<SanityChangelog[]>([])
const [limit, setLimit] = useState(5)

const loadMore = () => setLimit(limit + 5)

useEffect(() => {
const getChangeLog = async () => {
const changelogData = await getChangelog(limit)
setChangelogs([...changelogData])
}
getChangeLog()
}, [limit])


return (
<section>
<SectionWrapper>
<main className="flex flex-col">
{changelogs.length > 0 && changelogs.map((changelog, index) => (
<Changelog count={changelogs.length} index={index} key={changelog._id} changelog={changelog}/>
))}
</main>
{changelogs.length < totalChangelogCount && (
<div className="flex justify-center pt-20 pb-36">
<GradientBorderWrapper>
<button className="bg-brandOrange px-3 py-1 rounded-md font-bold" onClick={loadMore}>
Load More
</button>
</GradientBorderWrapper>
</div>
)}
</SectionWrapper>
</section>
)
}

export default Changelogs
17 changes: 17 additions & 0 deletions components/sections/changelog/Hero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react'
import { Heading, Typography } from '../../common/text'

const Hero = () => {
return (
<section className="z-40 py-24 tablet:py-36 border-slate-800 relative flex flex-col gap-y-5 from-transparent via-red-800 to-transparent">
<Heading alignSmall="center" >
$yellow-to-orangeChangelog$yellow-to-orange
</Heading>
<Typography alignSmall="center" variant="subheading">
See what’s new in OpenSauced.
</Typography>
</section>
)
}

export default Hero

0 comments on commit 6634167

Please sign in to comment.