MadCcc
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
9 additions and
5 deletions
-
.dumi/theme/layouts/GlobalLayout.tsx
-
package.json
-
tests/shared/demoTest.tsx
|
|
@ -1,7 +1,7 @@ |
|
|
|
import React, { startTransition, useCallback, useEffect, useMemo } from 'react'; |
|
|
|
import { createSearchParams, useOutlet, useSearchParams } from 'dumi'; |
|
|
|
import { ConfigProvider, theme as antdTheme } from 'antd'; |
|
|
|
import { createCache, StyleProvider } from '@ant-design/cssinjs'; |
|
|
|
import { createCache, StyleProvider, logicalPropertiesLinter } from '@ant-design/cssinjs'; |
|
|
|
import type { DirectionType } from 'antd/es/config-provider'; |
|
|
|
import ThemeSwitch from '../common/ThemeSwitch'; |
|
|
|
import type { ThemeName } from '../common/ThemeSwitch'; |
|
|
@ -102,7 +102,7 @@ const GlobalLayout: React.FC = () => { |
|
|
|
); |
|
|
|
|
|
|
|
return ( |
|
|
|
<StyleProvider cache={styleCache}> |
|
|
|
<StyleProvider cache={styleCache} linters={[logicalPropertiesLinter]}> |
|
|
|
<SiteContext.Provider value={siteContextValue}> |
|
|
|
<ConfigProvider |
|
|
|
theme={{ |
|
|
|
|
|
@ -108,7 +108,7 @@ |
|
|
|
], |
|
|
|
"dependencies": { |
|
|
|
"@ant-design/colors": "^6.0.0", |
|
|
|
"@ant-design/cssinjs": "^1.3.0", |
|
|
|
"@ant-design/cssinjs": "^1.4.0", |
|
|
|
"@ant-design/icons": "^4.7.0", |
|
|
|
"@ant-design/react-slick": "~1.0.0", |
|
|
|
"@babel/runtime": "^7.18.3", |
|
|
|
|
|
@ -2,7 +2,7 @@ |
|
|
|
import * as React from 'react'; |
|
|
|
import { renderToString } from 'react-dom/server'; |
|
|
|
import glob from 'glob'; |
|
|
|
import { StyleProvider, createCache } from '@ant-design/cssinjs'; |
|
|
|
import { StyleProvider, createCache, logicalPropertiesLinter } from '@ant-design/cssinjs'; |
|
|
|
import { excludeWarning } from './excludeWarning'; |
|
|
|
import { render } from '../utils'; |
|
|
|
import { TriggerMockContext } from './demoTestContext'; |
|
|
@ -72,7 +72,11 @@ function baseText(doInject: boolean, component: string, options: Options = {}) { |
|
|
|
Demo = typeof Demo === 'function' ? <Demo /> : Demo; |
|
|
|
|
|
|
|
// Inject cssinjs cache to avoid create <style /> element
|
|
|
|
Demo = <StyleProvider cache={createCache()}>{Demo}</StyleProvider>; |
|
|
|
Demo = ( |
|
|
|
<StyleProvider cache={createCache()} linters={[logicalPropertiesLinter]}> |
|
|
|
{Demo} |
|
|
|
</StyleProvider> |
|
|
|
); |
|
|
|
|
|
|
|
render(Demo); |
|
|
|
|
|
|
|