move registry component to shared marketplace lib

This commit is contained in:
Lucy Cifferello
2024-09-19 13:18:16 -04:00
parent 751ceab04e
commit f868a454d9
3 changed files with 11 additions and 10 deletions

View File

@@ -0,0 +1,31 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
import { TuiIcon, TuiTitle } from '@taiga-ui/core'
import { StoreIconComponentModule } from './store-icon/store-icon.component.module'
import { MarketplaceConfig } from '@start9labs/shared'
@Component({
standalone: true,
selector: '[registry]',
template: `
<store-icon [url]="registry.url" [marketplace]="marketplace" size="40px" />
<div tuiTitle>
{{ registry.name }}
<div tuiSubtitle>{{ registry.url }}</div>
</div>
@if (registry.selected) {
<tui-icon icon="@tui.check" [style.color]="'var(--tui-text-positive)'" />
} @else {
<ng-content />
}
`,
styles: [':host { border-radius: 0.25rem; width: stretch; }'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [StoreIconComponentModule, TuiIcon, TuiTitle],
})
export class MarketplaceRegistryComponent {
@Input()
marketplace!: MarketplaceConfig
@Input()
registry!: { url: string; selected: boolean; name?: string }
}

View File

@@ -27,6 +27,7 @@ export * from './components/store-icon/store-icon.component.module'
export * from './components/store-icon/store-icon.component'
export * from './components/menu/menu.component.module'
export * from './components/menu/menu.component'
export * from './components/registry.component'
export * from './services/marketplace.service'
export * from './services/category.service'