From 29b1fdb1f80f60e07a9c9dc7d334e7180af2b5d8 Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Wed, 29 Nov 2023 18:23:34 -0800 Subject: [PATCH 01/18] www: kind of working static build! --- packages/api/esbuild.mjs | 21 +- packages/api/package.json | 1 + packages/api/src/frontend-stub.ts | 39 ++- packages/www/.gitignore | 1 + packages/www/generate-static-manifest.mjs | 32 ++ packages/www/next.config.js | 318 ++++++++--------- packages/www/package.json | 2 +- packages/www/pages/[slug].tsx | 112 ------ .../www/pages/app/stream/[id]/other-page.tsx | 1 + packages/www/pages/blog/[slug].tsx | 324 ------------------ packages/www/pages/blog/category/[slug].tsx | 44 --- packages/www/pages/blog/index.tsx | 211 ------------ packages/www/pages/compare.tsx | 61 ---- .../livepeer-studio-vs-cloudflare-stream.tsx | 68 ---- .../pages/compare/livepeer-studio-vs-mux.tsx | 59 ---- packages/www/pages/contact.tsx | 164 --------- packages/www/pages/customers/[slug].tsx | 322 ----------------- packages/www/pages/customers/index.tsx | 181 ---------- packages/www/pages/pricing.tsx | 104 ------ packages/www/pages/use-cases/[slug].tsx | 193 ----------- packages/www/static-manifest.js | 233 +++++++++++++ yarn.lock | 5 + 22 files changed, 493 insertions(+), 2003 deletions(-) create mode 100644 packages/www/generate-static-manifest.mjs delete mode 100644 packages/www/pages/[slug].tsx create mode 100644 packages/www/pages/app/stream/[id]/other-page.tsx delete mode 100644 packages/www/pages/blog/[slug].tsx delete mode 100644 packages/www/pages/blog/category/[slug].tsx delete mode 100644 packages/www/pages/blog/index.tsx delete mode 100644 packages/www/pages/compare.tsx delete mode 100644 packages/www/pages/compare/livepeer-studio-vs-cloudflare-stream.tsx delete mode 100644 packages/www/pages/compare/livepeer-studio-vs-mux.tsx delete mode 100644 packages/www/pages/contact.tsx delete mode 100644 packages/www/pages/customers/[slug].tsx delete mode 100644 packages/www/pages/customers/index.tsx delete mode 100644 packages/www/pages/pricing.tsx delete mode 100644 packages/www/pages/use-cases/[slug].tsx create mode 100644 packages/www/static-manifest.js diff --git a/packages/api/esbuild.mjs b/packages/api/esbuild.mjs index 7b5dfd0830..76fe9e9cdb 100644 --- a/packages/api/esbuild.mjs +++ b/packages/api/esbuild.mjs @@ -1,4 +1,19 @@ -import esbuild from "esbuild"; +import * as esbuild from "esbuild"; +import { readFile } from "fs/promises"; + +let envPlugin = { + name: "env", + setup(build) { + // Any files from the static-build directory should be + build.onLoad({ filter: /.*static\-build.*/ }, async (args) => { + const contents = await readFile(args.path); + return { + contents: contents, + loader: "binary", + }; + }); + }, +}; (async () => { await esbuild.build({ @@ -12,5 +27,9 @@ import esbuild from "esbuild"; }, external: ["pg-native"], sourcemap: "inline", + // loader: { + // "/home/iameli/code/studio/packages/www/static-build/index.html": "binary", + // }, + plugins: [envPlugin], }); })(); diff --git a/packages/api/package.json b/packages/api/package.json index cda7e74545..b8471fed76 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -92,6 +92,7 @@ "livekit-server-sdk": "^1.2.5", "lodash": "^4.17.21", "m3u8-parser": "^4.4.0", + "mime": "^4.0.0", "minio": "^7.0.12", "morgan": "^1.9.1", "mqtt": "^4.2.6", diff --git a/packages/api/src/frontend-stub.ts b/packages/api/src/frontend-stub.ts index 30954db034..5287c814e2 100644 --- a/packages/api/src/frontend-stub.ts +++ b/packages/api/src/frontend-stub.ts @@ -1,6 +1,41 @@ +import express, { Request, Response } from "express"; +import frontend from "/home/iameli/code/studio/packages/www/static-manifest.js"; +import mime from "mime"; + +const resolveFile = (inputPath: string): string | null => { + // Exact match, easy! + if (frontend[inputPath]) { + return inputPath; + } + // /dashboard --> dashboard.html + const htmlPath = `${inputPath}.html`; + if (frontend[htmlPath]) { + return htmlPath; + } + // /dashboard/stream/abc123 --> /dashboard/stream/[id].html + const parts = inputPath.split("/").slice(0, -1); + const slugPath = `${parts.join("/")}/[id].html`; + console.log(`SLUG PATH: ${slugPath}`); + if (frontend[slugPath]) { + return slugPath; + } + return null; +}; + // Stub thing to call when we don't want the whole frontend there export default function () { - return (req, res, next) => { - next(); + return (req: Request, res: Response, next) => { + const path = decodeURIComponent(req.path.slice(1)); + const foundPath = resolveFile(path); + if (!foundPath) { + console.log(`no match for ${path}`); + return next(); + } else { + console.log(`found page for ${path}`); + } + const page = frontend[foundPath]; + const contentType = mime.getType(foundPath); + res.header("content-type", contentType); + res.send(Buffer.from(page)); }; } diff --git a/packages/www/.gitignore b/packages/www/.gitignore index 5e515be53b..e844f9981e 100644 --- a/packages/www/.gitignore +++ b/packages/www/.gitignore @@ -48,3 +48,4 @@ bin # Sitemap public/sitemap-0.xml +static-build diff --git a/packages/www/generate-static-manifest.mjs b/packages/www/generate-static-manifest.mjs new file mode 100644 index 0000000000..f76724c5fe --- /dev/null +++ b/packages/www/generate-static-manifest.mjs @@ -0,0 +1,32 @@ +import { resolve, relative, dirname } from "path"; +import { readdir, writeFile } from "fs/promises"; +import { fileURLToPath } from "url"; + +const __dirname = dirname(fileURLToPath(import.meta.url)); + +async function getFiles(dir) { + const dirents = await readdir(dir, { withFileTypes: true }); + const files = await Promise.all( + dirents.map((dirent) => { + const res = resolve(dir, dirent.name); + return dirent.isDirectory() ? getFiles(res) : res; + }) + ); + return Array.prototype.concat(...files); +} + +(async () => { + const output = [`module.exports = {`]; + const staticDir = resolve(__dirname, "./static-build"); + let files = await getFiles(staticDir); + files = files.map((file) => relative(staticDir, file)); + for (const file of files) { + output.push(` "${file}": require("./static-build/${file}"),`); + } + output.push(`};`); + await writeFile( + resolve(__dirname, "static-manifest.js"), + output.join("\n"), + "utf8" + ); +})(); diff --git a/packages/www/next.config.js b/packages/www/next.config.js index 0b4152ef4b..81cf7ea8d0 100644 --- a/packages/www/next.config.js +++ b/packages/www/next.config.js @@ -30,170 +30,176 @@ let config = { unoptimized: true, domains: ["cdn.sanity.io", "picsum.photos"], }, - async redirects() { - return [ - { - source: "/docs", - destination: "https://docs.livepeer.studio", - permanent: false, - }, - { - source: "/docs/api", - destination: "https://docs.livepeer.studio/category/api", - permanent: false, - }, - { - source: "/app/user", - destination: "/dashboard", - permanent: false, - }, - { - source: "/app/user/keys", - destination: "/dashboard/developers/api-keys", - permanent: false, - }, - { - source: "/app/user/billing", - destination: "/dashboard/billing", - permanent: false, - }, - { - source: "/app/user/plans", - destination: "/dashboard/billing/plans", - permanent: false, - }, - { - source: "/app/test-player", - destination: "/dashboard/stream-health", - permanent: false, - }, - { - source: "/dashboard/plans", - destination: "/dashboard/billing/plans", - permanent: false, - }, - { - source: "/app/user/usage", - destination: "/dashboard/usage", - permanent: false, - }, - { - source: "/dashboard/billing/usage", - destination: "/dashboard/usage", - permanent: false, - }, - { - source: "/jobs/technical-writer", - destination: "/jobs/1496366", - permanent: false, - }, - { - source: "/jobs/full-stack-video-engineer", - destination: "/jobs/1412799", - permanent: false, - }, - { - source: "/jobs/operations-manager", - destination: "/jobs/1466566", - permanent: false, - }, - { - source: "/jobs/video-developer-community-manager", - destination: "/jobs/1476601", - permanent: false, - }, - { - source: "/jobs/web3-developer-evangelist", - destination: "/jobs/1491881", - permanent: false, - }, - { - source: "/jobs/chief-operating-officer", - destination: "/jobs/1466562", - permanent: false, - }, - { - source: "/jobs/senior-video-infrastructure-engineer", - destination: "/jobs/1414584", - permanent: false, - }, - { - source: "/jobs/video-developer-success-manager", - destination: "/jobs/1476607", - permanent: false, - }, - { - source: "/jobs/senior-software-engineer-video-transcoding", - destination: "/jobs/1412803", - permanent: false, - }, - { - source: "/jobs/analytics-engineer", - destination: "/jobs/1496262", - permanent: false, - }, - { - source: "/jobs/protocol-engineer", - destination: "/jobs/1412804", - permanent: false, - }, - { - source: "/jobs/investor-relations-manager", - destination: "/jobs/1454503", - permanent: false, - }, - { - source: "/jobs/senior-product-marketing-manager", - destination: "/jobs/1454194", - permanent: false, - }, - { - source: "/jobs/senior-lead-product-manager", - destination: "/jobs/1454194", - permanent: false, - }, - { - source: "/jobs/content-marketing", - destination: "/jobs/1476609", - permanent: false, - }, - { - source: "/jobs/marketing-manager", - destination: "/jobs/1412808", - permanent: false, - }, - { - source: "/jobs/events-manager", - destination: "/jobs/1454453", - permanent: false, - }, - { - source: "/jobs/engineering-manager-livepeer-core-software", - destination: "/jobs/1478605", - permanent: false, - }, - { - source: "/jobs/technical-product-manager-orchestrator-experience", - destination: "/jobs/1496214", - permanent: false, - }, - { - source: "/team", - destination: - "https://livepeer.notion.site/livepeer/Livepeer-Inc-6898d5451e2b40e79b1225812f4f1705", - permanent: false, - }, - ]; - }, }; -if (!isStaticBuild) { +if (isStaticBuild) { + config = { + ...config, + output: "export", + distDir: "static-build", + }; +} else { config = { ...config, i18n: { locales: ["en", "es"], defaultLocale: "en", }, + async redirects() { + return [ + { + source: "/docs", + destination: "https://docs.livepeer.studio", + permanent: false, + }, + { + source: "/docs/api", + destination: "https://docs.livepeer.studio/category/api", + permanent: false, + }, + { + source: "/app/user", + destination: "/dashboard", + permanent: false, + }, + { + source: "/app/user/keys", + destination: "/dashboard/developers/api-keys", + permanent: false, + }, + { + source: "/app/user/billing", + destination: "/dashboard/billing", + permanent: false, + }, + { + source: "/app/user/plans", + destination: "/dashboard/billing/plans", + permanent: false, + }, + { + source: "/app/test-player", + destination: "/dashboard/stream-health", + permanent: false, + }, + { + source: "/dashboard/plans", + destination: "/dashboard/billing/plans", + permanent: false, + }, + { + source: "/app/user/usage", + destination: "/dashboard/usage", + permanent: false, + }, + { + source: "/dashboard/billing/usage", + destination: "/dashboard/usage", + permanent: false, + }, + { + source: "/jobs/technical-writer", + destination: "/jobs/1496366", + permanent: false, + }, + { + source: "/jobs/full-stack-video-engineer", + destination: "/jobs/1412799", + permanent: false, + }, + { + source: "/jobs/operations-manager", + destination: "/jobs/1466566", + permanent: false, + }, + { + source: "/jobs/video-developer-community-manager", + destination: "/jobs/1476601", + permanent: false, + }, + { + source: "/jobs/web3-developer-evangelist", + destination: "/jobs/1491881", + permanent: false, + }, + { + source: "/jobs/chief-operating-officer", + destination: "/jobs/1466562", + permanent: false, + }, + { + source: "/jobs/senior-video-infrastructure-engineer", + destination: "/jobs/1414584", + permanent: false, + }, + { + source: "/jobs/video-developer-success-manager", + destination: "/jobs/1476607", + permanent: false, + }, + { + source: "/jobs/senior-software-engineer-video-transcoding", + destination: "/jobs/1412803", + permanent: false, + }, + { + source: "/jobs/analytics-engineer", + destination: "/jobs/1496262", + permanent: false, + }, + { + source: "/jobs/protocol-engineer", + destination: "/jobs/1412804", + permanent: false, + }, + { + source: "/jobs/investor-relations-manager", + destination: "/jobs/1454503", + permanent: false, + }, + { + source: "/jobs/senior-product-marketing-manager", + destination: "/jobs/1454194", + permanent: false, + }, + { + source: "/jobs/senior-lead-product-manager", + destination: "/jobs/1454194", + permanent: false, + }, + { + source: "/jobs/content-marketing", + destination: "/jobs/1476609", + permanent: false, + }, + { + source: "/jobs/marketing-manager", + destination: "/jobs/1412808", + permanent: false, + }, + { + source: "/jobs/events-manager", + destination: "/jobs/1454453", + permanent: false, + }, + { + source: "/jobs/engineering-manager-livepeer-core-software", + destination: "/jobs/1478605", + permanent: false, + }, + { + source: "/jobs/technical-product-manager-orchestrator-experience", + destination: "/jobs/1496214", + permanent: false, + }, + { + source: "/team", + destination: + "https://livepeer.notion.site/livepeer/Livepeer-Inc-6898d5451e2b40e79b1225812f4f1705", + permanent: false, + }, + ]; + }, }; } diff --git a/packages/www/package.json b/packages/www/package.json index 8ebbf6beae..6e9e9678ff 100644 --- a/packages/www/package.json +++ b/packages/www/package.json @@ -7,7 +7,7 @@ "dev": "next", "dev:staging": "NEXT_PUBLIC_USE_STAGING_ENDPOINT=true yarn dev", "build": "next build", - "static": "STATIC_BUILD=true next build && STATIC_BUILD=true next export", + "static": "STATIC_BUILD=true next build", "start": "next start -p 3012", "postbuild": "next-sitemap", "type-check": "tsc --pretty --noEmit", diff --git a/packages/www/pages/[slug].tsx b/packages/www/pages/[slug].tsx deleted file mode 100644 index e410f0c3ec..0000000000 --- a/packages/www/pages/[slug].tsx +++ /dev/null @@ -1,112 +0,0 @@ -import Fade from "react-reveal/Fade"; -import Layout from "layouts/main"; -import imageUrlBuilder from "@sanity/image-url"; -import { getComponent } from "lib/utils"; -import { useRouter } from "next/router"; -import { Text, Box, Container } from "@livepeer/design-system"; -import { client } from "lib/client"; - -const Page = ({ - title, - metaTitle, - metaDescription, - metaUrl, - openGraphImage, - content, - noindex = false, - preview, -}) => { - const router = useRouter(); - const builder = imageUrlBuilder(client as any); - if (router.isFallback) { - return ( - - - Loading... - - - ); - } - - if (!content || !title) { - return ( - - - Error - - - ); - } - - return ( - - - {content.map((component, i) => ( - - {getComponent(component)} - - ))} - - - ); -}; - -export async function getStaticPaths() { - const queryForPaths = `*[_type in ["page", "solution"] && defined(slug.current)][].slug.current`; - const data: string[] = (await client.fetch(queryForPaths)) ?? []; - const paths = data - .filter((path) => path !== "jobs" && path !== "team") - .map((path) => ({ params: { slug: path } })); - return { - fallback: true, - paths, - }; -} - -export async function getStaticProps({ params, locale }) { - const { slug } = params; - const queryParams = { - slug, - }; - - const query = `*[_type in ["page", "solution"] && slug.current == $slug][0]`; - const pageData = (await client.fetch(query, queryParams)) ?? {}; - - return { - props: { - ...pageData, - }, - revalidate: 5, - }; -} - -Page.theme = "light-theme-green"; -export default Page; diff --git a/packages/www/pages/app/stream/[id]/other-page.tsx b/packages/www/pages/app/stream/[id]/other-page.tsx new file mode 100644 index 0000000000..1285f80d3f --- /dev/null +++ b/packages/www/pages/app/stream/[id]/other-page.tsx @@ -0,0 +1 @@ +export default () =>
Hi
; diff --git a/packages/www/pages/blog/[slug].tsx b/packages/www/pages/blog/[slug].tsx deleted file mode 100644 index c58dbf828c..0000000000 --- a/packages/www/pages/blog/[slug].tsx +++ /dev/null @@ -1,324 +0,0 @@ -import { - Container, - Flex, - Box, - Heading, - Link as A, -} from "@livepeer/design-system"; -import { blocksToText } from "lib/utils"; -import { useRouter } from "next/router"; -import BlockContent from "@sanity/block-content-to-react"; -import { client } from "lib/client"; -import Image from "next/image"; -import Layout from "layouts/main"; -import Link from "next/link"; -import BlogPlayer from "components/Site/BlogPlayer"; -import React from "react"; -import readingTime from "reading-time"; -import BlogCTA from "components/Site/BlogCTA"; -import { urlFor } from "lib/sanity"; -import Code from "components/Site/Code"; - -const serializers = { - types: { - code: (props: { - node: { - language: any; - code: - | string - | number - | boolean - | React.ReactElement> - | React.ReactFragment - | React.ReactPortal; - }; - }) => { - return ( - - {props.node.code} - - ); - }, - cta: (props: { - node: { - title: any; - variant: any; - internalLink: any; - anchorLink: any; - externalLink: any; - }; - }) => ( - - ), - "mux.video": (props: { node: { asset: { _ref: any } } }) => ( - - ), - }, -}; - -const Post = ({ - title, - mainImage, - author, - category, - publishedDate, - excerpt, - noindex = false, - preview, - contentRaw, - furtherReading, - metaTitle, - metaDescription, - metaUrl, - openGraphImage, -}) => { - const { isFallback, asPath } = useRouter(); - if (isFallback) { - return ( - - Loading... - - ); - } - // const text = blocksToText(contentRaw); - // const stats = readingTime(text); - - return ( - - - - - - - {new Date(publishedDate).toLocaleDateString("en-US", { - weekday: "long", - year: "numeric", - month: "long", - day: "numeric", - })} - - {category?.title && ( - - - {category.title} - - - )} - - - {title} - - - - By - - {author.image?.alt} - - - {author.name} - - - - {/* - {stats.text} - */} - - - {mainImage?.alt} - - - - - - - - - ); -}; - -Post.theme = "light-theme-green"; -export default Post; - -export async function getStaticPaths() { - const query = `*[_type=="post" && defined(slug.current)][].slug.current`; - const data = await client.fetch(query); - const paths = data.map((path: string) => ({ params: { slug: path } })); - - return { - fallback: true, - paths, - }; -} - -export async function getStaticProps({ params }) { - const { slug } = params; - - const queryParams = { - slug, - }; - - const query = `*[_type=="post" && slug.current == $slug][0]{..., - author->{...}, - category->{...}, - mainImage{ - asset->{...} - }, - }`; - const pageData = (await client.fetch(query, queryParams)) ?? {}; - - const furtherQuery = `*[_type == "post" && slug.current !=$slug] | order(_createdAt desc) [0..1]{ - ..., - author->{...}, - category->{...}, - mainImage{ - asset->{...} - }, - }`; - const furtherReads = await client.fetch(furtherQuery, queryParams); - - return { - props: { - ...pageData, - furtherReads, - }, - revalidate: 300, - }; -} diff --git a/packages/www/pages/blog/category/[slug].tsx b/packages/www/pages/blog/category/[slug].tsx deleted file mode 100644 index 590c129027..0000000000 --- a/packages/www/pages/blog/category/[slug].tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { client } from "lib/client"; -import BlogIndex from "../index"; - -export async function getStaticPaths() { - const categoriesQuery = `*[_type=="category" && defined(slug.current)][].slug.current`; - const categories = (await client.fetch(categoriesQuery)) ?? []; - const paths = categories.map((category) => ({ params: { slug: category } })); - - return { - fallback: true, - paths, - }; -} - -export async function getStaticProps({ params }) { - const { slug } = params; - - const queryParams = { - slug, - }; - const postQuery = `*[_type == "post" && defined(hide) && hide ==false && category._ref in (*[_type == "category" && slug.current == $slug]._id)]{ - ..., - author->{...}, - category->{...}, - mainImage{ - asset->{...} - }, - }`; - const posts = (await client.fetch(postQuery, queryParams)) ?? []; - - const categoriesQuery = `*[_type=="category"]`; - const categories = await client.fetch(categoriesQuery); - - return { - props: { - categories, - posts, - }, - revalidate: 1, - }; -} - -BlogIndex.theme = "light-theme-green"; -export default BlogIndex; diff --git a/packages/www/pages/blog/index.tsx b/packages/www/pages/blog/index.tsx deleted file mode 100644 index fb50255156..0000000000 --- a/packages/www/pages/blog/index.tsx +++ /dev/null @@ -1,211 +0,0 @@ -import { - Box, - Container, - Text, - Flex, - Grid, - Link as A, -} from "@livepeer/design-system"; -import { print } from "graphql/language/printer"; -import { request } from "graphql-request"; -import { useRouter } from "next/router"; -import allCategories from "../../queries/allCategories.gql"; -import allPosts from "../../queries/allPosts.gql"; -import BlogPostCard, { - FeaturedBlogPostCard, -} from "components/Site/BlogPostCard"; -import Fade from "react-reveal/Fade"; -import Layout from "layouts/main"; -import Link from "next/link"; -import { Blog as BlogContent } from "content"; -import { client } from "lib/client"; - -const BlogIndex = ({ categories, posts }) => { - const router = useRouter(); - const { - query: { slug }, - asPath, - } = router; - - if (router.isFallback) { - return ( - - Loading.... - - ); - } - - let featuredPost = posts - .sort( - (x, y) => - new Date(y.publishedDate).getTime() - - new Date(x.publishedDate).getTime() - ) - .find((p) => p.featured); - - // If no post is set as featured, default to the most recent post - if (!featuredPost) { - featuredPost = posts[0]; - } - - const seoData = - asPath === "/blog" - ? BlogContent.metaData - : categories - .filter((category) => category.slug.current === slug) - .map((category) => ({ - title: category.metaTitle, - description: category.metaDescription, - url: category.metaUrl, - }))?.[0]; - - return ( - - - - - - Blog - - - - - {/* {featuredPost && ( - - - - )} */} - {/* - {categories.map((c, i) => { - const isSelected = - slug === c.slug.current || (!slug && c.title === "All"); - return ( - - - - {c.title} - - - - ); - })} - */} - - {posts.map((p, i) => ( - - ))} - - - - - ); -}; - -export async function getStaticProps() { - // const client = getClient(); - - const postsQuery = `*[_type=="post" && defined(hide) && hide ==false && !(_id in path('drafts.**'))]{ - ..., - author->{...}, - category->{...}, - mainImage{ - asset->{...} - }}`; - const categoriesQuery = `*[_type=="category"]`; - const categories = await client.fetch(categoriesQuery); - const posts = await client.fetch(postsQuery); - - return { - props: { - categories, - posts, - }, - revalidate: 1, - }; -} - -BlogIndex.theme = "light-theme-green"; -export default BlogIndex; diff --git a/packages/www/pages/compare.tsx b/packages/www/pages/compare.tsx deleted file mode 100644 index 4f3b3e27ab..0000000000 --- a/packages/www/pages/compare.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import Layout from "layouts/main"; -import CompareHero from "components/Site/Compare/Hero"; -import CompareTable from "components/Site/Compare/Table"; -import { Container, Flex, Box, Text } from "@livepeer/design-system"; -import Prefooter from "components/Site/Prefooter"; -import { InfoCircledIcon } from "@radix-ui/react-icons"; -import { Contact as Content } from "content"; - -const Compare = () => { - return ( - - - - - - - - - - - - - All feature and pricing information is sourced from available - online information as of 7/28/2023. - - - - - - {/* - - - - */} - - - - ); -}; - -Compare.theme = "light-theme-green"; -export default Compare; diff --git a/packages/www/pages/compare/livepeer-studio-vs-cloudflare-stream.tsx b/packages/www/pages/compare/livepeer-studio-vs-cloudflare-stream.tsx deleted file mode 100644 index 39daa3bb3f..0000000000 --- a/packages/www/pages/compare/livepeer-studio-vs-cloudflare-stream.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import Layout from "layouts/main"; -import CompareHero from "components/Site/Compare/Hero"; -import CompareTable from "components/Site/Compare/Table"; -import { Container, Flex, Box, Text } from "@livepeer/design-system"; -import Prefooter from "components/Site/Prefooter"; -import { InfoCircledIcon } from "@radix-ui/react-icons"; -import { Compare as CompareContent } from "content"; - -const Compare = () => { - return ( - - - - - Livepeer Studio
vs Cloudflare Stream -
- } - /> - - - - - - - - - All feature and pricing information is sourced from available - online information as of 7/28/2023. - - - - - - {/* - - - - */} - - -
- ); -}; - -Compare.theme = "light-theme-green"; -export default Compare; diff --git a/packages/www/pages/compare/livepeer-studio-vs-mux.tsx b/packages/www/pages/compare/livepeer-studio-vs-mux.tsx deleted file mode 100644 index e4da68589a..0000000000 --- a/packages/www/pages/compare/livepeer-studio-vs-mux.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import Layout from "layouts/main"; -import CompareHero from "components/Site/Compare/Hero"; -import CompareTable from "components/Site/Compare/Table"; -import { Container, Flex, Box, Text } from "@livepeer/design-system"; -import Prefooter from "components/Site/Prefooter"; -import { InfoCircledIcon } from "@radix-ui/react-icons"; -import { Compare as CompareContent } from "content"; - -const Compare = () => { - return ( - - - - - Livepeer Studio
vs Mux -
- } - /> - - - - - - - - - All feature and pricing information is sourced from available - online information as of 7/28/2023. - - - - - - - -
- ); -}; - -Compare.theme = "light-theme-green"; -export default Compare; diff --git a/packages/www/pages/contact.tsx b/packages/www/pages/contact.tsx deleted file mode 100644 index 1c4adf2e5b..0000000000 --- a/packages/www/pages/contact.tsx +++ /dev/null @@ -1,164 +0,0 @@ -import Fade from "react-reveal/Fade"; -import Layout from "layouts/main"; -import { useRef, useState, useEffect } from "react"; -import { - Box, - Flex, - Text, - Grid, - Container, - TextField, - TextArea, - Button, -} from "@livepeer/design-system"; -import { useHubspotForm } from "hooks"; -import { useRouter } from "next/router"; -import { Contact as Content } from "content"; - -const ContactPage = () => { - const router = useRouter(); - const { query } = router; - const formEl = useRef(null); - const { data, handleSubmit } = useHubspotForm({ - portalId: process.env.NEXT_PUBLIC_HUBSPOT_PORTAL_ID, - formId: process.env.NEXT_PUBLIC_HUBSPOT_CONTACT_FORM_ID, - }); - - const [submitted, setSubmitted] = useState(false); - - useEffect(() => { - if (data) { - setSubmitted(true); - formEl.current.reset(); - router.push("/contact?submitted=true"); - let timer = setTimeout(() => { - setSubmitted(false); - }, 4500); - return () => { - clearTimeout(timer); - }; - } - }, [data]); - - return ( - - - - - - - - Speak with a Livepeer expert - - - - - - - - - - - -