diff --git a/src/routes/config/[guildId].tsx b/src/routes/config/[guildId].tsx index 741dcb3..831e143 100644 --- a/src/routes/config/[guildId].tsx +++ b/src/routes/config/[guildId].tsx @@ -148,7 +148,7 @@ const saveConfig = async ( return { success: true }; }; -function MyConfig() { +function config() { const params = useParams(); const navigator = useNavigate(); const location = useLocation(); @@ -201,7 +201,7 @@ function MyConfig() { }); const updateValues = createMemo(() => { - const guild = payload()?.guild; + const guild = !payload.loading && payload()?.guild; if (!guild) return {}; const data = config.features.timePlanning; const tpInterval = combineInterval( @@ -285,254 +285,257 @@ function MyConfig() { }); 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.

-
- +
+

Guild

+

General settings for this guild.

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

Features

+

Configure the features of the bot

+ setTimezoneRef(e)} - value={payload()?.guild.timezone} + hidden + type="checkbox" + id="timePlanning" + ref={(e) => setTpEnabledRef(e)} + checked={!!payload()?.guild.tpChannelId} onInput={(e) => setConfig( "features", "timePlanning", - "timezone", - e.target.value, + "enabled", + e.target.checked, ) } /> - - - - {(zone) => - - - -
-
- -
-

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 - - : - -
-
-
+
+ + + at + + : + +
+
+ + setPingableRolesRef(e)} + checked={payload()?.guild.pingableRoles} + onInput={(e) => + setConfig( + "features", + "timePlanning", + "pingableRoles", + e.target.checked, + ) } - size="xl" /> - - setPingableRolesRef(e)} - checked={payload()?.guild.pingableRoles} - onInput={(e) => - setConfig( - "features", - "timePlanning", - "pingableRoles", - e.target.checked, - ) - } - /> +
-
- + -
- - - - UNSAVED CHANGES -
+
+ + + + UNSAVED CHANGES +
+
-
- ); -} - -function config() { - return ( - - ); }