فهرست منبع

✨ feat(home): extract footer into separate component

- create Footer.tsx component to encapsulate footer functionality
- import and use Footer component in HomePage.tsx
- remove inline footer code from HomePage.tsx to improve code organization
yourname 8 ماه پیش
والد
کامیت
acdcf1e3f3
2فایلهای تغییر یافته به همراه20 افزوده شده و 12 حذف شده
  1. 18 0
      src/client/home/components/Footer.tsx
  2. 2 12
      src/client/home/pages/HomePage.tsx

+ 18 - 0
src/client/home/components/Footer.tsx

@@ -0,0 +1,18 @@
+import React from 'react';
+
+const Footer: React.FC = () => {
+  return (
+    <footer className="bg-white border-t border-gray-200 py-4">
+      <div className="container mx-auto px-4 text-center text-gray-500 text-sm">
+        网站模板 ©{new Date().getFullYear()} Created with React & Tailwind CSS
+        <div className="mt-2 space-x-4">
+          <a href="/admin" className="text-blue-600 hover:underline">管理后台</a>
+          <span className="text-gray-300">|</span>
+          <a href="/ui" className="text-blue-600 hover:underline">Api</a>
+        </div>
+      </div>
+    </footer>
+  );
+};
+
+export default Footer;

+ 2 - 12
src/client/home/pages/HomePage.tsx

@@ -1,6 +1,7 @@
 import React from 'react';
 import { useAuth } from '@/client/home/hooks/AuthProvider';
 import { useNavigate } from 'react-router-dom';
+import Footer from '@/client/home/components/Footer';
 
 const HomePage: React.FC = () => {
   const { user } = useAuth();
@@ -84,18 +85,7 @@ const HomePage: React.FC = () => {
           </div>
         </div>
       </main>
-      
-      {/* 页脚 */}
-      <footer className="bg-white border-t border-gray-200 py-4">
-        <div className="container mx-auto px-4 text-center text-gray-500 text-sm">
-          网站模板 ©{new Date().getFullYear()} Created with React & Tailwind CSS
-          <div className="mt-2 space-x-4">
-            <a href="/admin" className="text-blue-600 hover:underline">管理后台</a>
-            <span className="text-gray-300">|</span>
-            <a href="/ui" className="text-blue-600 hover:underline">Api</a>
-          </div>
-        </div>
-      </footer>
+      <Footer />
     </div>
   );
 };