Skip to content

Commit 6edf51c

Browse files
committed
feat(shared): adiciona icones de tags
1 parent 3c467a6 commit 6edf51c

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

packages/shared/ui-global/icon/src/lib/icon-registry.ts

+9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { HttpClient } from '@angular/common/http';
22
import { of, tap } from 'rxjs';
33
import { Icon } from './types';
4+
import { Injectable } from '@angular/core';
45

6+
@Injectable({ providedIn: 'root' })
57
export class IconRegistry {
68
#cache: Partial<Record<Icon, string>> = {};
79

@@ -19,3 +21,10 @@ export class IconRegistry {
1921
this.#cache[name] = icon;
2022
};
2123
}
24+
25+
export function provideIconRegistry() {
26+
return {
27+
provide: IconRegistry,
28+
deps: [HttpClient],
29+
};
30+
}

packages/shared/ui-global/icon/src/lib/icon.component.ts

-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { HttpClient } from '@angular/common/http';
21
import { IconRegistry } from './icon-registry';
32
import { Icon } from './types';
43
import { take } from 'rxjs';
@@ -20,12 +19,6 @@ import {
2019
}
2120
`,
2221
standalone: true,
23-
providers: [
24-
{
25-
provide: IconRegistry,
26-
deps: [HttpClient],
27-
},
28-
],
2922
})
3023
export class IconComponent implements OnInit {
3124
renderer = inject(Renderer2);

packages/shared/ui-global/icon/src/lib/types/e-commerce.ts packages/shared/ui-global/icon/src/lib/types/commerce.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ type ECommerce =
4545
| 'ticket-alt'
4646
| 'ticket';
4747

48-
export type ECommerceIcon = `e-commerce/${ECommerce}`;
48+
export type ECommerceIcon = `commerce/${ECommerce}`;

packages/shared/ui-global/icon/src/lib/types/icon.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ECommerceIcon } from './e-commerce';
1+
import { ECommerceIcon } from './commerce';
22
import { TransportIcon } from './transport';
33
import { SoftwareIcon } from './software';
44
import { BuildingIcon } from './building';
@@ -111,6 +111,9 @@ type Root =
111111
| 'star'
112112
| 'sticker'
113113
| 'subtitles'
114+
| 'tag'
115+
| 'tag-plus'
116+
| 'tag-minus'
114117
| 'time-loading'
115118
| 'time-sleep'
116119
| 'timer-alt'

packages/shared/ui-global/icon/src/lib/types/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export * from './arrow';
22
export * from './building';
33
export * from './doc';
4-
export * from './e-commerce';
4+
export * from './commerce';
55
export * from './emoji';
66
export * from './icon';
77
export * from './menu';

0 commit comments

Comments
 (0)