mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
refactor: remove SocialObjects type and update SocialObjects type
- remove SocialMedia type from src/types.ts - generate each social icon type from socialIcons object instead
This commit is contained in:
+3
-27
@@ -1,3 +1,5 @@
|
||||
import type socialIcons from "@assets/socialIcons";
|
||||
|
||||
export type Site = {
|
||||
website: string;
|
||||
author: string;
|
||||
@@ -9,34 +11,8 @@ export type Site = {
|
||||
};
|
||||
|
||||
export type SocialObjects = {
|
||||
name: SocialMedia;
|
||||
name: keyof typeof socialIcons;
|
||||
href: string;
|
||||
active: boolean;
|
||||
linkTitle: string;
|
||||
}[];
|
||||
|
||||
export type SocialIcons = {
|
||||
[social in SocialMedia]: string;
|
||||
};
|
||||
|
||||
export type SocialMedia =
|
||||
| "Github"
|
||||
| "Facebook"
|
||||
| "Instagram"
|
||||
| "LinkedIn"
|
||||
| "Mail"
|
||||
| "Twitter"
|
||||
| "Twitch"
|
||||
| "YouTube"
|
||||
| "WhatsApp"
|
||||
| "Snapchat"
|
||||
| "Pinterest"
|
||||
| "TikTok"
|
||||
| "CodePen"
|
||||
| "Discord"
|
||||
| "GitLab"
|
||||
| "Reddit"
|
||||
| "Skype"
|
||||
| "Steam"
|
||||
| "Telegram"
|
||||
| "Mastodon";
|
||||
|
||||
Reference in New Issue
Block a user