Skip to content

Commit 34600ab

Browse files
committed
Fix favicon
1 parent b3031b7 commit 34600ab

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

app/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useState, useEffect } from "react";
44
import Link from "next/link";
55
import { signOut, useSession } from "next-auth/react";
66
import ThemeToggle from "@/lib/client/theme";
7-
import {favIcon} from "@/lib/client/media";
7+
import FavIcon from "@/components/FavIcon";
88

99
export default function Header() {
1010
const { data: session } = useSession();
@@ -37,7 +37,7 @@ export default function Header() {
3737
className="text-4xl font-bold hover:text-blue-600 transition-colors flex items-center"
3838
aria-label={isSmallScreen ? "Home" : "Compass"}
3939
>
40-
{favIcon()}
40+
<FavIcon className="dark:invert"/>
4141
{!isSmallScreen && (
4242
<span className="flex items-center gap-2">
4343
Compass

app/login/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {useRouter, useSearchParams} from "next/navigation";
55
import {Suspense, useEffect, useState} from "react";
66
import Link from "next/link";
77
import {FcGoogle} from "react-icons/fc";
8-
import {favIcon} from "@/lib/client/media";
8+
import FavIcon from "@/components/FavIcon";
99

1010
export default function LoginPage() {
1111
return (
@@ -72,7 +72,7 @@ function RegisterComponent() {
7272
<div className="max-w-md w-full space-y-8">
7373
<div>
7474
<div className="flex justify-center mb-6">
75-
{favIcon()}
75+
<FavIcon className="dark:invert"/>
7676
</div>
7777
<h2 className="mt-6 text-center text-3xl font-extrabold ">
7878
Sign in to your account

app/register/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Link from "next/link";
55
import {signIn} from "next-auth/react";
66
import {FcGoogle} from "react-icons/fc";
77
import {useSearchParams} from "next/navigation";
8-
import {favIcon} from "@/lib/client/media";
8+
import FavIcon from "@/components/FavIcon";
99

1010

1111
export default function RegisterPage() {
@@ -149,7 +149,7 @@ function RegisterComponent() {
149149
{/* The project is still in development...*/}
150150
{/*</h2>*/}
151151
<div className="flex justify-center mb-6">
152-
{favIcon()}
152+
<FavIcon className="dark:invert"/>
153153
</div>
154154
<h2 className="text-center text-3xl font-extrabold ">
155155
Get Started

components/FavIcon.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
import Image from "next/image";
3+
4+
type FavIconProps = React.SVGProps<SVGSVGElement>;
5+
6+
const FavIcon: React.FC<FavIconProps> = ({ className }) => (
7+
<Image src="/favicon.ico" alt="Compass logo" width={500} height={500} className={"w-12 h-12 " + className}/>
8+
);
9+
10+
export default FavIcon;
11+

lib/client/media.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,4 @@ export async function parseImage(img: string, setImage: any, batch = false) {
2121
setImage(url);
2222
}
2323
}
24-
2524
}
26-
27-
export function favIcon() {
28-
return <Image src="/favicon.ico" alt="Compass logo" width={500} height={500} className="w-12 h-12 dark:invert"/>
29-
}

0 commit comments

Comments
 (0)