mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-12-05 14:18:58 -05:00
fix unnoticeable background color bug in dark mode
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import classNames from "classnames/bind";
|
||||
import type { PropsWithChildren } from "react";
|
||||
import type { PropsWithChildren, HTMLAttributes } from "react";
|
||||
|
||||
import styles from "./Wallpaper.module.css";
|
||||
const cx = classNames.bind(styles);
|
||||
|
||||
type Props = PropsWithChildren<{
|
||||
image: string;
|
||||
tile?: boolean;
|
||||
className?: string;
|
||||
}>;
|
||||
type Props = HTMLAttributes<HTMLDivElement> &
|
||||
PropsWithChildren<{
|
||||
image: string;
|
||||
tile?: boolean;
|
||||
}>;
|
||||
|
||||
const Wallpaper = ({ image, tile, className, ...rest }: Props) => {
|
||||
const bgRef = useRef<HTMLDivElement>(null);
|
||||
@@ -18,7 +18,7 @@ const Wallpaper = ({ image, tile, className, ...rest }: Props) => {
|
||||
bgRef.current.style.backgroundImage = `url(${image})`;
|
||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
return <div ref={bgRef} className={cx(styles.wallpaper, { tile: !!tile }, className)} {...rest} />;
|
||||
return <main ref={bgRef} className={cx(styles.wallpaper, { tile: !!tile }, className)} {...rest} />;
|
||||
};
|
||||
|
||||
export default Wallpaper;
|
||||
|
||||
Reference in New Issue
Block a user