chore: Remove unused code and dependencies

This commit is contained in:
mauro-balades
2024-08-27 16:31:58 +02:00
parent a76e74c0e7
commit a3cf78d83a
6 changed files with 19 additions and 25 deletions

View File

@@ -22,19 +22,6 @@ const nextConfig = {
compiler: {
styledComponents: true,
},
async headers() {
return [
{
source: "/",
headers: [
{
key: "Cache-Control",
value: "s-maxage=1, stale-while-revalidate=59",
},
],
},
]
}
};
export default nextConfig;

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

@@ -1,4 +1,3 @@
"use client";
import Footer from "@/components/footer";
import { Navigation } from "@/components/navigation";
@@ -6,10 +5,13 @@ import ReleaseNote from "@/components/release-note";
import { Button } from "@/components/ui/button";
import { releaseNotes } from "@/lib/release-notes";
import Link from "next/link";
import { redirect, useParams } from "next/navigation";
import { redirect } from "next/navigation";
export default function ReleaseNotePage() {
const params = useParams<{ version: string }>();
export async function generateStaticParams() {
return [{version: "latest"}, ...releaseNotes.map((note) => ({ version: note.version }))];
}
export default function ReleaseNotePage({ params }: { params: { version: string } }) {
const { version } = params;
if (version === "latest") {

View File

@@ -2,7 +2,7 @@
import Footer from "@/components/footer";
import { Navigation } from "@/components/navigation";
import ThemePage from "@/components/theme-page";
import { getThemeFromId } from "@/lib/themes";
import { getAllThemes, getThemeFromId } from "@/lib/themes";
import { Metadata, ResolvingMetadata } from "next";
export async function generateMetadata(
@@ -36,10 +36,18 @@ export async function generateMetadata(
};
}
export default async function ThemeInfoPage() {
export async function generateStaticParams() {
const themes = await getAllThemes();
return themes.map((theme) => ({
theme: theme.id,
}));
}
export default async function ThemeInfoPage({ params }: { params: { theme: string } }) {
const { theme } = params;
return (
<main className="flex min-h-screen flex-col items-center justify-start">
<ThemePage />
<ThemePage themeID={theme} />
<Footer />
<Navigation /> {/* At the bottom of the page */}
</main>

View File

@@ -6,11 +6,8 @@ import { useEffect, useState } from "react";
import Markdown from "react-markdown";
import '../app/privacy-policy/markdown.css';
import { ChevronLeft, LoaderCircleIcon } from "lucide-react";
import { useParams } from "next/navigation";
export default async function ThemePage() {
const params = useParams<{ theme: string }>();
const { theme: themeID } = params;
export default async function ThemePage({ themeID }: { themeID: string }) {
const theme = await getThemeFromId(themeID);
if (!theme) {

View File

@@ -1,4 +1,3 @@
"use client";
interface Fix {
description: string;
@@ -662,5 +661,6 @@ export const releaseNotes: ReleaseNote[] = [
].reverse();
export function releaseNoteIsAlpha(note: ReleaseNote) {
"use client";
return note.version.includes("-a.");
}