perf: 使用 prettier 格式化代码;优化搜索组件
parent
f0be26199f
commit
58247055f1
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"printWidth": 80,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": false
|
||||||
|
}
|
@ -1,61 +1,74 @@
|
|||||||
import { Outlet, Link, NavLink } from 'react-router-dom';
|
import { Outlet, Link, NavLink } from 'react-router-dom'
|
||||||
import { Layout, Menu, ConfigProvider, theme, Row, Col, Typography, Flex, App as AntApp } from 'antd';
|
import {
|
||||||
import 'antd/dist/reset.css';
|
Layout,
|
||||||
import AppLogo from '@/assets/logo-gh.png';
|
Menu,
|
||||||
import 'dayjs/locale/zh-cn';
|
ConfigProvider,
|
||||||
import ErrorBoundary from '@/components/ErrorBoundary';
|
theme,
|
||||||
import { BUILD_VERSION, } from '@/config';
|
Row,
|
||||||
import { useThemeContext } from '@/stores/ThemeContext';
|
Col, App as AntApp
|
||||||
|
} from 'antd'
|
||||||
|
import 'antd/dist/reset.css'
|
||||||
|
import AppLogo from '@/assets/logo-gh.png'
|
||||||
|
import 'dayjs/locale/zh-cn'
|
||||||
|
import ErrorBoundary from '@/components/ErrorBoundary'
|
||||||
|
import { BUILD_VERSION } from '@/config'
|
||||||
|
import { useThemeContext } from '@/stores/ThemeContext'
|
||||||
|
|
||||||
|
const { Header, Content, Footer } = Layout
|
||||||
const { Header, Content, Footer } = Layout;
|
|
||||||
const { Title } = Typography;
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|
||||||
const { colorPrimary } = useThemeContext()
|
const { colorPrimary } = useThemeContext()
|
||||||
|
|
||||||
console.info('theme: ', theme)
|
return (
|
||||||
|
<ConfigProvider
|
||||||
return (
|
theme={{
|
||||||
<ConfigProvider
|
token: {
|
||||||
theme={{
|
colorPrimary: colorPrimary,
|
||||||
token: {
|
},
|
||||||
colorPrimary: colorPrimary,
|
algorithm: theme.defaultAlgorithm,
|
||||||
},
|
}}
|
||||||
algorithm: theme.defaultAlgorithm,
|
>
|
||||||
}}>
|
<AntApp>
|
||||||
<AntApp>
|
<ErrorBoundary>
|
||||||
<ErrorBoundary>
|
<Layout className="min-h-screen">
|
||||||
<Layout className='min-h-screen'>
|
<Header className="sticky top-0 z-10 w-full">
|
||||||
<Header className='sticky top-0 z-10 w-full'>
|
<Row gutter={{ md: 24 }} justify="start" align="middle">
|
||||||
<Row gutter={{ md: 24 }} justify='start' align='middle'>
|
<Col span={15}>
|
||||||
<Col span={15}>
|
<NavLink to="/">
|
||||||
<NavLink to='/'>
|
<img
|
||||||
<img src={AppLogo} className='float-left h-9 my-4 mr-6 ml-0 bg-white/30' alt='App logo' />
|
src={AppLogo}
|
||||||
</NavLink>
|
className="float-left h-9 my-4 mr-6 ml-0 bg-white/30"
|
||||||
<Menu
|
alt="App logo"
|
||||||
theme='dark'
|
/>
|
||||||
mode='horizontal'
|
</NavLink>
|
||||||
selectedKeys={['hotel']}
|
<Menu
|
||||||
items={[
|
theme="dark"
|
||||||
{ key: 'hotel', label: <Link to='/hotel/list'>喜玩酒店</Link> }
|
mode="horizontal"
|
||||||
]}
|
selectedKeys={['hotel']}
|
||||||
/>
|
items={[
|
||||||
</Col>
|
{
|
||||||
</Row>
|
key: 'hotel',
|
||||||
</Header>
|
label: <Link to="/hotel/list">喜玩酒店</Link>,
|
||||||
<Content className='p-6 m-0 min-h-72 bg-white flex justify-center'>
|
},
|
||||||
<div className='max-w-5xl w-full'>
|
]}
|
||||||
<Outlet />
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Header>
|
||||||
|
<Content className="p-6 m-0 min-h-72 bg-white flex justify-center">
|
||||||
|
<div className="max-w-5xl w-full">
|
||||||
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
</Content>
|
</Content>
|
||||||
<Footer>China Highlights International Travel Service Co., LTD, Version: {BUILD_VERSION}</Footer>
|
<Footer>
|
||||||
</Layout>
|
China Highlights International Travel Service Co., LTD, Version:{' '}
|
||||||
|
{BUILD_VERSION}
|
||||||
|
</Footer>
|
||||||
|
</Layout>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
</AntApp>
|
</AntApp>
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App
|
export default App
|
||||||
|
Loading…
Reference in New Issue