Merge branch 'dev'

This commit is contained in:
thororen1234 2024-11-25 01:50:45 -05:00
commit b0922e34bd
4 changed files with 51 additions and 22 deletions

View file

@ -4,10 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import "styles.css?managed";
import { NavContextMenuPatchCallback } from "@api/ContextMenu";
import { DataStore } from "@api/index";
import { definePluginSettings } from "@api/Settings";
import { ExpandableHeader } from "@components/ExpandableHeader";
import { Devs } from "@utils/constants";
import { useForceUpdater } from "@utils/react";
import definePlugin, { OptionType } from "@utils/types";
@ -108,20 +109,23 @@ function TagConfigCard(props) {
<TextInput value={tagName} onChange={setTagName}></TextInput>
<Text variant={"heading-md/normal"}>Users (Seperated by comma)</Text>
<TextInput value={userIds} onChange={setUserIDs}></TextInput>
<ExpandableHeader headerText="User List (Click A User To Remove)" defaultState={true}>
{
userIds.split(", ").map(user => {
const userData: any = UserStore.getUser(user);
if (!userData) return null;
return (
<div style={{ display: "flex" }}>
<img src={userData.getAvatarURL()} style={{ height: "20px", borderRadius: "50%", marginRight: "5px" }}></img>
<Text style={{ cursor: "pointer" }} variant={"text-md/normal"} onClick={() => setUserIDs(userIds.replace(`, ${user}`, "").replace(user, ""))}>{userData.globalName || userData.username}</Text>
</div>
);
})
}
</ExpandableHeader>
<div className={"vc-friend-tags-user-header-container"}>
<Text variant="eyebrow">User List (Click A User To Remove)</Text>
<div className={"vc-friend-tags-user-header-btns"}>
{
userIds.split(", ").map(user => {
const userData: any = UserStore.getUser(user);
if (!userData) return null;
return (
<div style={{ display: "flex" }}>
<img src={userData.getAvatarURL()} style={{ height: "20px", borderRadius: "50%", marginRight: "5px" }}></img>
<Text style={{ cursor: "pointer" }} variant={"text-md/normal"} onClick={() => setUserIDs(userIds.replace(`, ${user}`, "").replace(user, ""))}>{userData.globalName || userData.username}</Text>
</div>
);
})
}
</div>
</div>
<Button onClick={async () => {
SavedData = SavedData.filter(data => (data.tagName !== tagName));
await SetData();

View file

@ -0,0 +1,11 @@
.vc-permviewer-user-header-container {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.vc-permviewer-user-header-btns {
display: flex;
gap: 8px;
}

View file

@ -4,9 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import "styles.css?managed";
import { DataStore } from "@api/index";
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
import { ExpandableHeader } from "@components/ExpandableHeader";
import { Heart } from "@components/Heart";
import { EquicordDevs } from "@utils/constants";
import { openUserProfile } from "@utils/discord";
@ -211,12 +212,14 @@ class DataUI {
return <aside key={key} >
<ExpandableHeader defaultState={true} headerText={key.toUpperCase()}>
<Flex style={{ gap: "calc(0.5em + 0.5vw) 0.2em", flexDirection: "column" }}>
{usersElements}
</Flex>
</ExpandableHeader>
<div className={"vc-i-remember-you-user-header-container"}>
<Text>{key.toUpperCase()}</Text>
<div className={"vc-i-remember-you-user-header-btns"}>
<Flex style={{ gap: "calc(0.5em + 0.5vw) 0.2em", flexDirection: "column" }}>
{usersElements}
</Flex>
</div>
</div>
</aside>;
}

View file

@ -0,0 +1,11 @@
.vc-i-remember-you-user-header-container {
display: contents;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.vc-i-remember-you-user-header-btns {
display: none;
gap: 8px;
}