diff --git a/apps/mis-web/src/pages/_app.tsx b/apps/mis-web/src/pages/_app.tsx index a5ed71a911..194313f591 100644 --- a/apps/mis-web/src/pages/_app.tsx +++ b/apps/mis-web/src/pages/_app.tsx @@ -16,6 +16,7 @@ import "antd/dist/reset.css"; import { failEvent, fromApi } from "@ddadaal/next-typed-api-routes-runtime/lib/client"; import { AntdConfigProvider } from "@scow/lib-web/build/layouts/AntdConfigProvider"; import { DarkModeProvider } from "@scow/lib-web/build/layouts/darkMode"; +import { GlobalStyle } from "@scow/lib-web/build/layouts/globalStyle"; import { getHostname } from "@scow/lib-web/build/utils/getHostname"; import { useConstant } from "@scow/lib-web/build/utils/hooks"; import { isServer } from "@scow/lib-web/build/utils/isServer"; @@ -37,7 +38,6 @@ import { DefaultClusterStore } from "src/stores/DefaultClusterStore"; import { User, UserStore, } from "src/stores/UserStore"; -import { GlobalStyle } from "src/styles/globalStyle"; import { publicConfig, runtimeConfig } from "src/utils/config"; const FailEventHandler: React.FC = () => { diff --git a/apps/portal-web/src/pages/_app.tsx b/apps/portal-web/src/pages/_app.tsx index 79135613c6..b313c72bb7 100644 --- a/apps/portal-web/src/pages/_app.tsx +++ b/apps/portal-web/src/pages/_app.tsx @@ -16,6 +16,7 @@ import "antd/dist/reset.css"; import { failEvent, fromApi } from "@ddadaal/next-typed-api-routes-runtime/lib/client"; import { AntdConfigProvider } from "@scow/lib-web/build/layouts/AntdConfigProvider"; import { DarkModeProvider } from "@scow/lib-web/build/layouts/darkMode"; +import { GlobalStyle } from "@scow/lib-web/build/layouts/globalStyle"; import { getHostname } from "@scow/lib-web/build/utils/getHostname"; import { useConstant } from "@scow/lib-web/build/utils/hooks"; import { isServer } from "@scow/lib-web/build/utils/isServer"; @@ -39,7 +40,6 @@ import { DefaultClusterStore } from "src/stores/DefaultClusterStore"; import { User, UserStore, } from "src/stores/UserStore"; -import { GlobalStyle } from "src/styles/globalStyle"; import { publicConfig, runtimeConfig } from "src/utils/config"; diff --git a/apps/portal-web/src/styles/globalStyle.ts b/apps/portal-web/src/styles/globalStyle.ts deleted file mode 100644 index 0ab990073d..0000000000 --- a/apps/portal-web/src/styles/globalStyle.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2022 Peking University and Peking University Institute for Computing and Digital Economy - * SCOW is licensed under Mulan PSL v2. - * You can use this software according to the terms and conditions of the Mulan PSL v2. - * You may obtain a copy of Mulan PSL v2 at: - * http://license.coscl.org.cn/MulanPSL2 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v2 for more details. - */ - -import { createGlobalStyle } from "styled-components"; - -export const GlobalStyle = createGlobalStyle` - #nprogress .bar { - background-color: ${({ theme }) => theme.token.colorPrimary}; - } - - // HACK - a { - color: ${({ theme }) => theme.token.colorPrimary}; - } -`; - - diff --git a/libs/web/package.json b/libs/web/package.json index e075a3dc59..8a6a2eb173 100644 --- a/libs/web/package.json +++ b/libs/web/package.json @@ -37,7 +37,8 @@ "@types/react-dom": "18.0.11", "react-is": "18.2.0", "@ant-design/icons": "5.0.1", - "dayjs": "1.11.7" + "dayjs": "1.11.7", + "@types/styled-components": "5.1.26" }, "author": "PKUHPC (https://github.com/PKUHPC)", "license": "Mulan PSL v2", diff --git a/apps/mis-web/src/styles/globalStyle.ts b/libs/web/src/layouts/globalStyle.tsx similarity index 93% rename from apps/mis-web/src/styles/globalStyle.ts rename to libs/web/src/layouts/globalStyle.tsx index 0ab990073d..0b902d2dea 100644 --- a/apps/mis-web/src/styles/globalStyle.ts +++ b/libs/web/src/layouts/globalStyle.tsx @@ -19,8 +19,7 @@ export const GlobalStyle = createGlobalStyle` // HACK a { - color: ${({ theme }) => theme.token.colorPrimary}; + color: ${({ theme }) => theme.token.colorPrimaryText}; } `; - diff --git a/libs/web/src/layouts/icon.tsx b/libs/web/src/layouts/icon.tsx index cbdbf14fea..2540a07526 100644 --- a/libs/web/src/layouts/icon.tsx +++ b/libs/web/src/layouts/icon.tsx @@ -12,7 +12,6 @@ import AntdIcon from "@ant-design/icons"; import Image from "next/image"; -import { useDarkMode } from "src/layouts/darkMode"; import { addBasePathToImage } from "src/utils/image"; interface Props { @@ -23,8 +22,6 @@ interface Props { export function NavIcon({ src, alt, basePath = "" }: Props) { - const { dark } = useDarkMode(); - return ( ( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a9556ea46d..597b0bafe3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -597,6 +597,7 @@ importers: '@types/mime-types': 2.1.1 '@types/react': 18.0.28 '@types/react-dom': 18.0.11 + '@types/styled-components': 5.1.26 antd: 5.3.0 dayjs: 1.11.7 mime-types: 2.1.35 @@ -615,6 +616,7 @@ importers: '@types/mime-types': registry.npmmirror.com/@types/mime-types/2.1.1 '@types/react': 18.0.28 '@types/react-dom': 18.0.11 + '@types/styled-components': 5.1.26 antd: 5.3.0_biqbaboplfbrettd7655fr4n2y dayjs: 1.11.7 next: 13.2.3_biqbaboplfbrettd7655fr4n2y @@ -6458,7 +6460,7 @@ packages: /axios/0.21.4_debug@4.3.4: resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} dependencies: - follow-redirects: 1.15.2_debug@4.3.4 + follow-redirects: 1.15.2 transitivePeerDependencies: - debug dev: true @@ -9279,19 +9281,6 @@ packages: peerDependenciesMeta: debug: optional: true - dev: false - - /follow-redirects/1.15.2_debug@4.3.4: - resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dependencies: - debug: 4.3.4 - dev: true /for-each/0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}