]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
Fix custom markup
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-custom-markup / peertube-custom-tags / button-markup.component.ts
1 import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
2 import { VideoChannel } from '../../shared-main'
3 import { CustomMarkupComponent } from './shared'
4
5 /*
6 * Markup component that creates a button
7 */
8
9 @Component({
10 selector: 'my-button-markup',
11 templateUrl: 'button-markup.component.html',
12 styleUrls: [ 'button-markup.component.scss' ],
13 changeDetection: ChangeDetectionStrategy.OnPush
14 })
15 export class ButtonMarkupComponent implements CustomMarkupComponent {
16 @Input() theme: 'primary' | 'secondary'
17 @Input() href: string
18 @Input() label: string
19 @Input() blankTarget?: boolean
20
21 channel: VideoChannel
22 loaded: undefined
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 }