diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx
new file mode 100644
index 0000000..eed15ec
--- /dev/null
+++ b/src/components/Navbar.jsx
@@ -0,0 +1,30 @@
+import React from 'react';
+import { useUser } from '../context/UserContext';
+import { Link } from 'react-router-dom';
+
+const Navbar = () => {
+  const { user, logout } = useUser();
+
+  return (
+    <nav className="navbar">
+      <div className="logo">EchoTorrent</div>
+      <div className="nav-links">
+        {user ? (
+          <>
+            <Link to="/">主页</Link>
+            <Link to="/profile">个人中心</Link>
+            <Link to="/forum">论坛</Link>
+            <button onClick={logout}>退出登录</button>
+          </>
+        ) : (
+          <>
+            <Link to="/auth">登录/注册</Link>
+            <Link to="/forum">论坛</Link>
+          </>
+        )}
+      </div>
+    </nav>
+  );
+};
+
+export default Navbar;
\ No newline at end of file
