Skip to content

Commit 4ba0c41

Browse files
committed
Remove theme switch, always use default theme
1 parent 5a318d9 commit 4ba0c41

File tree

9 files changed

+3914
-4095
lines changed

9 files changed

+3914
-4095
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"unused": "knip",
2626
"postinstall": "npm-run-all postinstall:*",
2727
"postinstall:components-assets": "cpy \"node_modules/@public-ui/components/assets/**/*\" static/assets --dot",
28-
"postinstall:themes-assets": "cpy \"node_modules/@public-ui/themes/assets/**/*\" static/assets --dot",
28+
"postinstall:themes-assets": "cpy \"node_modules/@public-ui/theme-default/assets/**/*\" static/assets --dot",
2929
"update": "pnpm ncu:minor && pnpm ncu:major",
3030
"regenerate:version": "rimraf i18n/en/docusaurus-plugin-content-docs/version-2.0 versioned_docs/version-2.0 versioned_readmes/2.0 versioned_sidebars/version-2.0-sidebars.json && npm run docusaurus docs:version 2.0"
3131
},
@@ -41,9 +41,9 @@
4141
"@leanup/form": "1.3.54",
4242
"@mdx-js/react": "3.1.0",
4343
"@monaco-editor/react": "4.6.0",
44-
"@public-ui/components": "next",
45-
"@public-ui/react": "next",
46-
"@public-ui/themes": "next",
44+
"@public-ui/components": "^2.0.0",
45+
"@public-ui/react": "^2.0.0",
46+
"@public-ui/theme-default": "^2.0.0",
4747
"classnames": "2.5.1",
4848
"docusaurus-lunr-search": "3.5.0",
4949
"mermaid": "11.4.1",

pnpm-lock.yaml

Lines changed: 3902 additions & 3901 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/update.deps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ rm -rf docs
1111
mv versioned_docs/version-$1/ docs
1212
rm -rf versioned_readmes/$1
1313
rm -rf versioned_sidebars/version-$1-sidebars.json
14-
pnpm i @public-ui/components@~$1 @public-ui/react@~$1 @public-ui/themes@~$1
14+
pnpm i @public-ui/components@~$1 @public-ui/react@~$1 @public-ui/theme-default@~$1
1515
pnpm run docusaurus docs:version $1
1616
mv readmes/ versioned_readmes/$1
1717

1818
# restore
1919
rm -rf docs
2020
mv bak.next.docs/ docs
21-
pnpm i @public-ui/components@latest @public-ui/react@latest @public-ui/themes@latest
21+
pnpm i @public-ui/components@latest @public-ui/react@latest @public-ui/theme-default@latest

src/shares/store.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.

src/shares/theme.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/theme/Navbar/ThemeSelect.tsx

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/theme/Navbar/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import { KolLinkButton } from '@public-ui/react';
22
import type { FunctionComponent, PropsWithChildren } from 'react';
33
import React from 'react';
44
// import { getDarkMode, setDarkMode } from '../../shares/store';
5-
import BrowserOnly from '@docusaurus/BrowserOnly';
65
import { LanguageSwitch } from '@site/src/components/LanguageSwitch';
76
import Navbar from '@theme-original/Navbar';
8-
import ThemeSelect from './ThemeSelect';
97
import { translate } from '@docusaurus/Translate';
108

119
export const NavbarWrapper: FunctionComponent<PropsWithChildren> = (props) => {
@@ -116,9 +114,6 @@ export const NavbarWrapper: FunctionComponent<PropsWithChildren> = (props) => {
116114
/>
117115
</div>*/}
118116
</div>
119-
<div className="flex-grow">
120-
<BrowserOnly>{() => <ThemeSelect />}</BrowserOnly>
121-
</div>
122117
</section>
123118
</div>
124119
</div>

src/theme/Root.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
import { register } from '@public-ui/components';
22
import { defineCustomElements } from '@public-ui/components/dist/loader';
3-
import { DEFAULT, ECL_EC, ECL_EU } from '@public-ui/themes';
3+
import { DEFAULT } from '@public-ui/theme-default';
44
import type { FunctionComponent, PropsWithChildren } from 'react';
5-
import React, { useEffect, useState } from 'react';
6-
import type { Theme } from '../shares/theme';
5+
import React, { useEffect } from 'react';
76

87
export const Root: FunctionComponent<PropsWithChildren> = (props) => {
9-
const [theme] = useState<Theme>('default');
10-
118
useEffect(() => {
12-
register([DEFAULT, ECL_EC, ECL_EU], [defineCustomElements], {
9+
register([DEFAULT], [defineCustomElements], {
1310
theme: {
14-
detect: 'auto',
11+
detect: 'fixed',
1512
},
1613
}).catch(console.warn);
1714
}, []);
1815

19-
return (
20-
<div id="doc-app" className={theme} data-theme={theme}>
21-
{props.children}
22-
</div>
23-
);
16+
return <div id="doc-app">{props.children}</div>;
2417
};
2518

2619
export default Root;

static/assets/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The assets folder typically contains all the static files that your project needs to function, that are not directly related to the codebase. These can include images, stylesheets (CSS files), scripts (JavaScript files), fonts, and other multimedia content. These files are often served directly to the user by the server, and are essential for the correct visual presentation and functionality of your application.

0 commit comments

Comments
 (0)