]>
Commit | Line | Data |
---|---|---|
1 | import { 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 | }) | |
14 | export class ButtonMarkupComponent implements CustomMarkupComponent { | |
15 | @Input() theme: 'primary' | 'secondary' | |
16 | @Input() href: string | |
17 | @Input() label: string | |
18 | @Input() blankTarget?: boolean | |
19 | ||
20 | channel: VideoChannel | |
21 | loaded: undefined | |
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 | } |