Skip to content

Commit 5982899

Browse files
committed
Replace SVGR with logo component
1 parent 2ef2e73 commit 5982899

File tree

7 files changed

+117
-1975
lines changed

7 files changed

+117
-1975
lines changed

app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import Link from "next/link";
4-
import Logo from "@/public/img/logo.svg";
4+
import Logo from "@/components/Logo";
55
import Card from "@/components/Card";
66
import toast from "react-hot-toast";
77

components/Logo.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
export default function Logo({ className }: { className?: string }) {
2+
return (
3+
<svg
4+
className={className}
5+
width="256"
6+
height="256"
7+
viewBox="0 0 256 256"
8+
fill="none"
9+
xmlns="http://www.w3.org/2000/svg"
10+
>
11+
<path
12+
d="M128 224L48 170.667V64L128 117.333L208 64V170.667L128 224Z"
13+
stroke="currentColor"
14+
stroke-width="12"
15+
stroke-linejoin="round"
16+
/>
17+
<path
18+
d="M117.333 160L90.6667 144V176L117.333 160Z"
19+
stroke="currentColor"
20+
stroke-width="12"
21+
stroke-linejoin="round"
22+
/>
23+
<path
24+
d="M165.333 144L138.667 160L165.333 176V144Z"
25+
stroke="currentColor"
26+
stroke-width="12"
27+
stroke-linejoin="round"
28+
/>
29+
</svg>
30+
);
31+
}

next.config.ts

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,5 @@
11
import type { NextConfig } from "next";
22

3-
const nextConfig: NextConfig = {
4-
webpack(config) {
5-
// # SVGR config
6-
7-
// Grab the existing rule that handles SVG imports
8-
const fileLoaderRule = config.module.rules.find((rule: any) =>
9-
rule.test?.test?.(".svg")
10-
);
11-
12-
config.module.rules.push(
13-
// Reapply the existing rule, but only for svg imports ending in ?url
14-
{
15-
...fileLoaderRule,
16-
test: /\.svg$/i,
17-
resourceQuery: /url/, // *.svg?url
18-
},
19-
// Convert all other *.svg imports to React components
20-
{
21-
test: /\.svg$/i,
22-
issuer: fileLoaderRule.issuer,
23-
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
24-
use: ["@svgr/webpack"],
25-
}
26-
);
27-
28-
// Modify the file loader rule to ignore *.svg, since we have it handled now.
29-
fileLoaderRule.exclude = /\.svg$/i;
30-
31-
return config;
32-
},
33-
};
3+
const nextConfig: NextConfig = {};
344

355
export default nextConfig;

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
},
1818
"devDependencies": {
1919
"@eslint/eslintrc": "^3",
20-
"@svgr/webpack": "^8.1.0",
2120
"@tailwindcss/postcss": "^4",
2221
"@types/node": "^20",
2322
"@types/react": "^19",

0 commit comments

Comments
 (0)