diff --git a/web/src/routes/Main/Navbar.tsx b/web/src/routes/Main/Navbar.tsx index d7ac3f32..a14f1d1b 100644 --- a/web/src/routes/Main/Navbar.tsx +++ b/web/src/routes/Main/Navbar.tsx @@ -10,7 +10,7 @@ const NavbarNavItem: React.FC<{ return (
@@ -27,13 +27,13 @@ export const Navbar: React.FC = React.memo(() => { const userInfo = useAppSelector((state) => state.user.info); return ( -
+
{/* Navbar */}
diff --git a/web/src/routes/Main/Sidebar.tsx b/web/src/routes/Main/Sidebar.tsx new file mode 100644 index 00000000..e4ad9653 --- /dev/null +++ b/web/src/routes/Main/Sidebar.tsx @@ -0,0 +1,87 @@ +import React from 'react'; +import clsx, { ClassValue } from 'clsx'; +import { Icon } from '@iconify/react'; +import { Avatar } from '../../components/Avatar'; + +const SidebarItem: React.FC<{ + className?: ClassValue; + icon?: React.ReactNode; + action?: React.ReactNode; +}> = React.memo((props) => { + return ( +
+
+ {props.icon} +
+
{props.children}
+
+ {props.action} +
+
+ ); +}); +SidebarItem.displayName = 'SidebarItem'; + +const SidebarSection: React.FC<{ + action: React.ReactNode; +}> = React.memo((props) => { + return ( +
+ + {props.children} + +
+ {props.action} +
+
+ ); +}); +SidebarSection.displayName = 'SidebarSection'; + +/** + * 侧边栏组件 + */ +export const Sidebar: React.FC = React.memo(() => { + return ( +
+ {/* Sidebar */} + }> + 好友 + + }>插件中心 + + }>私信 + + } + action={} + > + 用户1 + + } + action={} + > + 用户1 + + } + action={} + > + 用户1 + + } + action={} + > + 用户1 + +
+ ); +}); +Sidebar.displayName = 'Sidebar'; diff --git a/web/src/routes/Main/index.tsx b/web/src/routes/Main/index.tsx index becf1b8c..6ce197e6 100644 --- a/web/src/routes/Main/index.tsx +++ b/web/src/routes/Main/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Navbar } from './Navbar'; import { MainProvider } from './Provider'; +import { Sidebar } from './Sidebar'; export const MainRoute: React.FC = React.memo(() => { return ( @@ -8,12 +9,8 @@ export const MainRoute: React.FC = React.memo(() => { -
- {/* Sidebar */} -
- 目标 -
-
+ +
{/* Main Content */}
diff --git a/web/tailwind.config.js b/web/tailwind.config.js index b965d362..a62320b5 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -9,22 +9,24 @@ module.exports = { darkMode: 'class', // or 'media' theme: { screens: { - 'lg': {'min': '1024px'}, - 'md': {'max': '767px'}, - 'sm': {'max': '639px'}, + lg: { min: '1024px' }, + md: { max: '767px' }, + sm: { max: '639px' }, }, extend: { borderRadius: { - "1/2": '50%' + '1/2': '50%', }, spacing: { - "142": "35.5rem" - } + 18: '4.5rem', + 142: '35.5rem', + }, }, }, variants: { extend: { opacity: ['disabled'], + display: ['group-hover'], borderRadius: ['hover'], }, },