Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Commit bb3f629

Browse files
committed
fixed codeblock build error
1 parent 78fb775 commit bb3f629

File tree

3 files changed

+30
-16
lines changed

3 files changed

+30
-16
lines changed

src/components/other/SectionScroller/components/SectionLeftItem/index.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ export type Props = {
1111
};
1212

1313
const SectionLeftItem: React.FC<Props> = (props) => {
14-
const { code, active, forwardRef, style } = props;
14+
const { code, active, forwardRef, style } = props;
1515

16-
return (
17-
<div
18-
style={style}
19-
ref={forwardRef}
20-
className={clsx(styles.Container, {
21-
[styles.Container_Active]: active,
22-
})}>
23-
<CodeBlock style={{ position: 'relative' }} className={'javascript'}>
24-
{code}
25-
</CodeBlock>
26-
</div>
27-
);
16+
return (
17+
<div
18+
style={style}
19+
ref={forwardRef}
20+
className={clsx(styles.Container, {
21+
[styles.Container_Active]: active,
22+
})}>
23+
<CodeBlock style={{ position: 'relative' }} className={'javascript'}>
24+
{code}
25+
</CodeBlock>
26+
</div>
27+
);
2828
};
2929

3030
export default SectionLeftItem;

src/theme/Navbar/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ const Navbar = (): JSX.Element => {
102102
isSearchBarExpanded={isSearchBarExpanded}
103103
/>
104104
</div>
105-
<BrowserOnly>
106-
<Progressbar />
107-
</BrowserOnly>
105+
<BrowserOnly>{() => <Progressbar />}</BrowserOnly>
108106
</div>
109107

110108
{/* Donut */}

src/theme/hooks/usePrismTheme.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
2+
import { useAgile } from '@agile-ts/react';
3+
import core from '../../core';
4+
import defaultTheme from 'prism-react-renderer/themes/palenight';
5+
6+
const usePrismTheme = () => {
7+
const { siteConfig } = useDocusaurusContext();
8+
const prismTheme = siteConfig.themeConfig.prism.theme;
9+
const lightModeTheme = prismTheme.theme || defaultTheme;
10+
const darkModeTheme = prismTheme.darkTheme || lightModeTheme;
11+
const themeType = useAgile(core.ui.THEME_TYPE);
12+
13+
return themeType === 'dark' ? darkModeTheme : lightModeTheme;
14+
};
15+
16+
export default usePrismTheme;

0 commit comments

Comments
 (0)