Skip to content

Commit

Permalink
refactor: remove unused code (#2425)
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 committed May 18, 2023
1 parent e30d6f7 commit bcae582
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 94 deletions.
8 changes: 2 additions & 6 deletions apps/web/src/providers/theme-provider.tsx
@@ -1,4 +1,3 @@
import type { ThemeProviderProps } from '@affine/component';
import { ThemeProvider as NextThemeProvider, useTheme } from 'next-themes';
import type { PropsWithChildren } from 'react';
import { memo, useRef } from 'react';
Expand All @@ -21,12 +20,9 @@ const DesktopThemeSync = memo(function DesktopThemeSync() {
return null;
});

export const ThemeProvider = ({
children,
...props
}: PropsWithChildren<ThemeProviderProps>) => {
export const ThemeProvider = ({ children }: PropsWithChildren) => {
return (
<NextThemeProvider themes={themes} enableSystem={true} {...props}>
<NextThemeProvider themes={themes} enableSystem={true}>
{children}
<DesktopThemeSync />
</NextThemeProvider>
Expand Down
2 changes: 0 additions & 2 deletions packages/component/src/styles/index.ts
@@ -1,5 +1,3 @@
export * from './helper';
export * from './mui-theme';
export * from './mui-theme-provider';
export * from './types';
export * from './utils';
28 changes: 1 addition & 27 deletions packages/component/src/styles/mui-theme-provider.tsx
@@ -1,29 +1,3 @@
import { CssBaseline } from '@mui/material';
import {
alpha,
createTheme as createMuiTheme,
css,
keyframes,
styled,
type ThemeOptions,
ThemeProvider as MuiThemeProvider,
} from '@mui/material/styles';
import type { PropsWithChildren } from 'react';
import { useMemo } from 'react';
import { alpha, css, keyframes, styled } from '@mui/material/styles';

export { alpha, css, keyframes, styled };

export const AffineMuiThemeProvider = ({
theme,
children,
}: PropsWithChildren<{
theme: ThemeOptions;
}>) => {
const muiTheme = useMemo(() => createMuiTheme(theme), [theme]);
return (
<MuiThemeProvider theme={muiTheme}>
<CssBaseline />
{children}
</MuiThemeProvider>
);
};
2 changes: 0 additions & 2 deletions packages/component/src/styles/mui-theme.ts
@@ -1,5 +1,3 @@
import '@emotion/react';

import type {
Breakpoint,
BreakpointsOptions,
Expand Down
13 changes: 0 additions & 13 deletions packages/component/src/styles/types.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/component/src/styles/utils/index.ts

This file was deleted.

13 changes: 0 additions & 13 deletions packages/component/src/styles/utils/local-storage-theme-helper.ts

This file was deleted.

29 changes: 0 additions & 29 deletions packages/component/src/styles/utils/system-theme-helper.ts

This file was deleted.

0 comments on commit bcae582

Please sign in to comment.