Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.

Commit 61b4b78

Browse files
authored
Merge pull request #58 from renderghost/feature/issue-51-52-53-profile-improvements
Feature #51, #52, #53: Profile improvements
2 parents c6485a9 + 18c4043 commit 61b4b78

1 file changed

Lines changed: 80 additions & 65 deletions

File tree

‎src/components/profile/ProfileView.tsx‎

Lines changed: 80 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ export default function ProfileView({
6868

6969
const blueskyProfile = socialLinks.find((s) => s.platform === 'bluesky');
7070

71+
// Always include Bluesky profile from authenticated user
72+
const blueskyLink = {
73+
platform: 'bluesky' as const,
74+
url: `https://bsky.app/profile/${profile.handle}`,
75+
rkey: 'auto-bluesky', // Special key for auto-generated entry
76+
};
77+
78+
// Combine auto Bluesky with other social links, removing any manual Bluesky entries
79+
const allSocialLinks = [
80+
blueskyLink,
81+
...socialLinks.filter((s) => s.platform !== 'bluesky'),
82+
];
83+
7184
const getDisplayName = () => {
7285
const name = profile.displayName || profile.handle;
7386
if (profile.honorific && profile.honorific !== 'none') {
@@ -179,35 +192,8 @@ export default function ProfileView({
179192
</CardContent>
180193
</Card>
181194

182-
{/* Affiliations */}
183-
{currentAffiliations.length > 0 && (
184-
<Card>
185-
<CardHeader className="pb-3">
186-
<CardTitle className="text-lg flex items-center gap-2">
187-
<Building2 className="h-5 w-5" />
188-
Affiliations
189-
</CardTitle>
190-
</CardHeader>
191-
<CardContent className="space-y-4">
192-
{currentAffiliations.map((affiliation, idx) => (
193-
<div key={idx} className="space-y-1">
194-
<p className="font-black leading-normal">{affiliation.organizationName}</p>
195-
{affiliation.role && (
196-
<p className="text-sm text-foreground leading-normal">
197-
{affiliation.role}
198-
</p>
199-
)}
200-
<p className="text-sm text-foreground leading-normal">
201-
{new Date(affiliation.startDate).getFullYear()} - Present
202-
</p>
203-
</div>
204-
))}
205-
</CardContent>
206-
</Card>
207-
)}
208-
209-
{/* Social & Academic Links */}
210-
{socialLinks.length > 0 && (
195+
{/* Social Profiles */}
196+
{allSocialLinks.length > 0 && (
211197
<Card>
212198
<CardHeader className="pb-3">
213199
<CardTitle className="text-lg flex items-center gap-2">
@@ -216,25 +202,27 @@ export default function ProfileView({
216202
</CardTitle>
217203
</CardHeader>
218204
<CardContent className="space-y-3">
219-
{socialLinks.map((social) => {
220-
const displayName = social.platform === 'orcid'
221-
? 'ORCID'
222-
: social.platform.charAt(0).toUpperCase() + social.platform.slice(1);
223-
return (
224-
<div key={social.rkey} className="space-y-1">
225-
<p className="font-black leading-normal">{displayName}</p>
226-
<a
227-
href={social.url}
228-
target="_blank"
229-
rel="noopener noreferrer"
230-
className="inline-flex items-center gap-1 text-sm text-foreground hover:underline break-all leading-normal"
231-
>
232-
<ExternalLink className="h-3 w-3 shrink-0" />
233-
{formatDisplayURL(social.url)}
234-
</a>
235-
</div>
236-
);
237-
})}
205+
{allSocialLinks
206+
.sort((a, b) => a.platform.localeCompare(b.platform))
207+
.map((social) => {
208+
const displayName = social.platform === 'orcid'
209+
? 'ORCID'
210+
: social.platform.charAt(0).toUpperCase() + social.platform.slice(1);
211+
return (
212+
<div key={social.rkey} className="space-y-1">
213+
<p className="font-black leading-normal">{displayName}</p>
214+
<a
215+
href={social.url}
216+
target="_blank"
217+
rel="noopener noreferrer"
218+
className="inline-flex items-center gap-1 text-sm text-foreground hover:underline break-all leading-normal"
219+
>
220+
<ExternalLink className="h-3 w-3 shrink-0" />
221+
{formatDisplayURL(social.url)}
222+
</a>
223+
</div>
224+
);
225+
})}
238226
</CardContent>
239227
</Card>
240228
)}
@@ -361,28 +349,27 @@ export default function ProfileView({
361349
</Card>
362350
)}
363351

364-
{/* Web Links */}
365-
{webLinks.length > 0 && (
352+
{/* Affiliations */}
353+
{currentAffiliations.length > 0 && (
366354
<Card>
367355
<CardHeader className="pb-3">
368356
<CardTitle className="text-lg flex items-center gap-2">
369-
<LinkIcon className="h-5 w-5" />
370-
Other Links
357+
<Building2 className="h-5 w-5" />
358+
Affiliations
371359
</CardTitle>
372360
</CardHeader>
373-
<CardContent className="space-y-3">
374-
{webLinks.map((link) => (
375-
<div key={link.rkey} className="space-y-1">
376-
{link.title && <p className="font-black leading-normal">{link.title}</p>}
377-
<a
378-
href={link.url}
379-
target="_blank"
380-
rel="noopener noreferrer"
381-
className="inline-flex items-center gap-1 text-sm text-foreground hover:underline break-all leading-normal"
382-
>
383-
<ExternalLink className="h-3 w-3 shrink-0" />
384-
{formatDisplayURL(link.url)}
385-
</a>
361+
<CardContent className="space-y-4">
362+
{currentAffiliations.map((affiliation, idx) => (
363+
<div key={idx} className="space-y-1">
364+
<p className="font-black leading-normal">{affiliation.organizationName}</p>
365+
{affiliation.role && (
366+
<p className="text-sm text-foreground leading-normal">
367+
{affiliation.role}
368+
</p>
369+
)}
370+
<p className="text-sm text-foreground leading-normal">
371+
{new Date(affiliation.startDate).getFullYear()} - Present
372+
</p>
386373
</div>
387374
))}
388375
</CardContent>
@@ -421,6 +408,34 @@ export default function ProfileView({
421408
</Card>
422409
)}
423410

411+
{/* Other Links */}
412+
{webLinks.length > 0 && (
413+
<Card>
414+
<CardHeader className="pb-3">
415+
<CardTitle className="text-lg flex items-center gap-2">
416+
<LinkIcon className="h-5 w-5" />
417+
Other Links
418+
</CardTitle>
419+
</CardHeader>
420+
<CardContent className="space-y-3">
421+
{webLinks.map((link) => (
422+
<div key={link.rkey} className="space-y-1">
423+
{link.title && <p className="font-black leading-normal">{link.title}</p>}
424+
<a
425+
href={link.url}
426+
target="_blank"
427+
rel="noopener noreferrer"
428+
className="inline-flex items-center gap-1 text-sm text-foreground hover:underline break-all leading-normal"
429+
>
430+
<ExternalLink className="h-3 w-3 shrink-0" />
431+
{formatDisplayURL(link.url)}
432+
</a>
433+
</div>
434+
))}
435+
</CardContent>
436+
</Card>
437+
)}
438+
424439
{/* Skills */}
425440
{skills.length > 0 && (
426441
<Card>

0 commit comments

Comments
 (0)