Fix plugins for new V2 User Profile Modal

This commit is contained in:
Nuckyz 2025-05-04 16:25:13 -03:00
parent b0b616d92a
commit 0a2d4a2ab2
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
6 changed files with 44 additions and 7 deletions

View file

@ -87,6 +87,7 @@ export default definePlugin({
authors: [Devs.amia],
patches: [
// User Profile Modal
{
find: ".BOT_DATA_ACCESS?(",
replacement: [
@ -102,7 +103,31 @@ export default definePlugin({
// set the gap to zero to ensure ours stays on screen
{
match: /className:\i\.tabBar/,
replace: "$& + ' vc-mutual-gdms-tab-bar'"
replace: '$& + " vc-mutual-gdms-modal-tab-bar"'
}
]
},
// User Profile Modal v2
{
find: ".tabBarPanel,children:",
replacement: [
{
match: /items:(\i),.+?(?=return\(0,\i\.jsxs?\)\("div)/,
replace: "$&$self.pushSection($1,arguments[0].user);"
},
{
match: /\.tabBarPanel,children:(?=.+?section:(\i))/,
replace: "$&$1==='MUTUAL_GDMS'?$self.renderMutualGDMs(arguments[0]):"
},
// Make the gap between each item smaller so our tab can fit.
{
match: /className:\i\.tabBar/,
replace: '$& + " vc-mutual-gdms-modal-v2-tab-bar"'
},
// Make the tab bar item text smaller so our tab can fit.
{
match: /(\.tabBarItem.+?variant:)"heading-lg\/medium"/,
replace: '$1"heading-md/medium"'
}
]
},
@ -138,8 +163,8 @@ export default definePlugin({
sections[IS_PATCHED] = true;
sections.push({
text: getMutualGDMCountText(user),
section: "MUTUAL_GDMS",
text: getMutualGDMCountText(user)
});
} catch (e) {
new Logger("MutualGroupDMs").error("Failed to push mutual group dms section:", e);

View file

@ -1,3 +1,7 @@
.vc-mutual-gdms-tab-bar {
.vc-mutual-gdms-modal-tab-bar {
gap: 0;
}
.vc-mutual-gdms-modal-v2-tab-bar {
gap: 6px;
}