Skip to content

Commit

Permalink
fix(view): antd upgrade errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MauriceNino committed Nov 19, 2022
1 parent b62aa4b commit 130e15b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
35 changes: 17 additions & 18 deletions apps/view/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ConfigProvider } from 'antd';
import { FC, useMemo } from 'react';
import {
createGlobalStyle,
Expand Down Expand Up @@ -52,9 +53,6 @@ const GlobalStyle = createGlobalStyle<{ noBg: boolean }>`
body {
background-color: ${({ theme, noBg }) =>
noBg ? 'transparent' : theme.colors.background};
--ant-primary-color: ${({ theme }) => theme.colors.primary};
--ant-primary-color-hover: ${({ theme }) => theme.colors.primary};
}
#root {
Expand All @@ -78,17 +76,9 @@ const GlobalStyle = createGlobalStyle<{ noBg: boolean }>`
background-image: unset;
}
.ant-switch-checked {
background: var(--ant-primary-color);
}
.ant-btn {
background: ${({ theme }) => theme.colors.background};
border: none;
&:hover, &:focus, &:active {
background: var(--ant-primary-color);
}
}
`;

Expand Down Expand Up @@ -136,13 +126,22 @@ export const App: FC = () => {

return (
<ThemeProvider theme={theme}>
<MobileContextProvider>
{query.isSingleGraphMode ? (
<SingleWidgetChart />
) : (
<MainWidgetContainer />
)}
</MobileContextProvider>
<ConfigProvider
theme={{
token: {
colorPrimary: theme.colors.primary,
colorPrimaryHover: theme.colors.primary,
},
}}
>
<MobileContextProvider>
{query.isSingleGraphMode ? (
<SingleWidgetChart />
) : (
<MainWidgetContainer />
)}
</MobileContextProvider>
</ConfigProvider>
<GlobalStyle noBg={query.isSingleGraphMode} />
</ThemeProvider>
);
Expand Down
1 change: 0 additions & 1 deletion apps/view/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'antd/dist/antd.variable.min.css';
import React from 'react';
import { createRoot } from 'react-dom/client';
import { App } from './App';
Expand Down

0 comments on commit 130e15b

Please sign in to comment.