]> Untitled Git - lemmy-ui.git/commitdiff
Add content warning to modlog and fix modlog routing bug (#994)
authorSleeplessOne1917 <abias1122@gmail.com>
Thu, 4 May 2023 02:06:59 +0000 (02:06 +0000)
committerGitHub <noreply@github.com>
Thu, 4 May 2023 02:06:59 +0000 (22:06 -0400)
* Add content warning to modlog and fix modlog routing bug

* Add translation logic

src/assets/css/main.css
src/shared/components/community/sidebar.tsx
src/shared/components/modlog.tsx
src/shared/routes.ts

index e796b7faf33f12c6cac18a4be97ebdffce2f6e8f..9cff2c7f5eb0286ca653194af8fbef49c929091a 100644 (file)
@@ -99,7 +99,7 @@
   border-bottom: 2px solid var(--dark);
 }
 
-.md-div table tbody+tbody {
+.md-div table tbody + tbody {
   border-top: 2px solid var(--dark);
 }
 
 }
 
 .icon-emoji-admin {
-  max-width: 24px; 
-  max-height: 24px; 
+  max-width: 24px;
+  max-height: 24px;
   display: inline-block;
 }
 
     left: 0;
   }
 
-  .emoji-picker-container>section {
+  .emoji-picker-container > section {
     width: 100% !important;
   }
 }
   left: 0;
   right: 0;
   bottom: 0;
-  background-color: rgba(0, 0, 0, .3);
+  background-color: rgba(0, 0, 0, 0.3);
   z-index: 999;
 }
 
@@ -256,6 +256,10 @@ hr {
   text-overflow: ellipsis;
 }
 
+.text-xs-center {
+  text-align: center;
+}
+
 .overflow-wrap-anywhere {
   overflow-wrap: anywhere;
 }
@@ -435,6 +439,6 @@ br.big {
 .lang-select-action:focus {
   width: auto;
 }
-em-emoji-picker{
-  width:100%;
+em-emoji-picker {
+  width: 100%;
 }
index 8b235595f6ad086f03b91128e1c0ea8c9fa09a5f..c7b10466fc3ad7e13c38654bb307afdc8a84ca9d 100644 (file)
@@ -262,7 +262,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
         <li className="list-inline-item">
           <Link
             className="badge badge-primary"
-            to={`/modlog/community/${this.props.community_view.community.id}`}
+            to={`/modlog/${this.props.community_view.community.id}`}
           >
             {i18n.t("modlog")}
           </Link>
index af717fc5b870a5f9ff7d015f3863d6993353cd50..8972f98546004f9f5d32d711219158d2564f2c69 100644 (file)
@@ -1,5 +1,6 @@
 import { NoOptionI18nKeys } from "i18next";
 import { Component, linkEvent } from "inferno";
+import { T } from "inferno-i18next-dess";
 import { Link } from "inferno-router";
 import { RouteComponentProps } from "inferno-router/dist/Route";
 import {
@@ -57,7 +58,7 @@ import {
   wsSubscribe,
 } from "../utils";
 import { HtmlTags } from "./common/html-tags";
-import { Spinner } from "./common/icon";
+import { Icon, Spinner } from "./common/icon";
 import { MomentTime } from "./common/moment-time";
 import { Paginator } from "./common/paginator";
 import { SearchableSelect } from "./common/searchable-select";
@@ -782,6 +783,19 @@ export class Modlog extends Component<
         />
 
         <div>
+          <div
+            className="alert alert-warning text-sm-start text-xs-center"
+            role="alert"
+          >
+            <Icon
+              icon="alert-triangle"
+              inline
+              classes="mr-sm-2 mx-auto d-sm-inline d-block"
+            />
+            <T i18nKey="modlog_content_warning" class="d-inline">
+              #<strong>#</strong>#
+            </T>
+          </div>
           <h5>
             {communityName && (
               <Link className="text-body" to={`/c/${communityName}`}>
index 875ba5020487253c828fb813b773355c5de63806..ddaa87402179bdb6fd9d759bb8ddd723c1d0165e 100644 (file)
@@ -92,12 +92,12 @@ export const routes: IRoutePropsWithFetch[] = [
     component: Settings,
   },
   {
-    path: `/modlog`,
+    path: `/modlog/:communityId`,
     component: Modlog,
     fetchInitialData: Modlog.fetchInitialData,
   },
   {
-    path: `/modlog/:communityId`,
+    path: `/modlog`,
     component: Modlog,
     fetchInitialData: Modlog.fetchInitialData,
   },