1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00
Files
browser/libs/angular/src/billing/components/premium-badge/premium-badge.component.ts
Kyle Denney bbf9157ec0 [PM-24581] new styling for premium badge (#17793)
* [PM-24581] new styling for premium badge

* stories file

* translations for browser and desktop

* design review feedback

* color fixes, thanks claude
2025-12-09 09:27:37 -06:00

37 lines
1.2 KiB
TypeScript

import { Component, input } from "@angular/core";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { PremiumUpgradePromptService } from "@bitwarden/common/vault/abstractions/premium-upgrade-prompt.service";
import { BadgeModule } from "@bitwarden/components";
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
selector: "app-premium-badge",
standalone: true,
template: `
<button
type="button"
*appNotPremium
bitBadge
[variant]="'primary'"
class="!tw-text-primary-600 !tw-border-primary-600"
(click)="promptForPremium($event)"
>
<i class="bwi bwi-premium tw-pe-1"></i>{{ "upgrade" | i18n }}
</button>
`,
imports: [BadgeModule, JslibModule],
})
export class PremiumBadgeComponent {
readonly organizationId = input<string>();
constructor(private premiumUpgradePromptService: PremiumUpgradePromptService) {}
async promptForPremium(event: Event) {
event.stopPropagation();
event.preventDefault();
await this.premiumUpgradePromptService.promptForPremium(this.organizationId());
}
}