From ede764b6f3621d9a5a7c90fcab81b416d70e878f Mon Sep 17 00:00:00 2001 From: aronmal Date: Wed, 27 Mar 2024 14:12:19 +0100 Subject: [PATCH] chore: Improved loading --- src/routes/config/[guildId].tsx | 455 ++++++++++++++++---------------- 1 file changed, 233 insertions(+), 222 deletions(-) diff --git a/src/routes/config/[guildId].tsx b/src/routes/config/[guildId].tsx index 5f1ab80..741dcb3 100644 --- a/src/routes/config/[guildId].tsx +++ b/src/routes/config/[guildId].tsx @@ -148,7 +148,7 @@ const saveConfig = async ( return { success: true }; }; -function config() { +function MyConfig() { const params = useParams(); const navigator = useNavigate(); const location = useLocation(); @@ -285,243 +285,254 @@ function config() { }); return ( - -
-

Configure li'l Judd in

+
+

Configure li'l Judd in

+
-
-
- Server pfp -

{payload()?.guild.name}

-
+
+ Server pfp +

{payload()?.guild.name}

+
-
-

Guild

-

General settings for this guild.

-
- - setTimezoneRef(e)} - onInput={(e) => - setConfig( - "features", - "timePlanning", - "timezone", - e.target.value, - ) - } - /> - - - - {(zone) => - - - -
-
- -
-

Features

-

Configure the features of the bot

- +
+

Guild

+

General settings for this guild.

+
+ setTpEnabledRef(e)} + type="text" + list="timezones" + id="timezone" + ref={(e) => setTimezoneRef(e)} + value={payload()?.guild.timezone} onInput={(e) => setConfig( "features", "timePlanning", - "enabled", - e.target.checked, + "timezone", + e.target.value, ) } /> -
-
- - - - {"<-- or changes won't be saved"} - -
-
- - - at - - : - -
-
- - setPingableRolesRef(e)} - onInput={(e) => - setConfig( - "features", - "timePlanning", - "pingableRoles", - e.target.checked, - ) - } - /> -
-
-
-
+ + + {(zone) => + + - - UNSAVED CHANGES -
-
+
+ + +
+

Features

+

Configure the features of the bot

+ + setTpEnabledRef(e)} + checked={!!payload()?.guild.tpChannelId} + onInput={(e) => + setConfig("features", "timePlanning", "enabled", e.target.checked) + } + /> +
+
+ + + + {"<-- or changes won't be saved"} + +
+
+ + + at + + : + +
+
+ + setPingableRolesRef(e)} + checked={payload()?.guild.pingableRoles} + onInput={(e) => + setConfig( + "features", + "timePlanning", + "pingableRoles", + e.target.checked, + ) + } + /> +
+
+
+ +
+ + + + UNSAVED CHANGES +
+
+ ); +} + +function config() { + return ( + + ); }