From 365ca0ef5716761cd09ef4f7c4bc540440f3c977 Mon Sep 17 00:00:00 2001
From: Manti <67705577+mantikafasi@users.noreply.github.com>
Date: Sat, 18 Feb 2023 14:21:30 +0300
Subject: [PATCH] update profile component
---
src/plugins/Timezones/index.tsx | 40 ++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git a/src/plugins/Timezones/index.tsx b/src/plugins/Timezones/index.tsx
index 2a8e2178e..fcd05062f 100644
--- a/src/plugins/Timezones/index.tsx
+++ b/src/plugins/Timezones/index.tsx
@@ -21,9 +21,11 @@ import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption,
import { Devs } from "@utils/constants";
import { classes } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types";
-import { findByPropsLazy } from "@webpack";
-import { React, UserStore } from "@webpack/common";
+import { findByCodeLazy, findByPropsLazy } from "@webpack";
+import { React, Text, UserStore } from "@webpack/common";
import { Message, User } from "discord-types/general";
+const EditIcon = findByCodeLazy("M19.2929 9.8299L19.9409 9.18278C21.353 7.77064 21.353 5.47197 19.9409");
+const classNames = findByPropsLazy("customStatusSection");
import { getTimeString, getUserTimezone } from "./Utils";
const styles = findByPropsLazy("timestampInline");
@@ -120,10 +122,11 @@ export default definePlugin({
},
},
{
- find: "().popoutNoBannerPremium",
+ find: "().customStatusSection",
replacement: {
- match: /return(\(0,.\.jsx\)\(.\..,\{.*\}\))/,
- replace: "return [$1, Vencord.Plugins.plugins.Timezones.getProfileTimezonesComponent(e)]"
+ // Inserts the timezone component right below the custom status.
+ match: /user:(\w),nickname:\w,.*?children.*?\(\)\.customStatusSection.*?\}\),/,
+ replace: "$&$self.getProfileTimezonesComponent({user:$1}),"
}
}
],
@@ -138,22 +141,27 @@ export default definePlugin({
getUserTimezone(user.id).then(timezone => setTimezone(timezone));
}, [user.id]);
- if (!Vencord.Settings.plugins.Timezones.showTimezonesInProfile || !timezone) {
+ if (!Vencord.Settings.plugins.Timezones.showTimezonesInProfile) {
return null;
}
+ // thank you arjix very cool
return (
- {
+ return console.log("ahhh!");
+ // TODO create a modal to set timezone and make text clickable h
+ }} style={{
+ alignItems: "center",
+ // make it clickable
+ cursor: "pointer",
}}>
- {getTimeString(timezone)}
-
+ {(timezone) ? getTimeString(timezone) : "Click to set timezone"}
+
+
+
+
);
}
,