From d1a4f9decef3fcf65cd5fce8f938e19dbc73895f Mon Sep 17 00:00:00 2001 From: Gabriel De Los Rios Date: Tue, 23 Sep 2025 00:31:28 -0300 Subject: [PATCH] refactor: change svg for img for icons --- .../circled-icon/circled-icon.component.css | 3 ++- .../circled-icon/circled-icon.component.html | 2 +- .../circled-icon/circled-icon.component.ts | 10 +++------- .../stories/molecules/circled-icon.stories.ts | 19 +++++++++++-------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.css b/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.css index 0195e5c..a3e930d 100644 --- a/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.css +++ b/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.css @@ -4,10 +4,11 @@ width: 100%; display: flex; - mw-svg { + mw-img { align-items: center; display: flex; flex-direction: column; justify-content: center; + width: 100%; } } \ No newline at end of file diff --git a/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.html b/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.html index 11ff3e8..df99936 100644 --- a/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.html +++ b/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.html @@ -1,3 +1,3 @@
- +
diff --git a/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.ts b/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.ts index 3c0997c..8ea83d4 100644 --- a/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.ts +++ b/projects/my-wallet-ds/src/lib/molecules/circled-icon/circled-icon.component.ts @@ -1,10 +1,10 @@ import { Component, input } from '@angular/core'; -import { SvgComponent } from '../../atoms/svg/svg.component'; +import { ImgComponent } from '../../atoms/img/img.component'; @Component({ selector: 'mw-circled-icon', standalone: true, - imports: [SvgComponent], + imports: [ImgComponent], templateUrl: './circled-icon.component.html', styleUrl: './circled-icon.component.css' }) @@ -13,12 +13,8 @@ export class CircledIconComponent { * @description Circle background color */ backgroundColor = input("#fff"); - /** - * @description Icon color - */ - color = input("#000000"); /** * @description Icon name */ - symbol = input(""); + iconPath = input(""); } diff --git a/projects/my-wallet-ds/src/stories/molecules/circled-icon.stories.ts b/projects/my-wallet-ds/src/stories/molecules/circled-icon.stories.ts index d5d0682..f6c18a0 100644 --- a/projects/my-wallet-ds/src/stories/molecules/circled-icon.stories.ts +++ b/projects/my-wallet-ds/src/stories/molecules/circled-icon.stories.ts @@ -1,7 +1,7 @@ import type { Meta } from '@storybook/angular'; import { CircledIconComponent } from '../../lib/molecules/circled-icon/circled-icon.component'; -import { color, symbol } from '../control-constants/svg'; import { backgroundColor } from '../control-constants/circled-icon'; +import { pngIconsList } from '../png-icons-list'; /** * * **Sizing**: the circled icon takes all space available in it's parent component @@ -14,26 +14,29 @@ const meta: Meta = { tags: ['autodocs'], args: { backgroundColor: '#c0c0c0', - color: '#000000', - symbol: 'stock-line', + iconPath: '/assets/icons/caticon0.png', }, argTypes: { backgroundColor, - color, - symbol + iconPath: { + control: 'select', + options: pngIconsList, + description: 'The path to the icon png', + table: {defaultValue: {detail: 'Defaults to none (empty string)', summary: '(empty string)'}} + } }, }; export default meta; -const Template = (args: {backgroundColor: string, color: string, symbol: string}) => ({ +const Template = (args: {backgroundColor: string, color: string, iconPath: string}) => ({ props: args, template: ` -
+
`