]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Refactor comment add css
authorChocobozzz <me@florianbigard.com>
Thu, 15 Apr 2021 09:38:24 +0000 (11:38 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 15 Apr 2021 09:41:57 +0000 (11:41 +0200)
client/src/app/+videos/+video-watch/comment/video-comment-add.component.html
client/src/app/+videos/+video-watch/comment/video-comment-add.component.scss
client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts
client/src/app/+videos/+video-watch/comment/video-comment.component.html
client/src/app/+videos/+video-watch/comment/video-comment.component.scss
client/src/app/shared/shared-moderation/user-moderation-dropdown.component.html
client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
client/src/sass/classes.scss

index 9304640246f748ed0c4682bf9a05e6f892041e0a..7bd9b7c90b44ccba0098e18d30c634e498c603f8 100644 (file)
@@ -8,8 +8,8 @@
                 (click)="openVisitorModal($event)"
                 formControlName="text" [ngClass]="{ 'input-error': formErrors['text'] }"
                 (keyup.control.enter)="onValidKey()" (keyup.meta.enter)="onValidKey()" #textarea>
-
       </textarea>
+
       <my-help class="markdown-guide" helpType="custom" iconName="markdown" tooltipPlacement="left auto" autoClose="true" i18n-title title="Markdown compatible">
         <ng-template ptTemplate="customHtml">
           <span i18n>Markdown compatible that supports:</span>
   </div>
 
   <div class="comment-buttons">
-    <button *ngIf="isAddButtonDisplayed()" class="cancel-button" (click)="cancelCommentReply()" type="button" i18n>
+    <button *ngIf="isAddButtonDisplayed()" class="peertube-button tertiary-button cancel-button" (click)="cancelCommentReply()" type="button" i18n>
       Cancel
     </button>
-    <button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid || addingComment }">
+
+    <button *ngIf="isAddButtonDisplayed()" class="peertube-button orange-button" [ngClass]="{ disabled: !form.valid || addingComment }">
       {{ addingCommentButtonValue }}
     </button>
   </div>
@@ -55,6 +56,7 @@
     <h4 class="modal-title" id="modal-basic-title" i18n>You are one step away from commenting</h4>
     <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hideModals()"></my-global-icon>
   </div>
+
   <div class="modal-body">
     <span i18n>
       You can comment using an account on any ActivityPub-compatible instance (PeerTube/Mastodon/Pleroma account for example).
 
     <my-remote-subscribe [interact]="true" [uri]="getUri()"></my-remote-subscribe>
   </div>
+
   <div class="modal-footer inputs">
     <input
-      type="button" role="button" i18n-value value="Cancel" class="action-button action-button-cancel"
+      type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
       (click)="hideModals()" (key.enter)="hideModals()"
     >
 
     <input
-      type="submit" i18n-value value="Login to comment" class="action-button-submit"
+      type="submit" i18n-value value="Login to comment" class="peertube-button orange-button"
       (click)="gotoLogin()"
     >
   </div>
index e11b9be5af78e94d4137d25ae91b50680c3a4888..1aa9255c290aa34a854b532d4c0ff9c29f2a10e8 100644 (file)
@@ -1,6 +1,10 @@
 @import '_variables';
 @import '_mixins';
 
+$markdown-icon-height: 18px;
+$markdown-icon-width: 30px;
+$peertube-textarea-height: 60px;
+
 form {
   margin-bottom: 30px;
 }
@@ -18,83 +22,55 @@ form {
     flex-grow: 1;
     margin: 0;
     position: relative;
+  }
 
