blob: 471d6c8220f93152463d32620c054c9bb30623e7 [file] [log] [blame]
Krishya2e0f49a2025-05-29 10:59:01 +08001import React, { useState } from 'react';
223010094952a0f2025-06-07 18:58:16 +08002import UserNav from './UserNav.jsx';
Krishya2e0f49a2025-05-29 10:59:01 +08003import UserProfile from './UserProfile.jsx';
4import NewbieTasks from './NewbieTasks.jsx';
223010094952a0f2025-06-07 18:58:16 +08005import Header from '../../components/Header.jsx';
Krishya2e0f49a2025-05-29 10:59:01 +08006import './UserProfile.css';
7
8const UserCenterPage = () => {
9 const [activeTab, setActiveTab] = useState('profile');
10
11 const renderContent = () => {
12 switch (activeTab) {
13 case 'profile':
14 return <UserProfile />;
15 case 'newbieTasks':
16 return <NewbieTasks />;
17 default:
18 return null;
19 }
20 };
21
22 return (
23 <div className="user-profile-container">
24 <Header />
25 <div className="user-center" style={{ display: 'flex' }}>
26 <UserNav activeKey={activeTab} onSelect={setActiveTab} />
27 <div className="common-card right-content" style={{ flex: 1, marginLeft: 20 }}>
28 {renderContent()}
29 </div>
30 </div>
31 </div>
32 );
33};
34
35export default UserCenterPage;