mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 20:42:25 -05:00
[chore] Settings refactor 2: the re-refactoring-ing (#2866)
* [chore] Bit more refactoring of settings panel * fix up some remaining things * groovy baby yeah! * remove unused Suspense
This commit is contained in:
parent
7a1e639483
commit
aecf74951c
41 changed files with 1360 additions and 958 deletions
|
|
@ -18,18 +18,19 @@
|
|||
*/
|
||||
|
||||
import React from "react";
|
||||
import query from "../../lib/query";
|
||||
import { useTextInput, useBoolInput } from "../../lib/form";
|
||||
import useFormSubmit from "../../lib/form/submit";
|
||||
import { Select, TextInput, Checkbox } from "../../components/form/inputs";
|
||||
import FormWithData from "../../lib/form/form-with-data";
|
||||
import Languages from "../../components/languages";
|
||||
import MutationButton from "../../components/form/mutation-button";
|
||||
import { useVerifyCredentialsQuery } from "../../lib/query/oauth";
|
||||
import { usePasswordChangeMutation, useUpdateCredentialsMutation } from "../../lib/query/user";
|
||||
|
||||
export default function UserSettings() {
|
||||
return (
|
||||
<FormWithData
|
||||
dataQuery={query.useVerifyCredentialsQuery}
|
||||
dataQuery={useVerifyCredentialsQuery}
|
||||
DataForm={UserSettingsForm}
|
||||
/>
|
||||
);
|
||||
|
|
@ -50,7 +51,7 @@ function UserSettingsForm({ data }) {
|
|||
statusContentType: useTextInput("source[status_content_type]", { source: data, defaultValue: "text/plain" }),
|
||||
};
|
||||
|
||||
const [submitForm, result] = useFormSubmit(form, query.useUpdateCredentialsMutation());
|
||||
const [submitForm, result] = useFormSubmit(form, useUpdateCredentialsMutation());
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
@ -123,7 +124,7 @@ function PasswordChange() {
|
|||
}
|
||||
});
|
||||
|
||||
const [submitForm, result] = useFormSubmit(form, query.usePasswordChangeMutation());
|
||||
const [submitForm, result] = useFormSubmit(form, usePasswordChangeMutation());
|
||||
|
||||
return (
|
||||
<form className="change-password" onSubmit={submitForm}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue