]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
Merge branch 'release/4.3.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-custom-markup / peertube-custom-tags / button-markup.component.ts
CommitLineData
63042139 1import { 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',
12 styleUrls: [ 'button-markup.component.scss' ]
13})
0ca454e3 14export class ButtonMarkupComponent implements CustomMarkupComponent {
63042139
C
15 @Input() theme: 'primary' | 'secondary'
16 @Input() href: string
17 @Input() label: string
18 @Input() blankTarget?: boolean
19
20 channel: VideoChannel
0ca454e3 21 loaded: undefined
63042139
C
22
23 getTarget () {
24 if (this.blankTarget === true) return '_blank'
25
26 return ''
27 }
28
29 getClasses () {
30 const additionalClass = this.theme === 'primary'
31 ? 'orange-button'
32 : 'grey-button'
33
34 return [ 'peertube-button-link', additionalClass ]
35 }
36}