diff --git a/package-lock.json b/package-lock.json index 895245cd..8f9f8797 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,6 @@ "react": "^19.2.3", "react-dom": "^19.2.3", "shiki": "^4.0.1", - "simple-icons": "^16.2.0", "svelte": "^5.46.1", "tailwind-merge": "^3.4.0", "tailwindcss": "^4.1.18", @@ -14855,25 +14854,6 @@ "dev": true, "license": "ISC" }, - "node_modules/simple-icons": { - "version": "16.10.0", - "resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-16.10.0.tgz", - "integrity": "sha512-62kuxaG3pE+cFNerudUtwb9BLmudzayHrlHkvU9gf8Nxcj7VYOm9dh3WNbGaFk60aQtfnRyzViZaouFG2B45kg==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/simple-icons" - }, - { - "type": "github", - "url": "https://github.com/sponsors/simple-icons" - } - ], - "license": "CC0-1.0", - "engines": { - "node": ">=0.12.18" - } - }, "node_modules/sirv": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", diff --git a/package.json b/package.json index 1dc1ffd9..2653b73a 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,6 @@ "react": "^19.2.3", "react-dom": "^19.2.3", "shiki": "^4.0.1", - "simple-icons": "^16.2.0", "svelte": "^5.46.1", "tailwind-merge": "^3.4.0", "tailwindcss": "^4.1.18", diff --git a/src/components/ui/icon/icon.astro b/src/components/ui/icon/icon.astro index 6d103533..79cec60a 100644 --- a/src/components/ui/icon/icon.astro +++ b/src/components/ui/icon/icon.astro @@ -9,58 +9,23 @@ interface Props extends Omit, 'name' | 'href'> { const { name, href, ...rest } = Astro.props; const hrefMap = { - 'x.com': 'x', - twitter: 'twitter', - facebook: 'facebook', - instagram: 'instagram', - pinterest: 'pinterest', - youtube: 'youtube', - tiktok: 'tiktok', - snapchat: 'snapchat', - reddit: 'reddit', - tumblr: 'tumblr', - 'wa.me': 'whatsapp', - telegram: 'telegram', - discord: 'discord', - vimeo: 'vimeo', - flickr: 'flickr', - yelp: 'yelp', - spotify: 'spotify', - behance: 'behance', - dribbble: 'dribbble', - soundcloud: 'soundcloud', github: 'github', - twitch: 'twitch', 'tel:': 'phone', 'mailto:': 'mail', 'maps.app.goo.gl': 'map-pin', linkedin: 'linkedin', } as const; -const icons = import.meta.glob([ - 'node_modules/lucide-static/icons/*.svg', - 'node_modules/simple-icons/icons/*.svg', -]); +const icons = import.meta.glob('node_modules/lucide-static/icons/*.svg'); -// Get the right path from the icons glob const foundPath = () => { - let foundPath: string | undefined = undefined; - // For x.com, we use the simple-icons X instead of the lucide-static X, since they overlap - if (name === 'x.com') { - foundPath = '/node_modules/simple-icons/icons/x.svg'; - } else if (name) { - foundPath = Object.keys(icons).find((key) => key.includes(`/${name}.svg`)); + if (name) { + return Object.keys(icons).find((key) => key.includes(`/${name}.svg`)); } else if (href) { const hrefKey = Object.keys(hrefMap).find((key) => href.toString().includes(key)) || name; const hrefValue = hrefMap[hrefKey as keyof typeof hrefMap]; - const foundPath = Object.keys(icons) - // If href, reverse so that simple-icons takes precedence - .reverse() - .find((key) => key.includes(`/${hrefValue}.svg`)); - return foundPath; + return Object.keys(icons).find((key) => key.includes(`/${hrefValue}.svg`)); } - // Else return the found path with lucide-icons taking precedence - return foundPath; }; const foundModule = foundPath() && icons[foundPath() as keyof typeof icons]; @@ -69,21 +34,4 @@ const module = foundModule && ((await foundModule()) as any); const Comp = module?.default; --- -{ - Comp && foundPath()?.includes('simple-icons') && ( -