Skip to content

Commit d346f43

Browse files
committed
make css modules for dual mode image
1 parent 543dc3c commit d346f43

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

apps/developer-hub/content/docs/oracle-integrity-staking/reward-examples.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: >-
44
This reference page provides examples of various scenarios to illustrate the Mathematical Representations of OIS.
55
---
66

7-
import DualModeImage from "../../../src/components/dual-mode-image";
7+
import DualModeImage from "../../../src/components/DualModeImage";
88

99
NOTE: All the symbols used in the examples are explained in the [Mathematical Representation](./mathematical-representation) section.
1010

apps/developer-hub/content/docs/oracle-integrity-staking/slashing-rulebook.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: >-
55
on the Pyth network.
66
---
77

8-
import DualModeImage from "../../../src/components/dual-mode-image";
8+
import DualModeImage from "../../../src/components/DualModeImage";
99

1010
# Purpose and Scope
1111

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.lightImage {
2+
display: block;
3+
4+
:global(.dark) & {
5+
display: none;
6+
}
7+
}
8+
9+
.darkImage {
10+
display: none;
11+
12+
:global(.dark) & {
13+
display: block;
14+
}
15+
}

apps/developer-hub/src/components/dual-mode-image.tsx renamed to apps/developer-hub/src/components/DualModeImage/index.tsx

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

6+
import styles from "./index.module.scss";
7+
58
type ImageProps = ComponentProps<typeof Image>;
69
type Props = Omit<ImageProps, "src"> & {
710
darkSrc: string;
@@ -30,12 +33,12 @@ const DualModeImage = ({
3033
<>
3134
<ImageZoom
3235
src={lightSrc}
33-
className={`dark:hidden ${className ?? ""}`}
36+
className={clsx(styles.lightImage, className)}
3437
{...commonProps}
3538
/>
3639
<ImageZoom
3740
src={darkSrc}
38-
className={`hidden dark:block ${className ?? ""}`}
41+
className={clsx(styles.darkImage, className)}
3942
{...commonProps}
4043
/>
4144
</>

0 commit comments

Comments
 (0)