test background switchup

This commit is contained in:
James Wyndham 2024-06-05 11:20:39 +08:00
parent fc0e5395cf
commit 14f3eabd9b
1 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,7 @@
"use client";
import React, { ReactNode, useEffect, useState } from "react"; import { useTheme } from "next-themes";
import React, { ReactNode } from "react";
import Image from "next/image"; import Image from "next/image";
const Background = ({ const Background = ({
@ -9,14 +11,14 @@ const Background = ({
children: ReactNode; children: ReactNode;
className?: string; className?: string;
}) => { }) => {
// const { theme } = useTheme(); const { theme } = useTheme();
return ( return (
<div <div
className={"h-full relative w-full bg-center bg-no-repeat bg-cover bg-fixed flex flex-col " + className} className={"h-full relative w-full bg-center bg-no-repeat bg-cover bg-fixed flex flex-col " + className}
> >
<Image <Image
src={"/images/gradient.webp"} src={theme == "dark" ? "/images/gradient.webp": "/images/gradient.webp"}
alt="background" alt="background"
layout="fill" layout="fill"
objectFit="cover" objectFit="cover"