feat: add public user profiles
- Add GET /api/users/:username endpoint for public profiles - Create PublicProfilePage component with user stats and info - Add getUserByUsername function to API service - Add /:username route to App.jsx - Display user info: name, location, stats, WSDC ID, social links - Only show public data (no email or sensitive information) - Accessible only to authenticated users Users can now view public profiles of other users by visiting /<username>. The profile displays stats, location, WSDC ID, and social media links.
This commit is contained in:
@@ -11,6 +11,7 @@ import MatchChatPage from './pages/MatchChatPage';
|
||||
import RatePartnerPage from './pages/RatePartnerPage';
|
||||
import HistoryPage from './pages/HistoryPage';
|
||||
import ProfilePage from './pages/ProfilePage';
|
||||
import PublicProfilePage from './pages/PublicProfilePage';
|
||||
import VerificationBanner from './components/common/VerificationBanner';
|
||||
|
||||
// Protected Route Component with Verification Banner
|
||||
@@ -132,9 +133,18 @@ function App() {
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Public Profile - must be before default redirect */}
|
||||
<Route
|
||||
path="/:username"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<PublicProfilePage />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Default redirect */}
|
||||
<Route path="/" element={<Navigate to="/events" replace />} />
|
||||
<Route path="*" element={<Navigate to="/events" replace />} />
|
||||
</Routes>
|
||||
</AuthProvider>
|
||||
</BrowserRouter>
|
||||
|
||||
Reference in New Issue
Block a user