Skip to content

Commit 5178507

Browse files
committed
refactor: Enhance user profile page with improved error handling and UI updates
- Refactored the user profile fetching logic to include a reusable fetch function with timeout handling. - Improved error messages for various fetch scenarios, enhancing user feedback. - Updated UI components for loading and error states, including a new back button and refined styling for better user experience. - Adjusted background gradients and added responsive design elements for mobile compatibility.
1 parent b2c89ef commit 5178507

File tree

2 files changed

+306
-94
lines changed

2 files changed

+306
-94
lines changed

components/publicProfile.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,20 @@ export default function PublicProfile({ profileData, eloData }) {
9191

9292
<style jsx>{`
9393
.public-profile-container {
94-
min-height: 100vh;
9594
width: 100%;
96-
background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
97-
background-attachment: fixed;
98-
padding: 20px;
95+
padding: 0;
9996
box-sizing: border-box;
10097
}
10198
10299
.public-profile-content {
103100
max-width: 1200px;
104101
margin: 0 auto;
105-
background: rgba(255, 255, 255, 0.05);
102+
background: var(--gradLight);
103+
backdrop-filter: blur(10px);
104+
-webkit-backdrop-filter: blur(10px);
106105
border-radius: 20px;
107-
backdrop-filter: blur(20px);
108-
border: 1px solid rgba(255, 255, 255, 0.1);
109-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
106+
border: 1px solid rgba(255, 255, 255, 0.2);
107+
filter: drop-shadow(0px 6px 7px rgba(0, 0, 0, 0.3));
110108
overflow: hidden;
111109
}
112110
@@ -121,10 +119,11 @@ export default function PublicProfile({ profileData, eloData }) {
121119
font-size: clamp(28px, 5vw, 48px);
122120
font-weight: bold;
123121
color: white;
124-
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
122+
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
125123
display: flex;
126124
align-items: center;
127125
justify-content: center;
126+
font-family: "Lexend", sans-serif;
128127
}
129128
130129
.public-profile-nav {
@@ -152,25 +151,28 @@ export default function PublicProfile({ profileData, eloData }) {
152151
gap: 8px;
153152
padding: 12px 24px;
154153
background: rgba(255, 255, 255, 0.05);
155-
border: 1px solid rgba(255, 255, 255, 0.1);
156-
border-radius: 25px;
154+
border: 1px solid rgba(255, 255, 255, 0.2);
155+
border-radius: 12px;
157156
color: white;
158157
font-size: 16px;
159158
font-weight: 500;
160159
cursor: pointer;
161160
transition: all 0.3s ease;
162161
white-space: nowrap;
162+
font-family: "Lexend", sans-serif;
163+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
163164
}
164165
165166
.public-profile-nav-item:hover {
166167
background: rgba(255, 255, 255, 0.1);
167168
transform: translateY(-2px);
169+
border-color: rgba(255, 255, 255, 0.3);
168170
}
169171
170172
.public-profile-nav-item.active {
171-
background: linear-gradient(135deg, #28a745, #20c997);
172-
border-color: transparent;
173-
box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
173+
background: var(--gradGreenBtn);
174+
border-color: rgba(255, 255, 255, 0.3);
175+
filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.3));
174176
}
175177
176178
.nav-icon {

0 commit comments

Comments
 (0)