]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
Update angular
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-custom-markup / peertube-custom-tags / button-markup.component.ts
CommitLineData
bc48e33b 1import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
8ee25e17 2import { VideoChannel } from '../../shared-main'
0ca454e3 3import { CustomMarkupComponent } from './shared'
63042139
C
4
5/*
6 * Markup component that creates a button
7*/
8
9@Component({
10 selector: 'my-button-markup',
11 templateUrl: 'button-markup.component.html',
bc48e33b
C
12 styleUrls: [ 'button-markup.component.scss' ],
13 changeDetection: ChangeDetectionStrategy.OnPush
63042139 14})
0ca454e3 15export class ButtonMarkupComponent implements CustomMarkupComponent {
63042139
C
16 @Input() theme: 'primary' | 'secondary'
17 @Input() href: string
18 @Input() label: string
19 @Input() blankTarget?: boolean
20
21 channel: VideoChannel
0ca454e3 22 loaded: undefined
63042139
C
23
24 getTarget () {
25 if (this.blankTarget === true) return '_blank'
26
27 return ''
28 }
29
30 getClasses () {
31 const additionalClass = this.theme === 'primary'
32 ? 'orange-button'
33 : 'grey-button'
34
35 return [ 'peertube-button-link', additionalClass ]
36 }
37}