From 8fcde4bdd08280b2565a39bbb005bf49686c7295 Mon Sep 17 00:00:00 2001 From: Alec Armbruster Date: Fri, 16 Jun 2023 19:14:35 -0400 Subject: [PATCH] more cleanup --- src/shared/components/common/html-tags.tsx | 1 + .../components/common/markdown-textarea.tsx | 98 ++++++++++--------- src/shared/components/common/moment-time.tsx | 6 +- 3 files changed, 54 insertions(+), 51 deletions(-) diff --git a/src/shared/components/common/html-tags.tsx b/src/shared/components/common/html-tags.tsx index 387cd04..f32b0fc 100644 --- a/src/shared/components/common/html-tags.tsx +++ b/src/shared/components/common/html-tags.tsx @@ -4,6 +4,7 @@ import { Helmet } from "inferno-helmet"; import { httpExternalPath } from "../../env"; import { i18n } from "../../i18next"; import { md } from "../../utils"; + interface HtmlTagsProps { title: string; path: string; diff --git a/src/shared/components/common/markdown-textarea.tsx b/src/shared/components/common/markdown-textarea.tsx index 36f6283..55e7361 100644 --- a/src/shared/components/common/markdown-textarea.tsx +++ b/src/shared/components/common/markdown-textarea.tsx @@ -184,53 +184,6 @@ export class MarkdownTextArea extends Component<
- {this.props.buttonTitle && ( - - )} - {this.props.replyType && ( - - )} - {this.state.content && ( - - )} - {/* A flex expander */} -
- - {this.props.showLanguage && ( - - )} {this.getFormatButton("bold", this.handleInsertBold)} {this.getFormatButton("italic", this.handleInsertItalic)} {this.getFormatButton("link", this.handleInsertLink)} @@ -283,6 +236,57 @@ export class MarkdownTextArea extends Component<
+ +
+ {this.props.showLanguage && ( + + )} + + {/* A flex expander */} +
+ + {this.props.buttonTitle && ( + + )} + {this.props.replyType && ( + + )} + {this.state.content && ( + + )} +
); diff --git a/src/shared/components/common/moment-time.tsx b/src/shared/components/common/moment-time.tsx index 10714f5..30c1682 100644 --- a/src/shared/components/common/moment-time.tsx +++ b/src/shared/components/common/moment-time.tsx @@ -1,7 +1,7 @@ import { Component } from "inferno"; import moment from "moment"; import { i18n } from "../../i18next"; -import { capitalizeFirstLetter, getLanguages } from "../../utils"; +import { capitalizeFirstLetter } from "../../utils"; import { Icon } from "./icon"; interface MomentTimeProps { @@ -15,9 +15,7 @@ export class MomentTime extends Component { constructor(props: any, context: any) { super(props, context); - const lang = getLanguages(); - - moment.locale(lang); + moment.locale([...i18n.languages]); } createdAndModifiedTimes() { -- 2.44.1