mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-19 22:20:34 +00:00
Compare commits
4 commits
2b54778d2c
...
e6ede77fc0
Author | SHA1 | Date | |
---|---|---|---|
|
e6ede77fc0 | ||
|
f2b6dcbb91 | ||
|
f01f1e03cc | ||
|
572b304d98 |
1 changed files with 24 additions and 4 deletions
|
@ -5,8 +5,9 @@
|
|||
*/
|
||||
|
||||
import { addButton, removeButton } from "@api/MessagePopover";
|
||||
import { Settings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { ChannelStore } from "@webpack/common";
|
||||
import { get, set } from "@api/DataStore";
|
||||
|
||||
|
@ -23,7 +24,7 @@ const saveHiddenMessages = (ids: Set<string>) => set(KEY, ids);
|
|||
|
||||
const HideIcon = () => {
|
||||
return <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-labelledby="eyeCrossedIconTitle" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" fill="none" color="currentColor">
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <title id="eyeCrossedIconTitle">Hidden (crossed eye)</title>
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier">
|
||||
<path d="M22 12C22 12 19 18 12 18C5 18 2 12 2 12C2 12 5 6 12 6C19 6 22 12 22 12Z"></path><circle cx="12" cy="12" r="3"></circle><path d="M3 21L20 4"></path></g>
|
||||
</svg>;
|
||||
};
|
||||
|
@ -33,6 +34,13 @@ export default definePlugin({
|
|||
description: "Adds an option to hide messages",
|
||||
authors: [Devs.Isaac],
|
||||
dependencies: ["MessagePopoverAPI"],
|
||||
options: {
|
||||
showMessageHiddenText: {
|
||||
description: `Hidden messages will contain a small text indicating they're hidden.`,
|
||||
type: OptionType.BOOLEAN,
|
||||
default: true
|
||||
},
|
||||
},
|
||||
|
||||
async start() {
|
||||
style = document.createElement("style");
|
||||
|
@ -68,12 +76,24 @@ export default definePlugin({
|
|||
display: none !important;
|
||||
}
|
||||
:is(${messagesContent}) {
|
||||
display: none !important;
|
||||
visibility: hidden;
|
||||
}
|
||||
:is(${messagesAccessories}) {
|
||||
display: none !important;
|
||||
}
|
||||
`;
|
||||
if (Settings.plugins.HideMessage.showMessageHiddenText) {
|
||||
style.textContent += `
|
||||
:is(${messagesContent})::after {
|
||||
visibility: visible;
|
||||
content: "Message hidden" !important;
|
||||
color: var(--text-muted);
|
||||
font-size: 80%;
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
}
|
||||
`}
|
||||
},
|
||||
|
||||
async toggleHide(sentIds: string) {
|
||||
|
|
Loading…
Reference in a new issue