diff --git a/public/assets/social/discord.svg b/public/assets/social/discord.svg deleted file mode 100644 index ca654007..00000000 --- a/public/assets/social/discord.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/assets/social/facebook.svg b/public/assets/social/facebook.svg deleted file mode 100644 index 18d22f57..00000000 --- a/public/assets/social/facebook.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/public/assets/social/github.svg b/public/assets/social/github.svg deleted file mode 100644 index a8d11740..00000000 --- a/public/assets/social/github.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/public/assets/social/gitlab.svg b/public/assets/social/gitlab.svg deleted file mode 100644 index 95a22f10..00000000 --- a/public/assets/social/gitlab.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/assets/social/keybase.png b/public/assets/social/keybase.png deleted file mode 100644 index 837625d2..00000000 Binary files a/public/assets/social/keybase.png and /dev/null differ diff --git a/public/assets/social/mastodon.svg b/public/assets/social/mastodon.svg deleted file mode 100644 index 0f8baebf..00000000 --- a/public/assets/social/mastodon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/public/assets/social/medium.svg b/public/assets/social/medium.svg deleted file mode 100644 index b2666bf3..00000000 --- a/public/assets/social/medium.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/assets/social/misskey.png b/public/assets/social/misskey.png deleted file mode 100644 index b4eb18a5..00000000 Binary files a/public/assets/social/misskey.png and /dev/null differ diff --git a/public/assets/social/nintendo_switch.svg b/public/assets/social/nintendo_switch.svg deleted file mode 100644 index a0aa719e..00000000 --- a/public/assets/social/nintendo_switch.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/assets/social/pixiv.ico b/public/assets/social/pixiv.ico deleted file mode 100644 index fbb298cd..00000000 Binary files a/public/assets/social/pixiv.ico and /dev/null differ diff --git a/public/assets/social/pixiv.svg b/public/assets/social/pixiv.svg deleted file mode 100644 index 6c89b590..00000000 --- a/public/assets/social/pixiv.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/assets/social/playstation.svg b/public/assets/social/playstation.svg deleted file mode 100644 index e34340d8..00000000 --- a/public/assets/social/playstation.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/assets/social/pleroma.svg b/public/assets/social/pleroma.svg deleted file mode 100644 index 68e647e6..00000000 --- a/public/assets/social/pleroma.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/public/assets/social/steam.svg b/public/assets/social/steam.svg deleted file mode 100644 index af1c3362..00000000 --- a/public/assets/social/steam.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/public/assets/social/substack.svg b/public/assets/social/substack.svg deleted file mode 100644 index f4707f6a..00000000 --- a/public/assets/social/substack.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/public/assets/social/whatsapp.svg b/public/assets/social/whatsapp.svg deleted file mode 100644 index 5a0a8925..00000000 --- a/public/assets/social/whatsapp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/assets/social/youtube.svg b/public/assets/social/youtube.svg deleted file mode 100644 index 1b8e2426..00000000 --- a/public/assets/social/youtube.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/public/assets/social/zhihu.svg b/public/assets/social/zhihu.svg deleted file mode 100644 index 54cdb7eb..00000000 --- a/public/assets/social/zhihu.svg +++ /dev/null @@ -1,22 +0,0 @@ - \ No newline at end of file diff --git a/src/app/dashboard/[subdomain]/settings/social-platforms/page-component.tsx b/src/app/dashboard/[subdomain]/settings/social-platforms/page-component.tsx index 8f89e36e..3fb2ae3f 100644 --- a/src/app/dashboard/[subdomain]/settings/social-platforms/page-component.tsx +++ b/src/app/dashboard/[subdomain]/settings/social-platforms/page-component.tsx @@ -172,7 +172,7 @@ export default function SiteSettingsNavigationPage() { We support{" "} these platforms diff --git a/src/components/site/Platform.tsx b/src/components/site/Platform.tsx index e037d11c..e6ec942d 100644 --- a/src/components/site/Platform.tsx +++ b/src/components/site/Platform.tsx @@ -1,12 +1,19 @@ +"use client" + +import { useEffect, useState } from "react" + import { Image } from "~/components/ui/Image" import { Tooltip } from "~/components/ui/Tooltip" import { UniLink } from "~/components/ui/UniLink" import { cn } from "~/lib/utils" +const iconCDN = "https://cdn.simpleicons.org" + +// There is no need to set this icon if it is available by default `https://cdn.simpleicons.org/${platform}` export const PlatformsSyncMap: { [key: string]: { name: string - icon: string + icon?: string url?: string identityFormatTemplate?: string portfolioDomain?: string @@ -14,44 +21,39 @@ export const PlatformsSyncMap: { } = { telegram: { name: "Telegram", - icon: "/assets/social/telegram.svg", url: "https://t.me/{username}", }, tg_channel: { name: "Telegram Channel", - icon: "/assets/social/telegram.svg", + icon: `${iconCDN}/telegram`, url: "https://t.me/{username}", }, twitter: { name: "Twitter", - icon: "/assets/social/twitter.svg", url: "https://twitter.com/{username}", portfolioDomain: `https://twitter.com/`, }, twitter_id: { name: "Twitter", - icon: "/assets/social/twitter.svg", + icon: `${iconCDN}/twitter`, url: "https://twitter.com/i/user/{username}", }, pixiv: { name: "Pixiv", - icon: "/assets/social/pixiv.ico", url: "https://www.pixiv.net/users/{username}", portfolioDomain: `https://www.pixiv.net/`, }, substack: { name: "Substack", - icon: "/assets/social/substack.svg", url: "https://{username}.substack.com/", }, medium: { name: "Medium", - icon: "/assets/social/medium.svg", url: "https://medium.com/@{username}", }, github: { name: "GitHub", - icon: "/assets/social/github.svg", + icon: `${iconCDN}/github/_/fff`, url: "https://github.com/{username}", portfolioDomain: `https://github.com/`, }, @@ -68,21 +70,19 @@ export const PlatformsSyncMap: { }, zhihu: { name: "知乎", - icon: "/assets/social/zhihu.svg", url: "https://www.zhihu.com/people/{username}", }, playstation: { name: "PlayStation", - icon: "/assets/social/playstation.svg", url: "https://psnprofiles.com/{username}", }, "nintendo switch": { name: "Nintendo Switch", - icon: "/assets/social/nintendo_switch.svg", + icon: `${iconCDN}/nintendoswitch`, }, "discord server": { name: "Discord Server", - icon: "/assets/social/discord.svg", + icon: `${iconCDN}/discord`, url: "https://discord.gg/{username}", }, xiaoyuzhou: { @@ -93,55 +93,46 @@ export const PlatformsSyncMap: { }, steam: { name: "Steam", - icon: "/assets/social/steam.svg", url: "https://steamcommunity.com/id/{username}", }, steam_profiles: { name: "Steam", - icon: "/assets/social/steam.svg", + icon: `${iconCDN}/steam`, url: "https://steamcommunity.com/profiles/{username}", }, gitlab: { name: "Gitlab", - icon: "/assets/social/gitlab.svg", url: "https://gitlab.com/{username}", }, keybase: { name: "Keybase", - icon: "/assets/social/keybase.png", url: "https://keybase.io/{username}", }, youtube: { name: "Youtube", - icon: "/assets/social/youtube.svg", url: "https://youtube.com/@{username}", portfolioDomain: `https://youtube.com/`, }, facebook: { name: "Facebook", - icon: "/assets/social/facebook.svg", url: "https://facebook.com/{username}", }, whatsapp: { name: "Whatsapp", - icon: "/assets/social/whatsapp.svg", url: "https://wa.me/{username}", }, mastodon: { name: "Mastodon", - icon: "/assets/social/mastodon.svg", url: "https://{instance}/@{username}", identityFormatTemplate: "username@instance.ltd", }, misskey: { name: "Misskey", - icon: "/assets/social/misskey.png", url: "https://{instance}/@{username}", identityFormatTemplate: "username@instance.ltd", }, pleroma: { name: "Pleroma", - icon: "/assets/social/pleroma.svg", url: "https://{instance}/users/{username}", identityFormatTemplate: "username@instance.ltd", }, @@ -181,6 +172,12 @@ export const Platform = ({ break } + const [showImg, setShowImg] = useState(false) + + useEffect(() => { + setShowImg(true) + }, [platform]) + return ( - {PlatformsSyncMap[platform]?.icon ? ( + {showImg ? (