]>
Commit | Line | Data |
---|---|---|
63042139 | 1 | import { Component, Input } from '@angular/core' |
8ee25e17 | 2 | import { VideoChannel } from '../../shared-main' |
63042139 C |
3 | |
4 | /* | |
5 | * Markup component that creates a button | |
6 | */ | |
7 | ||
8 | @Component({ | |
9 | selector: 'my-button-markup', | |
10 | templateUrl: 'button-markup.component.html', | |
11 | styleUrls: [ 'button-markup.component.scss' ] | |
12 | }) | |
13 | export class ButtonMarkupComponent { | |
14 | @Input() theme: 'primary' | 'secondary' | |
15 | @Input() href: string | |
16 | @Input() label: string | |
17 | @Input() blankTarget?: boolean | |
18 | ||
19 | channel: VideoChannel | |
20 | ||
21 | getTarget () { | |
22 | if (this.blankTarget === true) return '_blank' | |
23 | ||
24 | return '' | |
25 | } | |
26 | ||
27 | getClasses () { | |
28 | const additionalClass = this.theme === 'primary' | |
29 | ? 'orange-button' | |
30 | : 'grey-button' | |
31 | ||
32 | return [ 'peertube-button-link', additionalClass ] | |
33 | } | |
34 | } |