Skip to content

Commit 8ceb141

Browse files
committed
add social icons. improve posthog logs
1 parent b5c0338 commit 8ceb141

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

app/profile/[login]/components/profile-timeline.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ const ProfileTimelineDescription: FC<ProfileTimelineDescriptionProps> = ({ type,
4848
const before = parseChangesetItem(changeset.b);
4949
const after = parseChangesetItem(changeset.a);
5050

51+
if (type === 'avatarUrl') {
52+
return (
53+
<div className="flex gap-2">
54+
<span>Avatar:</span>
55+
<span>changed</span>
56+
</div>
57+
);
58+
}
59+
5160
return (
5261
<div className="flex gap-2">
5362
<span className="shrink-0">{`${splitCamelCase(type)}:`}</span>

app/profile/[login]/utils/get-social-icon.ts

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
import { FaMastodon } from 'react-icons/fa';
2-
import { FaBluesky, FaXTwitter, FaInstagram, FaLinkedinIn, FaStackOverflow, FaNpm } from 'react-icons/fa6';
1+
import { FaMastodon, FaYoutube, FaTwitch } from 'react-icons/fa';
2+
import {
3+
FaBluesky,
4+
FaXTwitter,
5+
FaInstagram,
6+
FaLinkedinIn,
7+
FaStackOverflow,
8+
FaNpm,
9+
FaGitlab,
10+
FaGithub,
11+
} from 'react-icons/fa6';
312
import { IoShareSocialOutline } from 'react-icons/io5';
13+
import { SiBinance } from 'react-icons/si';
414

515
export const getSocialIcon = (provider: string, url: string = '') => {
616
switch (provider) {
@@ -24,6 +34,26 @@ export const getSocialIcon = (provider: string, url: string = '') => {
2434
return FaStackOverflow;
2535
}
2636

37+
if (url.indexOf('youtube.com') > -1) {
38+
return FaYoutube;
39+
}
40+
41+
if (url.indexOf('binance.com') > -1) {
42+
return SiBinance;
43+
}
44+
45+
if (url.indexOf('twitch.tv') > -1) {
46+
return FaTwitch;
47+
}
48+
49+
if (url.indexOf('gitlab.com') > -1) {
50+
return FaGitlab;
51+
}
52+
53+
if (url.indexOf('github.com') > -1) {
54+
return FaGithub;
55+
}
56+
2757
return IoShareSocialOutline;
2858
}
2959
}

lib/posthog/post-hog-provider.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import { Suspense, useEffect } from 'react';
77

88
export function PostHogProvider({ children }: { children: React.ReactNode }) {
99
useEffect(() => {
10+
if (process.env.NODE_ENV === 'development') {
11+
// Disable PostHog in development mode
12+
return;
13+
}
14+
1015
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
1116
api_host: '/ingest',
1217
ui_host: 'https://eu.posthog.com',

0 commit comments

Comments
 (0)