|
|
@@ -1,3 +1,5 @@
|
|
|
+import Image from 'next/image';
|
|
|
+
|
|
|
import { Themes } from '~/stores/use-next-themes';
|
|
|
|
|
|
import { ThemeInjector } from './utils/ThemeInjector';
|
|
|
@@ -11,7 +13,22 @@ export const getBackgroundImageSrc = (colorScheme: Themes): string => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const ThemeHalloween = ({ children }: { children: JSX.Element }): JSX.Element => {
|
|
|
- return <ThemeInjector className={styles.theme}>{children}</ThemeInjector>;
|
|
|
+type Props = {
|
|
|
+ children: JSX.Element,
|
|
|
+ colorScheme?: Themes,
|
|
|
+}
|
|
|
+
|
|
|
+const ThemeHalloween = ({ children, colorScheme }: Props): JSX.Element => {
|
|
|
+ const element = (
|
|
|
+ <>
|
|
|
+ {colorScheme && (
|
|
|
+ <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}`}>{element}</ThemeInjector>;
|
|
|
};
|
|
|
export default ThemeHalloween;
|