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:
satnaing
2024-01-09 11:06:09 +06:30
committed by Sat Naing
parent bb60a9b3db
commit db31df3ce4
2 changed files with 4 additions and 30 deletions
+3 -27
View File
@@ -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";