Skip to content

Commit 0ae911c

Browse files
authored
Merge pull request #104 from codeAKstan/feature/more-social-icon
Add more socila icons
2 parents 9526af5 + c975814 commit 0ae911c

3 files changed

Lines changed: 8024 additions & 8 deletions

File tree

www/components/ProfileSection.tsx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Image from "next/image";
2-
import { Github, Globe, Linkedin, Twitter, User } from "lucide-react";
2+
import { Github, Globe, Linkedin, Twitter, User, BookOpen, Instagram } from "lucide-react";
33
import { ProfileSkeleton } from "@/components/skeletons/profile-skeleton";
44
import { addUserToNocodb, getUserProfile } from "@/lib/api";
55
import ClientResumeButton from "@/components/ClientResumeButton";
@@ -25,6 +25,17 @@ const iconComponents = {
2525
linkedin: Linkedin,
2626
twitter: Twitter,
2727
generic: Globe,
28+
medium: BookOpen,
29+
instagram: Instagram,
30+
huggingface: Globe, // Using Globe for now as Lucide doesn't have a Hugging Face icon
31+
};
32+
33+
const detectProvider = (url: string): string => {
34+
const urlLower = url.toLowerCase();
35+
if (urlLower.includes('medium.com')) return 'medium';
36+
if (urlLower.includes('instagram.com')) return 'instagram';
37+
if (urlLower.includes('huggingface.co')) return 'huggingface';
38+
return 'generic';
2839
};
2940

3041
export async function ProfileSection({ username }: { username: string }) {
@@ -90,11 +101,14 @@ export async function ProfileSection({ username }: { username: string }) {
90101
</Tooltip>
91102
{user.social_accounts?.map((account) => {
92103
if (account.provider.toLowerCase() === "github") return null;
93-
const provider = account.provider.toLowerCase();
94-
const tooltipText =
95-
account.provider === "generic"
96-
? extractDomainName(account.url)
97-
: account.provider;
104+
105+
const provider = account.provider.toLowerCase() === "generic"
106+
? detectProvider(account.url)
107+
: account.provider.toLowerCase();
108+
109+
const tooltipText = provider === "generic"
110+
? extractDomainName(account.url)
111+
: provider;
98112

99113
return (
100114
<Tooltip key={account.url}>
@@ -166,4 +180,4 @@ export async function ProfileSection({ username }: { username: string }) {
166180
<SupportModal user={user} />
167181
</>
168182
);
169-
}
183+
}

0 commit comments

Comments
 (0)