site: optimization type & props (#43433)

* chore: optimization type & props

* fix: remove useless type
This commit is contained in:
thinkasany 2023-07-07 18:28:13 +08:00 committed by GitHub
parent 266e60aa95
commit 0d31270277
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -1,7 +1,6 @@
import type { FC } from 'react';
import React from 'react';
import type { IPreviewerProps } from 'dumi';
import { useTabMeta } from 'dumi';
import React from 'react';
import CodePreviewer from './CodePreviewer';
import DesignPreviewer from './DesignPreviewer';
@ -9,7 +8,7 @@ export interface AntdPreviewerProps extends IPreviewerProps {
originDebug?: IPreviewerProps['debug'];
}
const Previewer: FC<AntdPreviewerProps> = ({ ...props }) => {
const Previewer: React.FC<AntdPreviewerProps> = (props) => {
const tab = useTabMeta();
if (tab?.frontmatter.title === 'Design') {

View File

@ -14,7 +14,7 @@ export type ThemeSwitchProps = {
onChange: (value: ThemeName[]) => void;
};
const ThemeSwitch: React.FC<ThemeSwitchProps> = (props: ThemeSwitchProps) => {
const ThemeSwitch: React.FC<ThemeSwitchProps> = (props) => {
const { value = ['light'], onChange } = props;
const { token } = useSiteToken();
const { pathname, search } = useLocation();