|
|
@@ -1,3 +1,5 @@
|
|
|
+import Image from 'next/image';
|
|
|
+
|
|
|
import { Themes } from '~/stores/use-next-themes';
|
|
|
|
|
|
import { ThemeInjector } from './utils/ThemeInjector';
|
|
|
@@ -11,7 +13,23 @@ export const getBackgroundImageSrc = (colorScheme: Themes): string => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const ThemeWood = ({ children }: { children: JSX.Element }): JSX.Element => {
|
|
|
- return <ThemeInjector className={styles.theme}>{children}</ThemeInjector>;
|
|
|
+type Props = {
|
|
|
+ children: JSX.Element,
|
|
|
+ colorScheme?: Themes,
|
|
|
+}
|
|
|
+
|
|
|
+const ThemeWood = ({ children, colorScheme }: Props): JSX.Element => {
|
|
|
+ const newChildren = (
|
|
|
+ <>
|
|
|
+ {colorScheme != null && (
|
|
|
+ <div className='grw-bg-image-wrapper'>
|
|
|
+ <Image className='grw-bg-image' alt='background-image' src={getBackgroundImageSrc(colorScheme)} layout='fill' quality="100" />
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {children}
|
|
|
+ </>
|
|
|
+ );
|
|
|
+ return <ThemeInjector className={styles.theme}>{newChildren}</ThemeInjector>;
|
|
|
};
|
|
|
+
|
|
|
export default ThemeWood;
|