File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
1
import Image from "next/image" ;
2
+ import { ImageZoom } from "fumadocs-ui/components/image-zoom" ;
2
3
import type { ComponentProps } from "react" ;
3
4
4
5
type ImageProps = ComponentProps < typeof Image > ;
5
6
type Props = Omit < ImageProps , "src" > & {
6
7
darkSrc : string ;
7
8
lightSrc : string ;
8
- alt : string ;
9
9
} ;
10
10
11
11
const DualModeImage = ( {
@@ -15,25 +15,28 @@ const DualModeImage = ({
15
15
alt,
16
16
width = 800 ,
17
17
height = 600 ,
18
+ sizes = "100vw" ,
18
19
...props
19
20
} : Props ) => {
21
+ const commonProps = {
22
+ alt,
23
+ width,
24
+ height,
25
+ sizes,
26
+ ...props ,
27
+ } ;
28
+
20
29
return (
21
30
< >
22
- < Image
31
+ < ImageZoom
23
32
src = { lightSrc }
24
33
className = { `dark:hidden ${ className ?? "" } ` }
25
- alt = { alt }
26
- width = { width }
27
- height = { height }
28
- { ...props }
34
+ { ...commonProps }
29
35
/>
30
- < Image
36
+ < ImageZoom
31
37
src = { darkSrc }
32
38
className = { `hidden dark:block ${ className ?? "" } ` }
33
- alt = { alt }
34
- width = { width }
35
- height = { height }
36
- { ...props }
39
+ { ...commonProps }
37
40
/>
38
41
</ >
39
42
) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export const baseOptions: BaseLayoutProps = {
8
8
enabled : true ,
9
9
} ,
10
10
themeSwitch : {
11
- enabled : true ,
11
+ enabled : false , // Keep this false as the theme switch is handled by the component library
12
12
} ,
13
13
searchToggle : {
14
14
enabled : false ,
You can’t perform that action at this time.
0 commit comments