Skip to content

Commit 408ed62

Browse files
committed
use imagezoom
1 parent d545ac2 commit 408ed62

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

apps/developer-hub/src/components/dual-mode-image.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import Image from "next/image";
2+
import { ImageZoom } from "fumadocs-ui/components/image-zoom";
23
import type { ComponentProps } from "react";
34

45
type ImageProps = ComponentProps<typeof Image>;
56
type Props = Omit<ImageProps, "src"> & {
67
darkSrc: string;
78
lightSrc: string;
8-
alt: string;
99
};
1010

1111
const DualModeImage = ({
@@ -15,25 +15,28 @@ const DualModeImage = ({
1515
alt,
1616
width = 800,
1717
height = 600,
18+
sizes = "100vw",
1819
...props
1920
}: Props) => {
21+
const commonProps = {
22+
alt,
23+
width,
24+
height,
25+
sizes,
26+
...props,
27+
};
28+
2029
return (
2130
<>
22-
<Image
31+
<ImageZoom
2332
src={lightSrc}
2433
className={`dark:hidden ${className ?? ""}`}
25-
alt={alt}
26-
width={width}
27-
height={height}
28-
{...props}
34+
{...commonProps}
2935
/>
30-
<Image
36+
<ImageZoom
3137
src={darkSrc}
3238
className={`hidden dark:block ${className ?? ""}`}
33-
alt={alt}
34-
width={width}
35-
height={height}
36-
{...props}
39+
{...commonProps}
3740
/>
3841
</>
3942
);

apps/developer-hub/src/config/layout.config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const baseOptions: BaseLayoutProps = {
88
enabled: true,
99
},
1010
themeSwitch: {
11-
enabled: true,
11+
enabled: false, // Keep this false as the theme switch is handled by the component library
1212
},
1313
searchToggle: {
1414
enabled: false,

0 commit comments

Comments
 (0)