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 { Layout, Menu, ConfigProvider, theme, Row, Col, Typography, Flex, 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';
|
||||
import { Outlet, Link, NavLink } from 'react-router-dom'
|
||||
import {
|
||||
Layout,
|
||||
Menu,
|
||||
ConfigProvider,
|
||||
theme,
|
||||
Row,
|
||||
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 { Title } = Typography;
|
||||
const { Header, Content, Footer } = Layout
|
||||
|
||||
function App() {
|
||||
|
||||
const { colorPrimary } = useThemeContext()
|
||||
|
||||
console.info('theme: ', theme)
|
||||
|
||||
return (
|
||||
<ConfigProvider
|
||||
theme={{
|
||||
token: {
|
||||
colorPrimary: colorPrimary,
|
||||
},
|
||||
algorithm: theme.defaultAlgorithm,
|
||||
}}>
|
||||
<AntApp>
|
||||
<ErrorBoundary>
|
||||
<Layout className='min-h-screen'>
|
||||
<Header className='sticky top-0 z-10 w-full'>
|
||||
<Row gutter={{ md: 24 }} justify='start' align='middle'>
|
||||
<Col span={15}>
|
||||
<NavLink to='/'>
|
||||
<img src={AppLogo} className='float-left h-9 my-4 mr-6 ml-0 bg-white/30' alt='App logo' />
|
||||
</NavLink>
|
||||
<Menu
|
||||
theme='dark'
|
||||
mode='horizontal'
|
||||
selectedKeys={['hotel']}
|
||||
items={[
|
||||
{ key: 'hotel', label: <Link to='/hotel/list'>喜玩酒店</Link> }
|
||||
]}
|
||||
/>
|
||||
</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 />
|
||||
return (
|
||||
<ConfigProvider
|
||||
theme={{
|
||||
token: {
|
||||
colorPrimary: colorPrimary,
|
||||
},
|
||||
algorithm: theme.defaultAlgorithm,
|
||||
}}
|
||||
>
|
||||
<AntApp>
|
||||
<ErrorBoundary>
|
||||
<Layout className="min-h-screen">
|
||||
<Header className="sticky top-0 z-10 w-full">
|
||||
<Row gutter={{ md: 24 }} justify="start" align="middle">
|
||||
<Col span={15}>
|
||||
<NavLink to="/">
|
||||
<img
|
||||
src={AppLogo}
|
||||
className="float-left h-9 my-4 mr-6 ml-0 bg-white/30"
|
||||
alt="App logo"
|
||||
/>
|
||||
</NavLink>
|
||||
<Menu
|
||||
theme="dark"
|
||||
mode="horizontal"
|
||||
selectedKeys={['hotel']}
|
||||
items={[
|
||||
{
|
||||
key: 'hotel',
|
||||
label: <Link to="/hotel/list">喜玩酒店</Link>,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</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>
|
||||
</Content>
|
||||
<Footer>China Highlights International Travel Service Co., LTD, Version: {BUILD_VERSION}</Footer>
|
||||
</Layout>
|
||||
</Content>
|
||||
<Footer>
|
||||
China Highlights International Travel Service Co., LTD, Version:{' '}
|
||||
{BUILD_VERSION}
|
||||
</Footer>
|
||||
</Layout>
|
||||
</ErrorBoundary>
|
||||
</AntApp>
|
||||
</ConfigProvider>
|
||||
)
|
||||
</AntApp>
|
||||
</ConfigProvider>
|
||||
)
|
||||
}
|
||||
|
||||
export default App
|
||||
|
Loading…
Reference in New Issue