-    $peertube-textarea-height: 60px;
-    $markdown-icon-height: 18px;
-    $markdown-icon-width: 30px;
-
-    .markdown-guide {
-      position: absolute;
-      top: 5px;
-      right: 9px;
-
-      ::ng-deep .help-tooltip-button {
-        my-global-icon {
-          height: $markdown-icon-height;
-          width: $markdown-icon-width;
-
-          svg {
-            color: #C6C6C6;
-            fill: #C6C6C6;
-            border-radius: 3px;
-          }
-        }
-
-        &:focus, &:active, &:hover {
-          my-global-icon svg {
-            background-color: #C6C6C6;
-            color: pvar(--mainBackgroundColor);
-            fill: pvar(--mainBackgroundColor);
-          }
-        }
-      }
-    }
-
-    textarea {
-      @include peertube-textarea(100%, $peertube-textarea-height);
-      @include button-focus(pvar(--mainColorLightest));
+  textarea {
+    @include peertube-textarea(100%, $peertube-textarea-height);
+    @include button-focus(pvar(--mainColorLightest));
 
-      min-height: calc(#{$peertube-textarea-height} - 15px * 2);
-      padding-right: $markdown-icon-width + 15px !important;
+    min-height: calc(#{$peertube-textarea-height} - 15px * 2);
+    padding-right: $markdown-icon-width + 15px !important;
 
-      @media screen and (max-width: 600px) {
-        padding-right: $markdown-icon-width + 19px  !important;
-      }
+    @media screen and (max-width: 600px) {
+      padding-right: $markdown-icon-width + 19px  !important;
+    }
 
-      &:focus::placeholder {
-        opacity: 0;
-      }
+    &:focus::placeholder {
+      opacity: 0;
     }
   }
 }
 
-.comment-buttons {
-  display: flex;
-  justify-content: flex-end;
+.markdown-guide {
+  position: absolute;
+  top: 5px;
+  right: 9px;
 
-  button {
-    @include peertube-button;
-    @include disable-outline;
-    @include disable-default-a-behaviour;
+  ::ng-deep .help-tooltip-button {
+    my-global-icon {
+      height: $markdown-icon-height;
+      width: $markdown-icon-width;
 
-    &:not(:last-child) {
-      margin-right: .5rem;
+      svg {
+        color: #C6C6C6;
+        fill: #C6C6C6;
+        border-radius: 3px;
+      }
     }
 
-    &:last-child {
-      @include orange-button;
+    &:focus, &:active, &:hover {
+      my-global-icon svg {
+        background-color: #C6C6C6;
+        color: pvar(--mainBackgroundColor);
+        fill: pvar(--mainBackgroundColor);
+      }
     }
   }
+}
 
-  .cancel-button {
-    @include tertiary-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;
 }
 
 .emoji-flex {
@@ -117,7 +93,8 @@ form {
 }
 
 @media screen and (max-width: 600px) {
-  textarea, .comment-buttons button {
+  textarea,
+  .comment-buttons button {
     font-size: 14px !important;
   }
 
@@ -127,12 +104,7 @@ form {
 }
 
 .modal-body {
-  .btn {
-    @include peertube-button;
-    @include orange-button;
-  }
-
-  span {
+  > span {
     float: left;
     margin-bottom: 20px;
   }
index fce7e5edc6f47819a9c32a3c368ebf63a532849a..0e1362ad38eb8b7da789ce3b4ec6d0f68c3091e3 100644 (file)
@@ -4,7 +4,7 @@ import { Router } from '@angular/router'
 import { Notifier, User } from '@app/core'
 import { VIDEO_COMMENT_TEXT_VALIDATOR } from '@app/shared/form-validators/video-comment-validators'
 import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
-import { Video, Account } from '@app/shared/shared-main'
+import { Video } from '@app/shared/shared-main'
 import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment'
 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
 import { VideoCommentCreate } from '@shared/models'
index eeae55d9b604c2662475a272a1d968e3a8694e47..4592c9c6907858d0f2ec5290b3aed6bb9ee3806c 100644 (file)
@@ -38,7 +38,7 @@
           <div *ngIf="isUserLoggedIn()" tabindex=0 (click)="onWantToReply()" class="comment-action-reply" i18n>Reply</div>
 
           <my-user-moderation-dropdown
-            [prependActions]="prependModerationActions" tabindex=0
+            [prependActions]="prependModerationActions" tabindex=0 [buttonStyled]="false"
             buttonSize="small" [account]="commentAccount" [user]="commentUser" i18n-label label="Options" placement="bottom-left auto"
           ></my-user-moderation-dropdown>
         </div>
index 866293eea3d9aede5d5a1ef4828b53863c927336..cf33a5b0e5ab90c1965d432b60e64ab2cb4c5e91 100644 (file)
   .right {
     width: 100%;
   }
+}
 
-  .comment {
-    flex-grow: 1;
-    // Fix word-wrap with flex
-    min-width: 1px;
-
-    .highlighted-comment {
-      display: inline-block;
-      background-color: #F5F5F5;
-      color: #3d3d3d;
-      padding: 0 5px;
-      font-size: 13px;
-      margin-bottom: 5px;
-      font-weight: $font-semibold;
-      border-radius: 3px;
-    }
-
-    .comment-account-date {
-      display: flex;
-      margin-bottom: 4px;
-
-      .video-author {
-        height: 20px;
-        background-color: #888888;
-        border-radius: 12px;
-        margin-bottom: 2px;
-        max-width: 100%;
-        box-sizing: border-box;
-        flex-direction: row;
-        align-items: center;
-        display: inline-flex;
-        padding-right: 6px;
-        padding-left: 6px;
-        color: white !important;
-      }
+.comment {
+  flex-grow: 1;
+  // Fix word-wrap with flex
+  min-width: 1px;
+}
 
-      .comment-account {
-        word-break: break-all;
-        font-weight: 600;
-        font-size: 90%;
+.highlighted-comment {
+  display: inline-block;
+  background-color: #F5F5F5;
+  color: #3d3d3d;
+  padding: 0 5px;
+  font-size: 13px;
+  margin-bottom: 5px;
+  font-weight: $font-semibold;
+  border-radius: 3px;
+}
 
-        a {
-          @include disable-default-a-behaviour;
+.comment-account-date {
+  display: flex;
+  margin-bottom: 4px;
+}
 
-          color: pvar(--mainForegroundColor);
+.video-author {
+  height: 20px;
+  background-color: #888888;
+  border-radius: 12px;
+  margin-bottom: 2px;
+  max-width: 100%;
+  box-sizing: border-box;
+  flex-direction: row;
+  align-items: center;
+  display: inline-flex;
+  padding-right: 6px;
+  padding-left: 6px;
+  color: white !important;
+}
 
-          &:hover {
-            text-decoration: underline;
-          }
-        }
+.comment-account {
+  word-break: break-all;
+  font-weight: 600;
+  font-size: 90%;
 
-        .comment-account-fid {
-          opacity: .6;
-        }
-      }
+  a {
+    @include disable-default-a-behaviour;
 
-      .comment-date {
-        font-size: 90%;
-        color: pvar(--greyForegroundColor);
-        margin-left: 5px;
-        text-decoration: none;
+    color: pvar(--mainForegroundColor);
 
-        &:hover {
-          text-decoration: underline;
-        }
-      }
+    &:hover {
+      text-decoration: underline;
     }
+  }
 
-    .comment-html {
-      @include peertube-word-wrap;
+  .comment-account-fid {
+    opacity: .6;
+  }
+}
 
-      // Mentions
-      ::ng-deep a {
+.comment-date {
+  font-size: 90%;
+  color: pvar(--greyForegroundColor);
+  margin-left: 5px;
+  text-decoration: none;
 
-        &:not(.linkified-url) {
-          @include disable-default-a-behaviour;
+  &:hover {
+    text-decoration: underline;
+  }
+}
 
-          color: pvar(--mainForegroundColor);
+.comment-html {
+  @include peertube-word-wrap;
 
-          font-weight: $font-semibold;
-        }
+  // Mentions
+  ::ng-deep a {
 
-      }
+    &:not(.linkified-url) {
+      @include disable-default-a-behaviour;
 
-      // Paragraphs
-      ::ng-deep p {
-        margin-bottom: .3rem;
-      }
+      color: pvar(--mainForegroundColor);
 
-      &.comment-html-deleted {
-        color: pvar(--greyForegroundColor);
-        margin-bottom: 1rem;
-      }
+      font-weight: $font-semibold;
     }
 
-    .comment-actions {
-      margin-bottom: 10px;
-      display: flex;
+  }
 
-      ::ng-deep .dropdown-toggle,
-      .comment-action-reply {
-        color: pvar(--greyForegroundColor);
-        cursor: pointer;
-        margin-right: 10px;
+  // Paragraphs
+  ::ng-deep p {
+    margin-bottom: .3rem;
+  }
 
-        &:hover, &:active, &:focus, &:focus-visible {
-          color: pvar(--mainForegroundColor);
-        }
-      }
+  &.comment-html-deleted {
+    color: pvar(--greyForegroundColor);
+    margin-bottom: 1rem;
+  }
+}
 
-      ::ng-deep .action-button {
-        background-color: transparent;
-        padding: 0;
-        font-weight: unset;
-      }
-    }
+.comment-actions {
+  margin-bottom: 10px;
+  display: flex;
 
-    my-video-comment-add {
-      ::ng-deep form {
-        margin-top: 1rem;
-        margin-bottom: 0;
-      }
+  ::ng-deep .dropdown-toggle,
+  .comment-action-reply {
+    color: pvar(--greyForegroundColor);
+    cursor: pointer;
+    margin-right: 10px;
+
+    &:hover, &:active, &:focus, &:focus-visible {
+      color: pvar(--mainForegroundColor);
     }
   }
 
-  .children {
-    // Reduce avatars size for replies
-    .comment-avatar {
-      @include avatar(25px);
-    }
+  ::ng-deep .action-button {
+    background-color: transparent;
+    padding: 0;
+    font-weight: unset;
+  }
+}
 
-    .left {
-      margin-right: 6px;
-    }
+my-video-comment-add {
+  ::ng-deep form {
+    margin-top: 1rem;
+    margin-bottom: 0;
+  }
+}
+
+.children {
+  // Reduce avatars size for replies
+  .comment-avatar {
+    @include avatar(25px);
+  }
+
+  .left {
+    margin-right: 6px;
   }
 }
 
 }
 
 @media screen and (max-width: 600px) {
-  .root-comment {
-    .children {
-      margin-left: -20px;
+  .children {
+    margin-left: -20px;
 
-      .left {
-        align-items: flex-start;
+    .left {
+      align-items: flex-start;
 
-        .vertical-border {
-          margin-left: 2px;
-        }
+      .vertical-border {
+        margin-left: 2px;
       }
     }
+  }
 
-    .comment {
-      .comment-account-date {
-        flex-direction: column;
+  .comment-account-date {
+    flex-direction: column;
 
-        .comment-date {
-          margin-left: 0;
-        }
-      }
+    .comment-date {
+      margin-left: 0;
     }
   }
 }
index 4d562387aec590773e33d169843f16fcd982791d..f1680e385a029443f4cbe1a8d8cc3a93de84b679 100644 (file)
@@ -4,6 +4,6 @@
   <my-action-dropdown
     [actions]="userActions" [entry]="{ user: user, account: account }"
     [buttonSize]="buttonSize" [placement]="placement" [label]="label"
-    [container]="container"
+    [container]="container" [buttonStyled]="buttonStyled"
   ></my-action-dropdown>
 </ng-container>
index f59910d1c1350f8d9496ae1a510ef4a2ec70e373..f510a82f9a29f4eddb79aa8eb853c21eb92a6dc0 100644 (file)
@@ -18,6 +18,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
   @Input() prependActions: DropdownAction<{ user: User, account: Account }>[]
 
   @Input() buttonSize: 'normal' | 'small' = 'normal'
+  @Input() buttonStyled = true
   @Input() placement = 'right-top right-bottom auto'
   @Input() label: string
   @Input() container: 'body' | undefined = undefined
index af8e39573dce88c9492b5ec0065021b3860e2521..85bfce7f4ec7a70275e92f252484f911334549ad 100644 (file)
@@ -20,3 +20,7 @@
 .grey-button {
   @include grey-button;
 }
+
+.tertiary-button {
+  @include tertiary-button;
+}