diff --git a/lemmy-translations b/lemmy-translations index 0446b27d..73797162 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 0446b27d493b4f4fb6f227f538e6604860c7fe41 +Subproject commit 7379716231b9f7e67f710751c839398b7ab5d65e diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 98e98d26..766c9dbd 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -305,16 +305,6 @@ pre { transition: width 0.2s ease-out 0s !important; } -.show-input { - width: 13vw !important; -} -.hide-input { - background: transparent !important; - background-color: transparent !important; - width: 0px !important; - padding: 0 !important; -} - br.big { display: block; content: ""; diff --git a/src/shared/components/app/navbar.tsx b/src/shared/components/app/navbar.tsx index d758af60..4d0b88fd 100644 --- a/src/shared/components/app/navbar.tsx +++ b/src/shared/components/app/navbar.tsx @@ -1,4 +1,4 @@ -import { Component, createRef, linkEvent, RefObject } from "inferno"; +import { Component, linkEvent } from "inferno"; import { NavLink } from "inferno-router"; import { CommentResponse, @@ -44,7 +44,6 @@ interface NavbarState { unreadReportCount: number; unreadApplicationCount: number; searchParam: string; - toggleSearch: boolean; showDropdown: boolean; onSiteBanner?(url: string): any; } @@ -55,14 +54,12 @@ export class Navbar extends Component { private unreadInboxCountSub: Subscription; private unreadReportCountSub: Subscription; private unreadApplicationCountSub: Subscription; - private searchTextField: RefObject; state: NavbarState = { unreadInboxCount: 0, unreadReportCount: 0, unreadApplicationCount: 0, expanded: false, searchParam: "", - toggleSearch: false, showDropdown: false, }; subscription: any; @@ -77,8 +74,6 @@ export class Navbar extends Component { componentDidMount() { // Subscribe to jwt changes if (isBrowser()) { - this.searchTextField = createRef(); - // On the first load, check the unreads let auth = myAuth(false); if (auth && UserService.Instance.myUserInfo) { @@ -123,7 +118,6 @@ export class Navbar extends Component { updateUrl() { const searchParam = this.state.searchParam; this.setState({ searchParam: "" }); - this.setState({ toggleSearch: false }); this.setState({ showDropdown: false, expanded: false }); if (searchParam === "") { this.context.router.history.push(`/search/`); @@ -308,35 +302,13 @@ export class Navbar extends Component { ) && (
  • -
    - - - -
    + +
)} @@ -520,28 +492,6 @@ export class Navbar extends Component { i.setState({ searchParam: event.target.value }); } - handleSearchSubmit(i: Navbar, event: any) { - event.preventDefault(); - i.updateUrl(); - } - - handleSearchBtn(i: Navbar, event: any) { - event.preventDefault(); - i.setState({ toggleSearch: true }); - - i.searchTextField.current?.focus(); - const offsetWidth = i.searchTextField.current?.offsetWidth; - if (i.state.searchParam && offsetWidth && offsetWidth > 100) { - i.updateUrl(); - } - } - - handleSearchBlur(i: Navbar, event: any) { - if (!(event.relatedTarget && event.relatedTarget.name !== "search-btn")) { - i.setState({ toggleSearch: false }); - } - } - handleLogoutClick(i: Navbar) { i.setState({ showDropdown: false, expanded: false }); UserService.Instance.logout(); diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 43be1b85..418986d7 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -163,27 +163,29 @@ export class CommentNode extends Component { ? i18n.t("purge_comment") : `${i18n.t("purge")} ${cv.creator.name}`; - let canMod_ = canMod( - cv.creator.id, - this.props.moderators, - this.props.admins - ); - let canModOnSelf = canMod( - cv.creator.id, - this.props.moderators, - this.props.admins, - UserService.Instance.myUserInfo, - true - ); - let canAdmin_ = canAdmin(cv.creator.id, this.props.admins); - let canAdminOnSelf = canAdmin( - cv.creator.id, - this.props.admins, - UserService.Instance.myUserInfo, - true - ); + let canMod_ = + canMod(cv.creator.id, this.props.moderators, this.props.admins) && + cv.community.local; + let canModOnSelf = + canMod( + cv.creator.id, + this.props.moderators, + this.props.admins, + UserService.Instance.myUserInfo, + true + ) && cv.community.local; + let canAdmin_ = + canAdmin(cv.creator.id, this.props.admins) && cv.community.local; + let canAdminOnSelf = + canAdmin( + cv.creator.id, + this.props.admins, + UserService.Instance.myUserInfo, + true + ) && cv.community.local; let isMod_ = isMod(cv.creator.id, this.props.moderators); - let isAdmin_ = isAdmin(cv.creator.id, this.props.admins); + let isAdmin_ = + isAdmin(cv.creator.id, this.props.admins) && cv.community.local; let amCommunityCreator_ = amCommunityCreator( cv.creator.id, this.props.moderators diff --git a/src/shared/components/common/language-select.tsx b/src/shared/components/common/language-select.tsx index 1182531a..d98be2e2 100644 --- a/src/shared/components/common/language-select.tsx +++ b/src/shared/components/common/language-select.tsx @@ -47,33 +47,38 @@ export class LanguageSelect extends Component { return this.props.iconVersion ? ( this.selectBtn ) : ( -
- -
- {this.selectBtn} - {this.props.multiple && ( -
- -
- )} +
+
+ {i18n.t("undetermined_language_warning")} +
+
+ +
+ {this.selectBtn} + {this.props.multiple && ( +
+ +
+ )} +
); diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 107f9889..4b8d072b 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -30,6 +30,7 @@ import { UserService, WebSocketService } from "../../services"; import { amAdmin, amCommunityCreator, + amMod, canAdmin, canMod, futureDaysToUnixTime, @@ -434,15 +435,18 @@ export class PostListing extends Component { let post = this.props.post_view.post; return ( -
+
); } @@ -457,16 +461,19 @@ export class PostListing extends Component { {url ? ( this.props.showBody ? ( -
+
) : ( this.postLink @@ -477,7 +484,7 @@ export class PostListing extends Component { {(url && isImage(url)) || (post.thumbnail_url && ( - {is_admin && ( + {amAdmin() && (