diff --git a/app/(marketing)/layout.tsx b/app/(marketing)/layout.tsx
new file mode 100644
index 00000000..a190b22e
--- /dev/null
+++ b/app/(marketing)/layout.tsx
@@ -0,0 +1,14 @@
+import { ReactNode } from "react";
+import Footer from "components/sections/Footer";
+import Navigation from "components/sections/Navigation";
+
+export default function MarketingLayout({ children }: { children: ReactNode }) {
+ return (
+
= ({ tags, posts }) => {
- const router = useRouter();
-
- const activeTag = router.query.tag;
+ const searchParams = useSearchParams();
+ const activeTag = searchParams ? searchParams.get("tag") || undefined : undefined;
return (
diff --git a/components/sections/CallToAction.tsx b/components/sections/CallToAction.tsx
index 0a8eca75..33690dae 100644
--- a/components/sections/CallToAction.tsx
+++ b/components/sections/CallToAction.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import { Button } from "components/elements";
import { trackEvent } from "lib/posthog";
import Image from "next/image";
diff --git a/components/sections/FeaturedBlogPost.tsx b/components/sections/FeaturedBlogPost.tsx
index 0bc50c93..b81d67d8 100644
--- a/components/sections/FeaturedBlogPost.tsx
+++ b/components/sections/FeaturedBlogPost.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import { getAuthors } from "lib/blog/authors";
import { Post } from "lib/blog/posts";
import Image from "next/image";
diff --git a/components/sections/FeaturedBlogPosts.tsx b/components/sections/FeaturedBlogPosts.tsx
index 97cc7704..c997888f 100644
--- a/components/sections/FeaturedBlogPosts.tsx
+++ b/components/sections/FeaturedBlogPosts.tsx
@@ -1,6 +1,9 @@
+"use client";
+
import { Splide, SplideSlide, SplideTrack } from "@splidejs/react-splide";
import { Grid } from "@splidejs/splide-extension-grid";
import { Button } from "components/elements";
+
import { getAuthors } from "lib/blog/authors";
import { Post } from "lib/blog/posts";
import Image from "next/image";
diff --git a/components/sections/Features.tsx b/components/sections/Features.tsx
index 73eec8cf..5e9b863d 100644
--- a/components/sections/Features.tsx
+++ b/components/sections/Features.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import { Compile, Database, Deploy, Free, Open, Skip } from "components/svgs";
import Image from "next/image";
import { SignupButton } from "../elements";
diff --git a/components/sections/Footer.tsx b/components/sections/Footer.tsx
index 04acdfc8..5f0c6e29 100644
--- a/components/sections/Footer.tsx
+++ b/components/sections/Footer.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import clsx from "clsx";
import { YCombinator } from "components/svgs";
import { trackEvent } from "lib/posthog";
diff --git a/components/sections/FrequentlyAskedQuestions.tsx b/components/sections/FrequentlyAskedQuestions.tsx
index 88a4b0bd..c892bdd4 100644
--- a/components/sections/FrequentlyAskedQuestions.tsx
+++ b/components/sections/FrequentlyAskedQuestions.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import clsx from "clsx";
import { Button } from "components/elements";
import Image from "next/image";
diff --git a/components/sections/GetStarted.tsx b/components/sections/GetStarted.tsx
index dc2f2a15..9ae1eb44 100644
--- a/components/sections/GetStarted.tsx
+++ b/components/sections/GetStarted.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import Image from "next/image";
import { FC, useEffect, useRef, useState } from "react";
import clsx from "clsx";
diff --git a/components/sections/Hero.tsx b/components/sections/Hero.tsx
index 0fd8668a..d112a464 100644
--- a/components/sections/Hero.tsx
+++ b/components/sections/Hero.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import { Button, SignupButton } from "components/elements";
import Image from "next/image";
import { DISCORD_URL } from "../../lib/constants";
diff --git a/components/sections/HowItWorks.tsx b/components/sections/HowItWorks.tsx
index d61cdec7..907c4fda 100644
--- a/components/sections/HowItWorks.tsx
+++ b/components/sections/HowItWorks.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import { Splide, SplideSlide, SplideTrack } from "@splidejs/react-splide";
import clsx from "clsx";
import { CodeBlock } from "components/elements";
diff --git a/components/sections/LogosReferences.tsx b/components/sections/LogosReferences.tsx
index 1aae1fa1..a4691a37 100644
--- a/components/sections/LogosReferences.tsx
+++ b/components/sections/LogosReferences.tsx
@@ -1,3 +1,4 @@
+"use client";
import {
Cube,
Luminar,
diff --git a/components/sections/Navigation/index.tsx b/components/sections/Navigation/index.tsx
index 7c470517..03ef9414 100644
--- a/components/sections/Navigation/index.tsx
+++ b/components/sections/Navigation/index.tsx
@@ -6,7 +6,7 @@ import { Hamburger, Logo } from "components/svgs";
import { trackEvent } from "lib/posthog";
import dynamic from "next/dynamic";
import Link from "components/elements/Link";
-import { useRouter } from "next/router";
+import { usePathname } from "next/navigation";
import { useEffect, useState } from "react";
const ThemeSwitcher = dynamic(() => import("./ThemeSwitcher"), { ssr: false });
@@ -47,7 +47,7 @@ const LinkItem = ({
const Navigation = () => {
const [open, setOpen] = useState(false);
- const router = useRouter();
+ const pathname = usePathname();
useEffect(() => {
function updateMenu() {
@@ -130,7 +130,7 @@ const Navigation = () => {
href={href}
text={text}
setOpen={setOpen}
- active={router.pathname.includes(keyword)}
+ active={(pathname || "").includes(keyword)}
/>
))}
diff --git a/components/sections/Pricing.tsx b/components/sections/Pricing.tsx
index cb79f54f..d95bc8a4 100644
--- a/components/sections/Pricing.tsx
+++ b/components/sections/Pricing.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import { Splide, SplideSlide } from "@splidejs/react-splide";
import clsx from "clsx";
import { Button } from "components/elements";
diff --git a/components/sections/ProTrial.tsx b/components/sections/ProTrial.tsx
index 5ba5e2c2..a74e7c08 100644
--- a/components/sections/ProTrial.tsx
+++ b/components/sections/ProTrial.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import React from "react";
import { Button, SignupButton } from "components/elements";
import Image from "next/image";
diff --git a/components/sections/StarOnGithub.tsx b/components/sections/StarOnGithub.tsx
index 9609e5a7..a2733184 100644
--- a/components/sections/StarOnGithub.tsx
+++ b/components/sections/StarOnGithub.tsx
@@ -1,12 +1,14 @@
+"use client";
+
import { trackEvent } from "lib/posthog";
-import { useRouter } from "next/router";
+import { usePathname } from "next/navigation";
import { useEffect, useState } from "react";
const StarOnGithub = () => {
const [starOpen, setStarOpen] = useState(false);
const [mounted, setMounted] = useState(false);
- const router = useRouter();
+ const pathname = usePathname();
useEffect(() => {
if (localStorage.getItem("starred")) setStarOpen(false);
@@ -15,7 +17,7 @@ const StarOnGithub = () => {
setMounted(true);
}, []);
- if (router.pathname === "/cch") return null;
+ if (pathname === "/cch") return null;
return (
///
+///
// NOTE: This file should not be edited
-// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
+// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
diff --git a/pages/api/rss.ts b/pages/api/rss.ts
deleted file mode 100644
index 528f796c..00000000
--- a/pages/api/rss.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import type { NextApiRequest, NextApiResponse } from "next";
-import { exportedPosts } from "lib/blog/make-rss";
-
-export default function rss_feed(
- _: NextApiRequest,
- res: NextApiResponse,
-) {
- res.setHeader("Content-Type", "text/xml");
- res.status(200).send(exportedPosts);
-}
diff --git a/pages/index.tsx b/pages/index.tsx
deleted file mode 100644
index 76ab3974..00000000
--- a/pages/index.tsx
+++ /dev/null
@@ -1,96 +0,0 @@
-import {
- CallToAction,
- CommunitySupportedNumbers,
- FeaturedBlogPosts,
- FeaturedStarters,
- Features,
- FrequentlyAskedQuestions,
- GetStarted,
- Hero,
- HowItWorks,
- LogosReferences,
- Testimonials,
-} from "components/sections";
-import { getSortedPosts, Post } from "lib/blog/posts";
-import { GetStaticPropsResult } from "next";
-import { StarterAttrs } from "../components/elements/Starter";
-import { QuestionAttrs } from "../components/sections/FrequentlyAskedQuestions";
-import { landingQuestions, FeaturedStartersContent } from "../content";
-import { NextSeo } from "next-seo";
-import { ProTrial } from "components/sections/ProTrial";
-
-export async function getStaticProps(): Promise> {
- const posts = getSortedPosts(3);
- const starters = FeaturedStartersContent;
-
- // Fetch stargazers count from GitHub API
- const githubToken = process.env.GITHUB_ACCESS_TOKEN;
- const githubResponse = await fetch(
- "https://api.github.com/repos/shuttle-hq/shuttle",
- {
- headers: {
- Authorization: `token ${githubToken}`,
- },
- }
- );
- const repoData = await githubResponse.json();
- const stargazersCount = repoData.stargazers_count ?? 6000;
-
- return {
- props: {
- posts,
- starters,
- questions: landingQuestions,
- stargazersCount,
- },
- revalidate: 86400, // Revalidate every 24 hours
- };
-}
-
-interface Props {
- readonly posts: Post[];
- readonly starters: StarterAttrs[];
- readonly questions: QuestionAttrs[];
- readonly stargazersCount: number;
-}
-
-export default function Home({
- posts,
- starters,
- questions,
- stargazersCount,
-}: Props) {
- return (
- <>
-
- {/* 🚨 Beware of impersonators and scams! Never trust communication that are not from our official websites and socials.
*/}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
- );
-}
diff --git a/providers/IntercomProvider.tsx b/providers/IntercomProvider.tsx
index d08ea344..7aff030f 100644
--- a/providers/IntercomProvider.tsx
+++ b/providers/IntercomProvider.tsx
@@ -1,4 +1,4 @@
-import { useRouter } from "next/router";
+import { usePathname } from "next/navigation";
import { ReactElement, useEffect } from "react";
// declare Intercom for typescript
@@ -17,7 +17,7 @@ export default function IntercomProvider({
}: {
children: ReactElement;
}) {
- const router = useRouter();
+ const pathname = usePathname();
useEffect(() => {
(function () {
@@ -58,20 +58,10 @@ export default function IntercomProvider({
}, []); // eslint-disable-line react-hooks/exhaustive-deps
useEffect(() => {
- const handleRouteChange = () => {
- if (typeof window !== "undefined") {
- window?.Intercom("update", { app_id: APP_ID });
- }
- };
-
- router.events.on("routeChangeStart", handleRouteChange);
-
- // If the component is unmounted, unsubscribe
- // from the event with the `off` method:
- return () => {
- router.events.off("routeChangeStart", handleRouteChange);
- };
- }, [router.events]);
+ if (typeof window !== "undefined") {
+ window?.Intercom("update", { app_id: APP_ID });
+ }
+ }, [pathname]);
return children;
}
diff --git a/tsconfig.json b/tsconfig.json
index cdde52e4..ea03e7cc 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "es5",
- "lib": ["dom", "dom.iterable", "esnext"],
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@@ -14,8 +18,20 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
- "baseUrl": "."
+ "baseUrl": ".",
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ]
},
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
- "exclude": ["node_modules"]
+ "include": [
+ "next-env.d.ts",
+ "**/*.ts",
+ "**/*.tsx",
+ ".next/types/**/*.ts"
+ ],
+ "exclude": [
+ "node_modules"
+ ]
}