]>
Commit | Line | Data |
---|---|---|
63042139 | 1 | import { Component, Input } from '@angular/core' |
8ee25e17 | 2 | import { VideoChannel } from '../../shared-main' |
0ca454e3 | 3 | import { 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 | 14 | export 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 | } |