Maharshi Alpesh c1baa746b2
fix: replacing the light mode bg in to nextui-pro section (#4355)
* fix: replacing the light mode bg and adding bg to nextui-pro section on mobile

* fix: making the transitions smoother

* chore: removing the bg on mobile devices

* fix: pro section and improvements

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2024-12-20 10:05:43 -03:00

33 lines
803 B
TypeScript

"use client";
import {useTheme} from "next-themes";
import NextImage from "next/image";
import {useEffect, useState} from "react";
export const NextUIProImage = () => {
const [mounted, setMounted] = useState(false);
const {theme} = useTheme();
const isDarkMode = theme === "dark";
useEffect(() => {
setMounted(true);
}, []);
let imgSrc = isDarkMode
? "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/images/nextuipro-section-background.webp"
: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/images/nextuipro-section-background-light.webp";
if (!mounted) return null;
return (
<NextImage
alt="Hero Background"
className="opacity-0 animate-fadeIn"
height={3255}
quality={100}
src={imgSrc}
width={1920}
/>
);
};