From edd98c61492dec186a21e58a2f588b0e7192ff66 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Tue, 1 Aug 2023 12:55:45 +0200 Subject: [PATCH] fix(frontend): Fix app icons (#1977) --- frontend/src/lib/components/apps/components/icon.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/apps/components/icon.ts b/frontend/src/lib/components/apps/components/icon.ts index e99918121d..cc2954f558 100644 --- a/frontend/src/lib/components/apps/components/icon.ts +++ b/frontend/src/lib/components/apps/components/icon.ts @@ -1,4 +1,10 @@ -import { toKebabCase } from '../utils' +function toKebabCase(str: string): string { + return str + .replace(/([a-z0-9])([A-Z])/g, '$1-$2') // Convert camel case to kebab case + .replace(/([A-Z0-9])([A-Z])/g, '$1-$2') // Separate consecutive uppercase letters + .replace(/([a-z])([0-9])/g, '$1-$2') // Separate letters from digits + .toLowerCase() +} export async function loadIcon(name: string): Promise { let iconComponent: any