refactor: add top bar and adjust home page layout
- add top bar to show the title of web site - move ai input and input image into right side drawer
This commit is contained in:
41
src/components/TopBar.tsx
Normal file
41
src/components/TopBar.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import React from 'react';
|
||||
import { Grid } from 'antd';
|
||||
import { MenuOutlined, RobotOutlined } from '@ant-design/icons';
|
||||
import './TopBar.css';
|
||||
|
||||
type Props = {
|
||||
onToggleMenu?: () => void;
|
||||
onToggleInput?: () => void;
|
||||
isHome?: boolean;
|
||||
};
|
||||
|
||||
const TopBar: React.FC<Props> = ({ onToggleMenu, onToggleInput, isHome }) => {
|
||||
const screens = Grid.useBreakpoint();
|
||||
const isMobile = !screens.md;
|
||||
|
||||
return (
|
||||
<div className="topbar">
|
||||
<div className="topbar-left">
|
||||
{isMobile && (
|
||||
<button className="icon-btn" onClick={onToggleMenu} aria-label="打开/收起菜单">
|
||||
<MenuOutlined />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="topbar-title" role="heading" aria-level={1}>
|
||||
I FIND U
|
||||
</div>
|
||||
|
||||
<div className="topbar-right">
|
||||
{isHome && (
|
||||
<button className="icon-btn" onClick={onToggleInput} aria-label="打开/收起输入">
|
||||
<RobotOutlined />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TopBar;
|
||||
Reference in New Issue
Block a user