mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* 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>
33 lines
803 B
TypeScript
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}
|
|
/>
|
|
);
|
|
};
|