fix(icons): wrong icons in links
This commit is contained in:
@@ -7,6 +7,8 @@ export const getIcon = (file: Child | string | undefined): Icon => {
|
|||||||
if (!file) return DEFAULT_ICON;
|
if (!file) return DEFAULT_ICON;
|
||||||
|
|
||||||
if (typeof file === "string") {
|
if (typeof file === "string") {
|
||||||
|
if (ICONS[file]) return ICONS[file];
|
||||||
|
|
||||||
const parts = file.split(".");
|
const parts = file.split(".");
|
||||||
const iconName = parts[parts.length - 1];
|
const iconName = parts[parts.length - 1];
|
||||||
|
|
||||||
|
|||||||
@@ -55,11 +55,11 @@ export const folder = (name: string, children: Array<Child>): Folder => ({
|
|||||||
children,
|
children,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const link = (name: string, url: string, icon: Icon): Link => ({
|
export const link = (name: string, url: string, icon: string): Link => ({
|
||||||
type: "link",
|
type: "link",
|
||||||
name,
|
name,
|
||||||
url,
|
url,
|
||||||
icon,
|
icon: getIcon(icon),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const file = (
|
export const file = (
|
||||||
|
|||||||
Reference in New Issue
Block a user