messageLogger: fix edited timestamp styling & add i18n (#607)
This commit is contained in:
parent
4c5a56a8a5
commit
de53bc7991
1 changed files with 5 additions and 1 deletions
|
@ -24,11 +24,15 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import Logger from "@utils/Logger";
|
import Logger from "@utils/Logger";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
|
import { findByPropsLazy, findLazy } from "@webpack";
|
||||||
import { moment, Parser, Timestamp, UserStore } from "@webpack/common";
|
import { moment, Parser, Timestamp, UserStore } from "@webpack/common";
|
||||||
|
|
||||||
import overlayStyle from "./deleteStyleOverlay.css?managed";
|
import overlayStyle from "./deleteStyleOverlay.css?managed";
|
||||||
import textStyle from "./deleteStyleText.css?managed";
|
import textStyle from "./deleteStyleText.css?managed";
|
||||||
|
|
||||||
|
const i18n = findLazy(m => m.Messages?.["en-US"]);
|
||||||
|
const styles = findByPropsLazy("edited", "communicationDisabled", "isSystemMessage");
|
||||||
|
|
||||||
function addDeleteStyle() {
|
function addDeleteStyle() {
|
||||||
if (Settings.plugins.MessageLogger.deleteStyle === "text") {
|
if (Settings.plugins.MessageLogger.deleteStyle === "text") {
|
||||||
enableStyle(textStyle);
|
enableStyle(textStyle);
|
||||||
|
@ -65,7 +69,7 @@ export default definePlugin({
|
||||||
isEdited={true}
|
isEdited={true}
|
||||||
isInline={false}
|
isInline={false}
|
||||||
>
|
>
|
||||||
<span>{" "}(edited)</span>
|
<span className={styles.edited}>{" "}({i18n.Messages.MESSAGE_EDITED})</span>
|
||||||
</Timestamp>
|
</Timestamp>
|
||||||
</div>
|
</div>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
|
Loading…
Reference in a new issue