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:
2025-10-28 16:46:45 +08:00
parent 1284698948
commit bd817279db
11 changed files with 280 additions and 33 deletions

41
src/components/TopBar.tsx Normal file
View 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;