Skip to content

Commit 0bd0af9

Browse files
committed
Update page styling
1 parent 66bbefe commit 0bd0af9

File tree

2 files changed

+14
-33
lines changed

2 files changed

+14
-33
lines changed

packages/search/src/routes/$profileId.lazy.tsx

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@ function Profile() {
6161
);
6262
}
6363

64-
// Get the best display name
65-
const displayName = profile.records?.name || profile.display || profile.name;
66-
67-
// Get avatar URL
68-
const avatarUrl = profile.avatar || profile.records?.avatar;
69-
70-
// Get banner URL
71-
const bannerUrl = profile.header || profile.records?.header;
72-
7364
// Format date for profile freshness
7465
const formatDate = (timestamp?: number) => {
7566
if (!timestamp) return 'Unknown';
@@ -83,11 +74,11 @@ function Profile() {
8374
return (
8475
<div className="bg-white shadow overflow-hidden rounded-lg">
8576
{/* Banner image */}
86-
{bannerUrl ? (
77+
{profile.header ? (
8778
<div className="w-full aspect-[3/1] overflow-hidden">
8879
<img
89-
src={bannerUrl}
90-
alt={`${displayName} banner`}
80+
src={profile.header}
81+
alt={`${profile.display} banner`}
9182
className="w-full h-full object-cover"
9283
/>
9384
</div>
@@ -99,20 +90,20 @@ function Profile() {
9990
<div className="px-4 py-5 sm:px-6 relative">
10091
<div className="flex items-end">
10192
<div className="-mt-16 flex-shrink-0">
102-
{avatarUrl ? (
93+
{profile.avatar ? (
10394
<img
104-
src={avatarUrl}
105-
alt={displayName}
95+
src={profile.avatar}
96+
alt={profile.display}
10697
className="h-24 w-24 rounded-full border-4 border-white shadow-md object-cover"
10798
/>
10899
) : (
109100
<div className="h-24 w-24 rounded-full bg-gray-200 flex items-center justify-center text-gray-500 text-3xl font-bold border-4 border-white shadow-md">
110-
{displayName.charAt(0).toUpperCase()}
101+
{profile.display.charAt(0).toUpperCase()}
111102
</div>
112103
)}
113104
</div>
114105
<div className="ml-4 flex-1">
115-
<h1 className="text-2xl font-bold text-gray-900">{displayName}</h1>
106+
<h1 className="text-2xl font-bold text-gray-900">{profile.display}</h1>
116107
<p className="text-sm text-gray-500">{profile.display || profile.name}</p>
117108
</div>
118109
</div>

packages/search/src/routes/index.lazy.tsx

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,6 @@ function Home() {
131131
e.preventDefault();
132132
};
133133

134-
// Helper function to get the best profile picture URL
135-
const getProfilePicture = (profile: any) => {
136-
return profile.avatar || profile.records?.avatar || null;
137-
};
138-
139-
// Helper function to get the best profile description
140-
const getDescription = (profile: any) => {
141-
return profile.records?.description || '';
142-
};
143-
144134
// Render search results or appropriate message
145135
const renderResults = () => {
146136
// Case 1: We have data to show
@@ -181,9 +171,9 @@ function Home() {
181171
<div className="flex items-start space-x-2 pb-3">
182172
{/* Avatar */}
183173
<div className={`${profile.header || profile.records?.header ? '-mt-7' : ''} flex-shrink-0`}>
184-
{getProfilePicture(profile) ? (
174+
{profile.avatar ? (
185175
<img
186-
src={getProfilePicture(profile)}
176+
src={profile.avatar}
187177
alt={profile.display}
188178
className="h-14 w-14 rounded-full border-2 border-white shadow-md object-cover"
189179
/>
@@ -203,7 +193,7 @@ function Home() {
203193
{profile.address}
204194
</p>
205195
<p className="mt-1 text-xs text-gray-600 whitespace-pre-line line-clamp-2">
206-
{getDescription(profile)}
196+
{profile.records?.description || ''}
207197
</p>
208198

209199
{/* Chain addresses */}
@@ -311,9 +301,9 @@ function Home() {
311301
<div className="flex items-start space-x-2 pb-3">
312302
{/* Avatar */}
313303
<div className={`${profile.header || profile.records?.header ? '-mt-7' : ''} flex-shrink-0`}>
314-
{getProfilePicture(profile) ? (
304+
{profile.avatar ? (
315305
<img
316-
src={getProfilePicture(profile)}
306+
src={profile.avatar}
317307
alt={profile.display}
318308
className="h-14 w-14 rounded-full border-2 border-white shadow-md object-cover"
319309
/>
@@ -333,7 +323,7 @@ function Home() {
333323
{profile.address}
334324
</p>
335325
<p className="mt-1 text-xs text-gray-600 whitespace-pre-line line-clamp-2">
336-
{getDescription(profile)}
326+
{profile.records?.description || ''}
337327
</p>
338328

339329
{/* Chain addresses */}

0 commit comments

Comments
 (0)