]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/components/app/navbar.tsx
Changing all bigints to numbers
[lemmy-ui.git] / src / shared / components / app / navbar.tsx
index 4d0b88fdc2d5893986f7d30516aefbb6bae69389..128d40238cebd9695004476939660b4904692859 100644 (file)
@@ -43,7 +43,6 @@ interface NavbarState {
   unreadInboxCount: number;
   unreadReportCount: number;
   unreadApplicationCount: number;
-  searchParam: string;
   showDropdown: boolean;
   onSiteBanner?(url: string): any;
 }
@@ -59,7 +58,6 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
     unreadReportCount: 0,
     unreadApplicationCount: 0,
     expanded: false,
-    searchParam: "",
     showDropdown: false,
   };
   subscription: any;
@@ -115,20 +113,6 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
     this.unreadApplicationCountSub.unsubscribe();
   }
 
-  updateUrl() {
-    const searchParam = this.state.searchParam;
-    this.setState({ searchParam: "" });
-    this.setState({ showDropdown: false, expanded: false });
-    if (searchParam === "") {
-      this.context.router.history.push(`/search/`);
-    } else {
-      const searchParamEncoded = encodeURIComponent(searchParam);
-      this.context.router.history.push(
-        `/search/q/${searchParamEncoded}/type/All/sort/TopAll/listing_type/All/community_id/0/creator_id/0/page/1`
-      );
-    }
-  }
-
   render() {
     return this.navbar();
   }
@@ -160,7 +144,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
                     className="p-1 navbar-toggler nav-link border-0"
                     onMouseUp={linkEvent(this, this.handleHideExpandNavbar)}
                     title={i18n.t("unread_messages", {
-                      count: this.state.unreadInboxCount,
+                      count: Number(this.state.unreadInboxCount),
                       formattedCount: numToSI(this.state.unreadInboxCount),
                     })}
                   >
@@ -181,7 +165,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
                       className="p-1 navbar-toggler nav-link border-0"
                       onMouseUp={linkEvent(this, this.handleHideExpandNavbar)}
                       title={i18n.t("unread_reports", {
-                        count: this.state.unreadReportCount,
+                        count: Number(this.state.unreadReportCount),
                         formattedCount: numToSI(this.state.unreadReportCount),
                       })}
                     >
@@ -203,7 +187,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
                       className="p-1 navbar-toggler nav-link border-0"
                       onMouseUp={linkEvent(this, this.handleHideExpandNavbar)}
                       title={i18n.t("unread_registration_applications", {
-                        count: this.state.unreadApplicationCount,
+                        count: Number(this.state.unreadApplicationCount),
                         formattedCount: numToSI(
                           this.state.unreadApplicationCount
                         ),
@@ -321,7 +305,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
                       to="/inbox"
                       onMouseUp={linkEvent(this, this.handleHideExpandNavbar)}
                       title={i18n.t("unread_messages", {
-                        count: this.state.unreadInboxCount,
+                        count: Number(this.state.unreadInboxCount),
                         formattedCount: numToSI(this.state.unreadInboxCount),
                       })}
                     >
@@ -342,7 +326,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
                         to="/reports"
                         onMouseUp={linkEvent(this, this.handleHideExpandNavbar)}
                         title={i18n.t("unread_reports", {
-                          count: this.state.unreadReportCount,
+                          count: Number(this.state.unreadReportCount),
                           formattedCount: numToSI(this.state.unreadReportCount),
                         })}
                       >
@@ -364,7 +348,7 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
                         className="nav-link"
                         onMouseUp={linkEvent(this, this.handleHideExpandNavbar)}
                         title={i18n.t("unread_registration_applications", {
-                          count: this.state.unreadApplicationCount,
+                          count: Number(this.state.unreadApplicationCount),
                           formattedCount: numToSI(
                             this.state.unreadApplicationCount
                           ),
@@ -488,10 +472,6 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
     i.setState({ expanded: false, showDropdown: false });
   }
 
-  handleSearchParam(i: Navbar, event: any) {
-    i.setState({ searchParam: event.target.value });
-  }
-
   handleLogoutClick(i: Navbar) {
     i.setState({ showDropdown: false, expanded: false });
     UserService.Instance.logout();