Skip to content

Commit a209cbf

Browse files
陈济民claude
andcommitted
Restyle contact: show email address as clickable text below buttons
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent f5923e1 commit a209cbf

1 file changed

Lines changed: 25 additions & 14 deletions

File tree

src/components/Contact.jsx

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { profile } from "../data/profile";
22

33
export default function Contact() {
4+
const nonEmailLinks = profile.socialLinks.filter((l) => l.icon !== "email");
5+
const emailLink = profile.socialLinks.find((l) => l.icon === "email");
6+
47
return (
58
<section id="contact" className="py-16 px-6">
69
<div className="max-w-xl mx-auto text-center">
@@ -11,21 +14,29 @@ export default function Contact() {
1114
I'm always open to discussing AI projects, research collaborations, or interesting
1215
opportunities.
1316
</p>
14-
<div className="flex justify-center gap-4 mb-8">
15-
{profile.socialLinks.map((link) => {
16-
const isMailto = link.url.startsWith("mailto:");
17-
return (
18-
<a
19-
key={link.name}
20-
href={link.url}
21-
{...(!isMailto && { target: "_blank", rel: "noopener noreferrer" })}
22-
className="inline-flex items-center gap-2 px-5 py-3 rounded-xl bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-purple-100 dark:hover:bg-purple-900/30 hover:text-purple-700 dark:hover:text-purple-300 transition-colors font-medium"
23-
>
24-
{{ github: "GitHub", openreview: "OpenReview", email: "Email" }[link.icon]}
25-
</a>
26-
);
27-
})}
17+
18+
{/* Buttons: GitHub, OpenReview */}
19+
<div className="flex justify-center gap-4 mb-6">
20+
{nonEmailLinks.map((link) => (
21+
<a
22+
key={link.name}
23+
href={link.url}
24+
target="_blank"
25+
rel="noopener noreferrer"
26+
className="inline-flex items-center gap-2 px-5 py-3 rounded-xl bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-purple-100 dark:hover:bg-purple-900/30 hover:text-purple-700 dark:hover:text-purple-300 transition-colors font-medium"
27+
>
28+
{{ github: "GitHub", openreview: "OpenReview" }[link.icon]}
29+
</a>
30+
))}
2831
</div>
32+
33+
{/* Email */}
34+
<a
35+
href={emailLink.url}
36+
className="text-base text-gray-500 dark:text-gray-400 hover:text-purple-600 dark:hover:text-purple-400 transition-colors"
37+
>
38+
{emailLink.url.replace("mailto:", "")}
39+
</a>
2940
</div>
3041
</section>
3142
);

0 commit comments

Comments
 (0)