import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { VideoCommentCreate } from '@shared/models'
+import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({
selector: 'my-video-comment-add',
@Input() parentComments: VideoComment[]
@Input() focusOnInit = false
@Input() textValue?: string
+ @Input() commentThread?: boolean
@Output() commentCreated = new EventEmitter<VideoComment>()
@Output() cancel = new EventEmitter()
@ViewChild('textarea', { static: true }) textareaElement: ElementRef
addingComment = false
+ addingCommentButtonValue: string
constructor (
protected formValidatorService: FormValidatorService,
private notifier: Notifier,
private videoCommentService: VideoCommentService,
private modalService: NgbModal,
- private router: Router
+ private router: Router,
+ private i18n: I18n
) {
super()
}
})
if (this.user) {
+ if (this.commentThread) {
+ this.addingCommentButtonValue = this.i18n('Comment')
+ } else {
+ this.addingCommentButtonValue = this.i18n('Reply')
+ }
+
if (this.textValue) {
this.patchTextValue(this.textValue, this.focusOnInit)
return