ant-design/.dumi/theme/layouts/IndexLayout/index.tsx
Ricky 24ed2cf364
docs: fix site document title flash during page loading (#44631)
* fix: site document title rerender after dumi prerender

* fix: comment & index page listener render

* fix: define seperate layour for index page & seperate Helmet title + desc definition

---------

Co-authored-by: afc163 <afc163@gmail.com>
2023-10-07 14:23:52 +08:00

22 lines
589 B
TypeScript

import { Helmet } from 'dumi';
import type { PropsWithChildren } from 'react';
import React from 'react';
import Footer from '../../slots/Footer';
const IndexLayout: React.FC<PropsWithChildren<{ title: string; desc: string }>> = ({
children,
...restProps
}) => (
<>
<Helmet>
<title>{restProps.title}</title>
<meta property="og:title" content={restProps.title} />
{restProps.desc && <meta name="description" content={restProps.desc} />}
</Helmet>
<div style={{ minHeight: '100vh' }}>{children}</div>
<Footer />
</>
);
export default IndexLayout;