]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/buttons/button.component.ts
Refactor button components
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / buttons / button.component.ts
index e23b909458808e9777a04d3356a4b1799069ae46..47605782350966624b23227f7ff3d0685cd57ffd 100644 (file)
@@ -3,7 +3,7 @@ import { GlobalIconName } from '@app/shared/shared-icons'
 
 @Component({
   selector: 'my-button',
-  styleUrls: ['./button.component.scss'],
+  styleUrls: [ './button.component.scss' ],
   templateUrl: './button.component.html'
 })
 
@@ -11,10 +11,19 @@ export class ButtonComponent {
   @Input() label = ''
   @Input() className = 'grey-button'
   @Input() icon: GlobalIconName = undefined
+  @Input() routerLink: string[] | string
   @Input() title: string = undefined
   @Input() loading = false
+  @Input() disabled = false
+  @Input() responsiveLabel = false
 
-  getTitle () {
-    return this.title || this.label
+  getClasses () {
+    return {
+      [this.className]: true,
+      disabled: this.disabled,
+      'icon-only': !this.label,
+      'has-icon': !!this.icon,
+      'responsive-label': this.responsiveLabel
+    }
   }
 }