diff --git a/packages/dumi-theme-graphin/package.json b/packages/dumi-theme-graphin/package.json index ff65dcd47..c0c195400 100644 --- a/packages/dumi-theme-graphin/package.json +++ b/packages/dumi-theme-graphin/package.json @@ -19,12 +19,14 @@ "prism-react-renderer": "^1.1.1", "prismjs": "^1.21.0", "rc-tabs": "^11.7.1", + "react-i18next": "^11.8.7", + "react-slick": "^0.28.0", "react-use": "^17.1.1" }, "devDependencies": { "@testing-library/jest-dom": "^5.11.3", "@testing-library/react": "^10.4.8", - "dumi": "1.1.3", + "dumi": "1.1.5-0", "father": "^2.30.1", "global-dirs": "^2.1.0", "react-test-renderer": "^16.13.1" diff --git a/packages/dumi-theme-graphin/src/components/Banner/index.tsx b/packages/dumi-theme-graphin/src/components/Banner/index.tsx index 8fbcfda74..6f8b34660 100644 --- a/packages/dumi-theme-graphin/src/components/Banner/index.tsx +++ b/packages/dumi-theme-graphin/src/components/Banner/index.tsx @@ -6,8 +6,6 @@ import GitHubButton from 'react-github-button'; import gh from 'parse-github-url'; import classNames from 'classnames'; import { context } from 'dumi/theme'; - -import 'video-react/dist/video-react.css'; // @ts-ignore import styles from './Banner.module.less'; import Notification, { NotificationProps } from './Notification'; diff --git a/packages/dumi-theme-graphin/src/layout.tsx b/packages/dumi-theme-graphin/src/layout.tsx index 8bf6610e3..17b116a3b 100644 --- a/packages/dumi-theme-graphin/src/layout.tsx +++ b/packages/dumi-theme-graphin/src/layout.tsx @@ -107,8 +107,8 @@ const Layout: React.FC = ({ children, location }) => { locale, } = Context; - const { meta } = processRedirect(Context, location); - + const { meta, isDirect } = processRedirect(Context, location); + console.log('Context', Context, 'calculate meta', meta); const { url: repoUrl, branch, platform } = repository; const [menuCollapsed, setMenuCollapsed] = useState(true); const isSiteMode = mode === 'site'; @@ -130,8 +130,8 @@ const Layout: React.FC = ({ children, location }) => { const updatedTime: any = new Date(meta.updatedTime).toLocaleString([], { hour12: false }); const repoPlatform = { github: 'GitHub', gitlab: 'GitLab' }[(repoUrl || '').match(/(github|gitlab)/)?.[1] || 'nothing'] || platform; - - if (isEmpty(meta)) { + // 等dumi最新版发布后解决路由匹配问题 + if (isEmpty(meta) && !isDirect) { return (
{ if ((data as GraphinTreeData).children) { this.isTree = true; } - this.data = deepMix({}, data); + this.data = cloneDeep(data); }; initGraphInstance = () => {