improve comment form: cancel button and full width
This commit is contained in:
parent
dd4f25eea8
commit
88adad2d0f
|
@ -16,9 +16,12 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="submit-comment">
|
||||
<div class="comment-buttons">
|
||||
<button *ngIf="isAddButtonDisplayed()" class="cancel-button" (click)="cancelCommentReply()" i18n>
|
||||
Cancel
|
||||
</button>
|
||||
<button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid || addingComment }" i18n>
|
||||
Post comment
|
||||
Reply
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -30,18 +30,29 @@ form {
|
|||
}
|
||||
}
|
||||
|
||||
.submit-comment {
|
||||
.cancel-button {
|
||||
font-weight: $font-semibold;
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 10px;
|
||||
white-space: nowrap;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.comment-buttons {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
button {
|
||||
@include peertube-button;
|
||||
@include orange-button;
|
||||
|
||||
&:last-child {
|
||||
@include orange-button;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
textarea, .submit-comment button {
|
||||
textarea, .comment-buttons button {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit {
|
|||
@Input() focusOnInit = false
|
||||
|
||||
@Output() commentCreated = new EventEmitter<VideoCommentCreate>()
|
||||
@Output() cancel = new EventEmitter()
|
||||
|
||||
@ViewChild('visitorModal', { static: true }) visitorModal: NgbModal
|
||||
@ViewChild('textarea', { static: true }) textareaElement: ElementRef
|
||||
|
@ -145,4 +146,8 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit {
|
|||
return this.videoCommentService
|
||||
.addCommentThread(this.video.id, commentCreate)
|
||||
}
|
||||
|
||||
private cancelCommentReply () {
|
||||
this.cancel.emit(null)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
[parentComments]="newParentComments"
|
||||
[focusOnInit]="true"
|
||||
(commentCreated)="onCommentReplyCreated($event)"
|
||||
(cancel)="onResetReply()"
|
||||
></my-video-comment-add>
|
||||
|
||||
<div *ngIf="commentTree" class="children">
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.comment-avatar {
|
||||
@include avatar(36px);
|
||||
|
||||
|
|
Loading…
Reference in New Issue