aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-31 11:33:49 +0200
committerChocobozzz <me@florianbigard.com>2021-05-31 11:33:49 +0200
commit8ee25e17b88b970703f4df9e74cb4726bbffd837 (patch)
tree450d73715c747c82efe6c919ebeda6411c01c5e0 /client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
parent15f35256af15b97d2298cc44e76ffcafe73a1c88 (diff)
downloadPeerTube-8ee25e17b88b970703f4df9e74cb4726bbffd837.tar.gz
PeerTube-8ee25e17b88b970703f4df9e74cb4726bbffd837.tar.zst
PeerTube-8ee25e17b88b970703f4df9e74cb4726bbffd837.zip
Add ability to set custom markdown in description
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts')
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
new file mode 100644
index 000000000..987b37d19
--- /dev/null
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
@@ -0,0 +1,34 @@
1import { Component, Input } from '@angular/core'
2import { VideoChannel } from '../../shared-main'
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})
13export 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}