index.jsx 1.69 KB
Newer Older
wuhao's avatar
wuhao committed
1 2 3 4 5 6 7 8 9 10
/*
 * @Author: wuhao930406 1148547900@qq.com
 * @Date: 2023-10-17 10:14:53
 * @LastEditors: wuhao930406 1148547900@qq.com
 * @LastEditTime: 2023-10-17 15:58:12
 * @FilePath: /standaloneframe/frontend/src/layouts/index.jsx
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
 */
wuhao's avatar
wuhao committed
11 12 13 14 15 16 17 18 19 20
import { Link, Outlet, history } from "umi";
import { Button, ConfigProvider, theme, Segmented, Space, Divider } from "antd";
import styles from "./index.less";
import React, { useState, useEffect } from "react";
import { AppstoreOutlined, BarsOutlined } from "@ant-design/icons";
import IconFont from "@/components/IconFont";
import Switches from "@/components/Switches";
import zhCN from "antd/locale/zh_CN";
import "dayjs/locale/zh-cn";
import dayjs from "dayjs";
wuhao's avatar
wuhao committed
21
import themeconfig from "./components/theme";
wuhao's avatar
wuhao committed
22 23 24 25 26 27 28 29

dayjs.locale("zh-cn");

export default function Layout() {
  const [mode, setmode] = useState("light");
  return (
    <ConfigProvider
      theme={{
wuhao's avatar
wuhao committed
30 31
        algorithm: theme.darkAlgorithm,
        ...themeconfig,
wuhao's avatar
wuhao committed
32 33 34 35
      }}
      locale={zhCN}
    >
      <div
wuhao's avatar
wuhao committed
36
        style={{ backgroundColor:"#363636" }}
wuhao's avatar
wuhao committed
37 38
      >
        <div className="drag"></div>
wuhao's avatar
wuhao committed
39
        {/* <Space
wuhao's avatar
wuhao committed
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
          align="center"
          direction="horizontal"
          split={<Divider type="vertical" />}
          style={{
            justifyContent: "space-bewteen",
            position: "fixed",
            zIndex: 9999,
            right: 24,
            top: 26,
          }}
        >
          <Switches
            value={mode}
            onChange={(val) => {
              setmode(val);
            }}
          ></Switches>
wuhao's avatar
wuhao committed
57
        </Space> */}
wuhao's avatar
wuhao committed
58 59 60 61 62
        <Outlet context={{ mode }} />
      </div>
    </ConfigProvider>
  );
}