layout.js 943 Bytes
Newer Older
dengxiaofeng's avatar
dengxiaofeng committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
import './global.less';
import 'moment/locale/zh-cn';

import React, { useEffect } from 'react';

import { ConfigProvider } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
import Layout from 'dumi-theme-default/src/layout';
import moment from 'moment';

moment.locale('zh-cn');

export default ({ children, ...props }) => {
  useEffect(() => {
    (function (h, o, t, j, a, r) {
      h.hj =
        h.hj ||
        function () {
          (h.hj.q = h.hj.q || []).push(arguments);
        };
      h._hjSettings = { hjid: 2036108, hjsv: 6 };
      a = o.getElementsByTagName('head')[0];
      r = o.createElement('script');
      r.async = 1;
      r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
      a.appendChild(r);
    })(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=');
  }, []);
  return (
    <ConfigProvider locale={zhCN}>
      <Layout {...props}>{children}</Layout>
    </ConfigProvider>
  );
邓晓峰's avatar
邓晓峰 committed
34
};