-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cde013d
commit 2d773ef
Showing
10 changed files
with
34 additions
and
1,546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { BrowserRouter } from 'react-router-dom'; | ||
import Router from '@/routers'; | ||
import 'antd/dist/reset.css'; | ||
import './global.less'; | ||
import { ConfigProvider } from '@arco-design/web-react'; | ||
import zhCN from '@arco-design/web-react/es/locale/zh-CN'; | ||
|
||
function App() { | ||
export const App = () => { | ||
return ( | ||
<BrowserRouter> | ||
<Router /> | ||
</BrowserRouter> | ||
<ConfigProvider locale={zhCN}> | ||
<BrowserRouter> | ||
<Router /> | ||
</BrowserRouter> | ||
</ConfigProvider> | ||
) | ||
} | ||
|
||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import { createContext } from 'react'; | ||
import type { DirectionType } from 'antd/es/config-provider'; | ||
|
||
export interface SiteContextProps { | ||
isMobile: boolean; | ||
direction: DirectionType; | ||
} | ||
|
||
const SiteContext = createContext<SiteContextProps>({ | ||
isMobile: false, | ||
direction: 'ltr', | ||
}); | ||
|
||
export default SiteContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,11 @@ | ||
import React from 'react'; | ||
import { Dropdown } from 'antd'; | ||
import { | ||
SmileFilled, | ||
LogoutOutlined, | ||
} from '@ant-design/icons'; | ||
import { useOutlet, useLocation, useNavigate } from 'react-router-dom'; | ||
import { ProLayout } from '@ant-design/pro-components'; | ||
import { useOutlet } from 'react-router-dom'; | ||
|
||
const routes = [ | ||
{ | ||
path: '/dashboard', | ||
name: '欢迎', | ||
icon: <SmileFilled />, | ||
}, | ||
{ | ||
path: '/map', | ||
name: '地图', | ||
icon: <SmileFilled />, | ||
}, | ||
]; | ||
|
||
export const BasicLayout: React.FC = () => { | ||
export const BasicLayout = () => { | ||
const outlet = useOutlet(); | ||
const location = useLocation(); | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<ProLayout | ||
path="/" | ||
title="Vite React Starter" | ||
logo="/vite.svg" | ||
bgLayoutImgList={[ | ||
{ | ||
src: 'https://img.alicdn.com/imgextra/i2/O1CN01O4etvp1DvpFLKfuWq_!!6000000000279-2-tps-609-606.png', | ||
left: 85, | ||
bottom: 100, | ||
height: '303px', | ||
}, | ||
{ | ||
src: 'https://img.alicdn.com/imgextra/i2/O1CN01O4etvp1DvpFLKfuWq_!!6000000000279-2-tps-609-606.png', | ||
bottom: -68, | ||
right: -45, | ||
height: '303px', | ||
}, | ||
{ | ||
src: 'https://img.alicdn.com/imgextra/i3/O1CN018NxReL1shX85Yz6Cx_!!6000000005798-2-tps-884-496.png', | ||
bottom: 0, | ||
left: 0, | ||
width: '331px', | ||
}, | ||
]} | ||
location={location} | ||
siderMenuType="group" | ||
fixSiderbar={true} | ||
layout="mix" | ||
avatarProps={{ | ||
src: 'https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg', | ||
size: 'small', | ||
title: '七妮妮', | ||
render: (_: any, dom: React.ReactNode) => { | ||
return ( | ||
<Dropdown | ||
menu={{ | ||
items: [ | ||
{ | ||
key: 'logout', | ||
icon: <LogoutOutlined />, | ||
label: '退出登录', | ||
}, | ||
], | ||
}} | ||
> | ||
{dom} | ||
</Dropdown> | ||
); | ||
}, | ||
}} | ||
menuProps={{ | ||
onClick: (info: any) => { | ||
navigate(info.key); | ||
} | ||
}} | ||
route={{ | ||
path: '/', | ||
routes, | ||
}} | ||
> | ||
<> | ||
{outlet} | ||
</ProLayout> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +0,0 @@ | ||
// import { theme as antTheme } from 'antd'; | ||
// import { ThemeName } from '@/components/ThemeSwitch'; | ||
|
||
// const getAlgorithm = (themes: ThemeName[] = []) => | ||
// themes.map((theme) => { | ||
// if (theme === 'dark') { | ||
// return antTheme.darkAlgorithm; | ||
// } | ||
// if (theme === 'compact') { | ||
// return antTheme.compactAlgorithm; | ||
// } | ||
// return antTheme.defaultAlgorithm; | ||
// }); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters