ant-design/site/theme/template/Layout/SiteContext.tsx
lijianan 73e541911b
refactor: use typescript refactor javascript (#36907)
* refactor: rewrite header by FunctionComponent

* refactor: rewrite footer by FunctionComponent

* fix: strong type

* refactor: rewrite IconDisplay & PicSearcher & Category by FunctionComponent

* style: formatting

* pref: add useCallback/useMemo

* refactor: use typescript refactor javascript

* fix: remove string

* fix: fix eslint
2022-08-05 13:45:46 +08:00

18 lines
465 B
TypeScript

import * as React from 'react';
import type { DirectionType } from 'antd/es/config-provider';
export interface SiteContextProps {
isMobile: boolean;
direction: DirectionType;
theme?: string;
setTheme?: (theme: string, persist?: boolean) => void;
setIframeTheme?: (iframeNode: HTMLIFrameElement, theme: string) => void;
}
const SiteContext = React.createContext<SiteContextProps>({
isMobile: false,
direction: 'ltr',
});
export default SiteContext;