diff --git a/.eslintrc.json b/.eslintrc.json index 598b7f3f..f82e6b06 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -26,9 +26,7 @@ "jsx-a11y/aria-activedescendant-has-tabindex": 1, "jsx-a11y/aria-role": 1, "jsx-a11y/click-events-have-key-events": 1, - "jsx-a11y/iframe-has-title": 1, "jsx-a11y/interactive-supports-focus": 1, - "jsx-a11y/no-redundant-roles": 1, "jsx-a11y/no-static-element-interactions": 1, "jsx-a11y/role-has-required-aria-props": 1, "curly": 0, diff --git a/src/assets/css/main.css b/src/assets/css/main.css index a93055ed..cb4a8b81 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -124,7 +124,8 @@ .emoji-picker-container { position: absolute; - top: 30px; + top: 0; + left: 50%; z-index: 1000; transform: translateX(-50%); } diff --git a/src/shared/components/app/app.tsx b/src/shared/components/app/app.tsx index 96bf1016..3e334376 100644 --- a/src/shared/components/app/app.tsx +++ b/src/shared/components/app/app.tsx @@ -33,12 +33,13 @@ export class App extends Component { <>
- - ${I18NextService.i18n.t("jump_to_content", "Jump to content")} - + {I18NextService.i18n.t("jump_to_content", "Jump to content")} + {siteView && ( )} diff --git a/src/shared/components/app/navbar.tsx b/src/shared/components/app/navbar.tsx index 2ede00e1..11cfb6c6 100644 --- a/src/shared/components/app/navbar.tsx +++ b/src/shared/components/app/navbar.tsx @@ -347,10 +347,10 @@ export class Navbar extends Component { )} {person && ( - + )} ) : ( diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 41f67e6c..5e59d161 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -367,7 +367,7 @@ export class CommentNode extends Component { ) : ( { } /> )} -
+
{this.props.showContext && this.linkBtn()} {this.props.markable && ( - )} {this.props.replyType && ( + {this.props.buttonTitle && ( )}
diff --git a/src/shared/components/common/moment-time.tsx b/src/shared/components/common/moment-time.tsx index 7c5693ed..ec97eb49 100644 --- a/src/shared/components/common/moment-time.tsx +++ b/src/shared/components/common/moment-time.tsx @@ -39,7 +39,7 @@ export class MomentTime extends Component { return ( {formatPastDate(this.props.updated)} diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index 81a5dafc..733c19a1 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -204,17 +204,17 @@ export class Sidebar extends Component { )} {community.removed && ( - + {I18NextService.i18n.t("removed")} )} {community.deleted && ( - + {I18NextService.i18n.t("deleted")} )} {community.nsfw && ( - + {I18NextService.i18n.t("nsfw")} )} @@ -309,7 +309,7 @@ export class Sidebar extends Component { const community_view = this.props.community_view; return ( <> -
    +
      {amMod(this.props.moderators) && ( <>
    • diff --git a/src/shared/components/home/admin-settings.tsx b/src/shared/components/home/admin-settings.tsx index 7ac69fed..76877d84 100644 --- a/src/shared/components/home/admin-settings.tsx +++ b/src/shared/components/home/admin-settings.tsx @@ -44,7 +44,6 @@ interface AdminSettingsState { instancesRes: RequestState; bannedRes: RequestState; leaveAdminTeamRes: RequestState; - emojiLoading: boolean; loading: boolean; themeList: string[]; isIsomorphic: boolean; @@ -59,7 +58,6 @@ export class AdminSettings extends Component { bannedRes: { state: "empty" }, instancesRes: { state: "empty" }, leaveAdminTeamRes: { state: "empty" }, - emojiLoading: false, loading: false, themeList: [], isIsomorphic: false, @@ -215,7 +213,6 @@ export class AdminSettings extends Component { onCreate={this.handleCreateEmoji} onDelete={this.handleDeleteEmoji} onEdit={this.handleEditEmoji} - loading={this.state.emojiLoading} />
@@ -345,35 +342,23 @@ export class AdminSettings extends Component { } async handleEditEmoji(form: EditCustomEmoji) { - this.setState({ emojiLoading: true }); - const res = await HttpService.client.editCustomEmoji(form); if (res.state === "success") { updateEmojiDataModel(res.data.custom_emoji); } - - this.setState({ emojiLoading: false }); } async handleDeleteEmoji(form: DeleteCustomEmoji) { - this.setState({ emojiLoading: true }); - const res = await HttpService.client.deleteCustomEmoji(form); if (res.state === "success") { removeFromEmojiDataModel(res.data.id); } - - this.setState({ emojiLoading: false }); } async handleCreateEmoji(form: CreateCustomEmoji) { - this.setState({ emojiLoading: true }); - const res = await HttpService.client.createCustomEmoji(form); if (res.state === "success") { updateEmojiDataModel(res.data.custom_emoji); } - - this.setState({ emojiLoading: false }); } } diff --git a/src/shared/components/home/emojis-form.tsx b/src/shared/components/home/emojis-form.tsx index 2ec41d05..caf8221c 100644 --- a/src/shared/components/home/emojis-form.tsx +++ b/src/shared/components/home/emojis-form.tsx @@ -1,4 +1,5 @@ import { myAuthRequired, setIsoData } from "@utils/app"; +import { capitalizeFirstLetter } from "@utils/helpers"; import { Component, linkEvent } from "inferno"; import { CreateCustomEmoji, @@ -11,14 +12,13 @@ import { HttpService, I18NextService } from "../../services"; import { pictrsDeleteToast, toast } from "../../toast"; import { EmojiMart } from "../common/emoji-mart"; import { HtmlTags } from "../common/html-tags"; -import { Icon } from "../common/icon"; +import { Icon, Spinner } from "../common/icon"; import { Paginator } from "../common/paginator"; interface EmojiFormProps { onEdit(form: EditCustomEmoji): void; onCreate(form: CreateCustomEmoji): void; onDelete(form: DeleteCustomEmoji): void; - loading: boolean; } interface EmojiFormState { @@ -36,6 +36,7 @@ interface CustomEmojiViewForm { keywords: string; changed: boolean; page: number; + loading: boolean; } export class EmojiForm extends Component { @@ -52,6 +53,7 @@ export class EmojiForm extends Component { keywords: x.keywords.map(x => x.keyword).join(" "), changed: false, page: 1 + Math.floor(index / this.itemsPerPage), + loading: false, })), page: 1, }; @@ -119,34 +121,39 @@ export class EmojiForm extends Component { .map((cv, index) => ( (this.scrollRef[cv.shortcode] = e)}> - - + {cv.image_url.length > 0 && ( + {cv.alt_text} + )} + {cv.image_url.length === 0 && ( + + + + )} { -