Skip to content

Commit

Permalink
Merge pull request #254 from ironSource/fix/isct-126-icon-component
Browse files Browse the repository at this point in the history
Fix/isct 126 icon component
  • Loading branch information
AndyKIron authored Nov 23, 2023
2 parents 2a2c63f + 85b25cd commit 365c197
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

### [6.3.1-rc.0](https://github.com/ironSource/fusion-ui/compare/v6.3.0...v6.3.1-rc.0) (2023-11-21)


### Bug Fixes

* **isct-126:** fixed icon component on icon name change ([3224eb9](https://github.com/ironSource/fusion-ui/commit/3224eb94d4307bf78f729809763bf0bad0530e04))

## [6.3.0](https://github.com/ironSource/fusion-ui/compare/v6.3.0-rc.0...v6.3.0) (2023-11-16)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fusion-ui",
"version": "6.3.0",
"version": "6.3.1-rc.0",
"description": "UI library created by ironSource",
"license": "MIT",
"repository": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions projects/fusion-ui/components/icon/v1/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class IconComponent extends SvgComponent {
}

private setLibPath(value: string): void {
this.removeCssClass();
if (typeof value === 'string' && value.includes('/')) {
const lastIndex = value.lastIndexOf('/');
this.libVersion = value.substring(0, lastIndex);
Expand All @@ -48,11 +49,14 @@ export class IconComponent extends SvgComponent {
}
}

private removeCssClass(): void {
if (!!this.iconName) {
this.renderer.removeClass(this.elementRef.nativeElement, this.iconName.replace(/[\/,_, ]/gi, '-'));
}
this.iconName = null;
}

private onNameChanged(value: string): void {
this.renderer.removeClass(
this.elementRef.nativeElement,
!!this.iconName ? this.iconName.replace(/[\/,_, ]/gi, '-') : this.iconName
);
if (!!value) {
this.renderer.addClass(this.elementRef.nativeElement, value.replace(/[\/,_, ]/gi, '-'));
}
Expand Down
2 changes: 1 addition & 1 deletion projects/fusion-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ironsource/fusion-ui",
"version": "6.3.0",
"version": "6.3.1-rc.0",
"dependencies": {
"chart.js": "^3.5.1",
"@floating-ui/dom": "^1.0.9",
Expand Down

0 comments on commit 365c197

Please sign in to comment.