Skip to content

Commit

Permalink
refactor: 整理全局样式相关代码
Browse files Browse the repository at this point in the history
  • Loading branch information
ddadaal committed Mar 7, 2023
1 parent 2af0b3b commit 4eb7396
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 48 deletions.
2 changes: 1 addition & 1 deletion apps/mis-web/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 = () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/portal-web/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";


Expand Down
26 changes: 0 additions & 26 deletions apps/portal-web/src/styles/globalStyle.ts

This file was deleted.

3 changes: 2 additions & 1 deletion libs/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ export const GlobalStyle = createGlobalStyle`
// HACK
a {
color: ${({ theme }) => theme.token.colorPrimary};
color: ${({ theme }) => theme.token.colorPrimaryText};
}
`;


3 changes: 0 additions & 3 deletions libs/web/src/layouts/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -23,8 +22,6 @@ interface Props {

export function NavIcon({ src, alt, basePath = "" }: Props) {

const { dark } = useDarkMode();

return (
<AntdIcon
component={({ width, height, style, className, fill }: any) => (
Expand Down
17 changes: 3 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4eb7396

Please sign in to comment.