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:
@@ -1,6 +1,4 @@
|
|||||||
import type { SocialIcons } from "../types";
|
const socialIcons = {
|
||||||
|
|
||||||
const socialIcons: SocialIcons = {
|
|
||||||
Github: `<svg
|
Github: `<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
class="icon-tabler"
|
class="icon-tabler"
|
||||||
|
|||||||
+3
-27
@@ -1,3 +1,5 @@
|
|||||||
|
import type socialIcons from "@assets/socialIcons";
|
||||||
|
|
||||||
export type Site = {
|
export type Site = {
|
||||||
website: string;
|
website: string;
|
||||||
author: string;
|
author: string;
|
||||||
@@ -9,34 +11,8 @@ export type Site = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type SocialObjects = {
|
export type SocialObjects = {
|
||||||
name: SocialMedia;
|
name: keyof typeof socialIcons;
|
||||||
href: string;
|
href: string;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
linkTitle: string;
|
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