From a1889f13f6fe2187e4cc250523e78f76dec3410a Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Mon, 24 Aug 2026 18:23:55 +0200 Subject: [PATCH] consolidated same icons, created transient helper component to identify icons --- webapp/src/app/app.routes.ts | 7 ++++ .../icon-preview/icon-preview.component.html | 10 ++++++ .../icon-preview/icon-preview.component.scss | 34 +++++++++++++++++++ .../icon-preview/icon-preview.component.ts | 24 +++++++++++++ webapp/src/app/shared/ui/icons.ts | 11 +++--- 5 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 webapp/src/app/modules/icon-preview/icon-preview.component.html create mode 100644 webapp/src/app/modules/icon-preview/icon-preview.component.scss create mode 100644 webapp/src/app/modules/icon-preview/icon-preview.component.ts diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index 43d09f3f..44bafe3d 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -72,6 +72,13 @@ export const routes: Routes = [ pathMatch: 'full', redirectTo: 'dashboard', }, + { + path: 'icons', + loadComponent: () => + import('./modules/icon-preview/icon-preview.component').then( + (mod) => mod.IconPreviewComponent, + ), + }, { path: 'login', loadComponent: () => diff --git a/webapp/src/app/modules/icon-preview/icon-preview.component.html b/webapp/src/app/modules/icon-preview/icon-preview.component.html new file mode 100644 index 00000000..754d2185 --- /dev/null +++ b/webapp/src/app/modules/icon-preview/icon-preview.component.html @@ -0,0 +1,10 @@ +
+ @for (item of icons; track item.constName) { +
+ {{ item.iconString }} + {{ item.iconString }} +
+ } +
diff --git a/webapp/src/app/modules/icon-preview/icon-preview.component.scss b/webapp/src/app/modules/icon-preview/icon-preview.component.scss new file mode 100644 index 00000000..08adab01 --- /dev/null +++ b/webapp/src/app/modules/icon-preview/icon-preview.component.scss @@ -0,0 +1,34 @@ +.icon-container { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); + gap: 4px; + padding: 8px; + box-sizing: border-box; +} + +.icon-item { + display: flex; + align-items: center; + gap: 6px; + padding: 3px 6px; + border: 1px solid #e2e8f0; + border-radius: 4px; + background: #ffffff; + font-family: monospace; + font-size: 11px; + color: #1e293b; + overflow: hidden; + white-space: nowrap; + + mat-icon { + font-size: 18px; + width: 18px; + height: 18px; + flex-shrink: 0; + } + + .name { + overflow: hidden; + text-overflow: ellipsis; + } +} diff --git a/webapp/src/app/modules/icon-preview/icon-preview.component.ts b/webapp/src/app/modules/icon-preview/icon-preview.component.ts new file mode 100644 index 00000000..5a2a96c8 --- /dev/null +++ b/webapp/src/app/modules/icon-preview/icon-preview.component.ts @@ -0,0 +1,24 @@ +import { Component } from '@angular/core'; +import { MatIconModule } from '@angular/material/icon'; +import * as ALL_ICONS from '../../shared/ui/icons'; + +@Component({ + selector: 'app-icon-preview', + standalone: true, + imports: [MatIconModule], + templateUrl: './icon-preview.component.html', + styleUrl: './icon-preview.component.scss', +}) +export class IconPreviewComponent { + readonly icons = Object.entries(ALL_ICONS) + .filter(([key, val]) => typeof val === 'string' && key.endsWith('_ICON')) + .map(([constName, iconString]) => ({ + constName, + iconString: iconString as string, + })) + .sort( + (a, b) => + a.iconString.localeCompare(b.iconString) || + a.constName.localeCompare(b.constName), + ); +} diff --git a/webapp/src/app/shared/ui/icons.ts b/webapp/src/app/shared/ui/icons.ts index d89491d4..f2528650 100644 --- a/webapp/src/app/shared/ui/icons.ts +++ b/webapp/src/app/shared/ui/icons.ts @@ -28,7 +28,8 @@ export const PERSON_OFF_ICON = 'person_off' as const; // person off and no accou export const ACCOUNT_BALANCE_ICON = FUNDING_ICON; // TODO export const ACCOUNT_CIRCLE_ICON = 'account_circle' as const; //Person Icon in company-connections -export const COMPANY_CONNECTION_ICON = 'business' as const; +export const BUSINESS_ICON = 'business' as const; +export const COMPANY_CONNECTION_ICON = BUSINESS_ICON; // TODO // ============================================================================ // 2. Navigation, Layout & Hierarchy Icons @@ -72,8 +73,8 @@ export const MANAGE_ACCOUNTS_ICON = 'manage_accounts' as const; export const MANAGE_SEARCH_ICON = 'manage_search' as const; export const PERSON_ADD_ICON = 'person_add' as const; export const PERSON_SEARCH_ICON = 'person_search' as const; -export const PLAY_ARROW_ICON = 'play_arrow' as const; export const PLAY_ICON = 'play_arrow' as const; +export const PLAY_ARROW_ICON = PLAY_ICON; // TODO export const REFRESH_ICON = 'refresh' as const; export const RESTART_ICON = 'restart_alt' as const; export const SAVE_ICON = 'save' as const; @@ -111,7 +112,7 @@ export const INFO_OUTLINE_ICON = 'info_outline' as const; // same as info but in export const RULE_ICON = 'rule' as const; export const STAR_ICON = 'star' as const; export const VERIFIED_ICON = 'verified' as const; -export const VISIBILITY_ICON = 'visibility' as const; +export const VISIBILITY_ICON = OVERVIEW_ICON; // TODO export const VISIBILITY_OFF_ICON = 'visibility_off' as const; export const WARNING_ICON = 'warning' as const; @@ -139,13 +140,13 @@ export const TRENDING_UP_ICON = 'trending_up' as const; // ============================================================================ // 7. Other // ============================================================================ -export const APARTMENT_ICON = 'apartment' as const; +export const APARTMENT_ICON = FUNDING_ICON; // TODO export const ARTICLE_ICON = PUBLICATION_ICON; // was 'article' (TODO change in some components like dashboard) export const ASSIGNMENT_ICON = 'assignment' as const; export const ATTACH_MONEY_ICON = 'attach_money' as const; export const BIOTECH_ICON = 'biotech' as const; export const BUILD_ICON = 'build' as const; -export const BUSINESS_ICON = 'business' as const; + export const BUSINESS_CENTER_ICON = 'business_center' as const; export const CAMPAIGN_ICON = 'campaign' as const; export const CATEGORY_ICON = 'category' as const;