aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorĐỗ Văn Hoài Tuân <htuan03@gmail.com>2023-04-29 15:08:04 -0700
committerGitHub <noreply@github.com>2023-04-30 00:08:04 +0200
commitb95c5c6619bdd9d2d42089d02f553a43bfb68dba (patch)
tree60fc9c42e76c03d04c2f73a1b384d534c8d1ba0e /src
parentbf795c49dfe988f3013cda35cfe18e124456f23f (diff)
downloadVencord-b95c5c6619bdd9d2d42089d02f553a43bfb68dba.tar.gz
Vencord-b95c5c6619bdd9d2d42089d02f553a43bfb68dba.tar.bz2
Vencord-b95c5c6619bdd9d2d42089d02f553a43bfb68dba.zip
Fix USRBG (#1000)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/usrbg/index.css21
-rw-r--r--src/plugins/usrbg/index.tsx20
2 files changed, 15 insertions, 26 deletions
diff --git a/src/plugins/usrbg/index.css b/src/plugins/usrbg/index.css
index 6d1bd9b..819d975 100644
--- a/src/plugins/usrbg/index.css
+++ b/src/plugins/usrbg/index.css
@@ -4,27 +4,6 @@
z-index: -1;
}
-[class*="userPopout"] [class*="NonPremium"] [class*="bannerPremium"] {
- top: -30px;
-}
-
-[class*="NonPremium"]:has([class*="bannerPremium"]) [class*="bannerSVGWrapper"] {
- min-height: 120px !important;
-}
-
-[class*="NonPremium"]:has([class*="bannerPremium"]) [class*="bannerSVGWrapper"] foreignObject {
- height: 360px;
-}
-
-[class*="userPopout"] [class*="NonPremium"]:has([class*="bannerPremium"]) [class*="bannerSVGWrapper"] rect {
- height: 120px;
- y: -30;
-}
-
-[class*="userPopout"] [class*="NonPremium"]:has([class*="bannerPremium"]) [class*="bannerSVGWrapper"] circle {
- cy: 86;
-}
-
[class*="NonPremium"]:has([class*="bannerPremium"]) [class*="avatarPositionNormal"],
[class*="PremiumWithoutBanner"]:has([class*="bannerPremium"]) [class*="avatarPositionPremiumNoBanner"] {
top: 76px;
diff --git a/src/plugins/usrbg/index.tsx b/src/plugins/usrbg/index.tsx
index c898d92..09ecd57 100644
--- a/src/plugins/usrbg/index.tsx
+++ b/src/plugins/usrbg/index.tsx
@@ -46,11 +46,17 @@ export default definePlugin({
settings,
patches: [
{
- find: ".bannerSrc,",
- replacement: {
- match: /(\i)\.bannerSrc,/,
- replace: "$self.useBannerHook($1),"
- }
+ find: ".NITRO_BANNER,",
+ replacement: [
+ {
+ match: /(\i)\.premiumType/,
+ replace: "$self.premiumHook($1)||$&"
+ },
+ {
+ match: /(\i)\.bannerSrc,/,
+ replace: "$self.useBannerHook($1),"
+ }
+ ]
}
],
@@ -65,6 +71,10 @@ export default definePlugin({
if (data[user.id]) return data[user.id];
},
+ premiumHook({ userId }: any) {
+ if (data[userId]) return 2;
+ },
+
async start() {
enableStyle(style);