Skip to content

Commit 0ce4664

Browse files
committed
fix: replace a with Link tag
1 parent 0c1c724 commit 0ce4664

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

next.config.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
import createBundleAnalyzer from "@next/bundle-analyzer";
22
import { withPostHogConfig } from "@posthog/nextjs-config";
33
import type { NextConfig } from "next";
4+
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from "next/constants.js";
45

56
/**
67
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
78
* for Docker builds.
89
*/
9-
import "./src/env.config";
1010
import { env } from "@/env.config";
1111

12-
const isDev = process.argv.indexOf("dev") !== -1;
13-
const isBuild = process.argv.indexOf("build") !== -1;
14-
if (!process.env.VELITE_STARTED && (isDev || isBuild)) {
15-
process.env.VELITE_STARTED = "1";
16-
import("velite").then((m) => m.build({ watch: isDev, clean: !isDev }));
17-
}
18-
1912
const withBundleAnalyzer = createBundleAnalyzer({
2013
enabled: process.env.ANALYZE === "true",
2114
});
@@ -74,4 +67,13 @@ if (env.POSTHOG_API_KEY && env.POSTHOG_ENV_ID) {
7467
});
7568
}
7669

77-
export default nextConfig;
70+
export default (phase: string) => {
71+
const isDev = phase === PHASE_DEVELOPMENT_SERVER;
72+
const isBuild = phase === PHASE_PRODUCTION_BUILD;
73+
if (!process.env.VELITE_STARTED && (isDev || isBuild)) {
74+
process.env.VELITE_STARTED = "1";
75+
import("velite").then((m) => m.build({ watch: isDev, clean: !isDev }));
76+
}
77+
78+
return nextConfig;
79+
};

src/app/art/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Metadata, Route } from "next";
22
import Image from "next/image";
3+
import Link from "next/link";
34
import { MdArrowOutward } from "react-icons/md";
45
import { Header } from "@/components/base/Header";
56
import { CallToAction } from "@/components/interactive/CallToAction";
@@ -55,7 +56,7 @@ export default function ArtPage() {
5556
<div className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
5657
{allArtists.map((artist) =>
5758
artist.commissions.map((commission) => (
58-
<a
59+
<Link
5960
key={`${artist.slug}-${commission.slug}`}
6061
className="relative aspect-square w-full overflow-clip rounded-md border border-white/25 transition-all hover:scale-[101%] hover:shadow-xl"
6162
href={`/art/${artist.slug}/${commission.slug}`}
@@ -93,7 +94,7 @@ export default function ArtPage() {
9394
<span className="opacity-75">By {artist.name}</span>
9495
</div>
9596
</div>
96-
</a>
97+
</Link>
9798
))
9899
)}
99100
</div>

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"**/*.cjs",
4343
"**/*.js",
4444
".next/types/**/*.ts",
45-
".next/dev/types/**/*.ts"
45+
".next/dev/types/**/*.ts",
46+
".next\\dev/types/**/*.ts"
4647
]
4748
}

0 commit comments

Comments
 (0)