diff --git a/web/source/settings/admin/emoji/local/detail.js b/web/source/settings/admin/emoji/local/detail.js
index cc3ce6a70..1c74b854b 100644
--- a/web/source/settings/admin/emoji/local/detail.js
+++ b/web/source/settings/admin/emoji/local/detail.js
@@ -23,7 +23,7 @@ const React = require("react");
const { useRoute, Link, Redirect } = require("wouter");
const { CategorySelect } = require("../category-select");
-const { useComboBoxInput, useFileInput } = require("../../../components/form");
+const { useComboBoxInput, useFileInput } = require("../../../lib/form");
const query = require("../../../lib/query");
const FakeToot = require("../../../components/fake-toot");
diff --git a/web/source/settings/admin/emoji/local/new-emoji.js b/web/source/settings/admin/emoji/local/new-emoji.js
index 6701dbf5a..a9a5ea53a 100644
--- a/web/source/settings/admin/emoji/local/new-emoji.js
+++ b/web/source/settings/admin/emoji/local/new-emoji.js
@@ -22,13 +22,13 @@ const Promise = require('bluebird');
const React = require("react");
const FakeToot = require("../../../components/fake-toot");
-const MutateButton = require("../../../components/mutation-button");
+const MutationButton = require("../../../components/form/mutation-button");
const {
useTextInput,
useFileInput,
useComboBoxInput
-} = require("../../../components/form");
+} = require("../../../lib/form");
const query = require("../../../lib/query");
const { CategorySelect } = require('../category-select');
@@ -161,7 +161,7 @@ module.exports = function NewEmojiForm({ emoji }) {
categoryState={categoryState}
/>
-
+
);
diff --git a/web/source/settings/admin/emoji/remote/parse-from-toot.js b/web/source/settings/admin/emoji/remote/parse-from-toot.js
index 963ae1a80..1dff59f96 100644
--- a/web/source/settings/admin/emoji/remote/parse-from-toot.js
+++ b/web/source/settings/admin/emoji/remote/parse-from-toot.js
@@ -26,7 +26,7 @@ const syncpipe = require("syncpipe");
const {
useTextInput,
useComboBoxInput
-} = require("../../../components/form");
+} = require("../../../lib/form");
const { CategorySelect } = require('../category-select');
diff --git a/web/source/settings/components/fake-profile.jsx b/web/source/settings/components/fake-profile.jsx
index 8afccf2cc..81c717e23 100644
--- a/web/source/settings/components/fake-profile.jsx
+++ b/web/source/settings/components/fake-profile.jsx
@@ -19,24 +19,21 @@
"use strict";
const React = require("react");
-const Redux = require("react-redux");
-
-module.exports = function FakeProfile({}) {
- const account = Redux.useSelector(state => state.user.profile);
+module.exports = function FakeProfile({avatar, header, display_name, username, role}) {
return ( // Keep in sync with web/template/profile.tmpl
-
+
-
-
{account.display_name.trim().length > 0 ? account.display_name : account.username}
+
+
{display_name.trim().length > 0 ? display_name : username}
-
@{account.username}
- {(account.role && account.role != "user") &&
-
{account.role}
+
@{username}
+ {(role && role != "user") &&
+
{role}
}
diff --git a/web/source/settings/components/form/inputs.jsx b/web/source/settings/components/form/inputs.jsx
new file mode 100644
index 000000000..611ac671a
--- /dev/null
+++ b/web/source/settings/components/form/inputs.jsx
@@ -0,0 +1,102 @@
+/*
+ GoToSocial
+ Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see
.
+*/
+
+"use strict";
+
+const React = require("react");
+
+function TextInput({label, field, ...inputProps}) {
+ const {onChange, value, ref} = field;
+
+ return (
+
+
+ {label}
+
+
+
+ );
+}
+
+function TextArea({label, field, ...inputProps}) {
+ const {onChange, value, ref} = field;
+
+ return (
+
+
+ {label}
+
+
+
+ );
+}
+
+function FileInput({label, field, ...inputProps}) {
+ const {onChange, ref, infoComponent} = field;
+
+ return (
+
+
+ {label}
+ Browse
+ {infoComponent}
+ {/* remove */}
+
+
+
+ );
+}
+
+function Checkbox({label, field, ...inputProps}) {
+ const {onChange, value} = field;
+
+ return (
+
+
+ {label}
+
+
+
+ );
+
+}
+
+module.exports = {
+ TextInput,
+ TextArea,
+ FileInput,
+ Checkbox
+};
\ No newline at end of file
diff --git a/web/source/settings/components/mutation-button.jsx b/web/source/settings/components/form/mutation-button.jsx
similarity index 97%
rename from web/source/settings/components/mutation-button.jsx
rename to web/source/settings/components/form/mutation-button.jsx
index 2d0f2a2b4..f0b776703 100644
--- a/web/source/settings/components/mutation-button.jsx
+++ b/web/source/settings/components/form/mutation-button.jsx
@@ -37,6 +37,7 @@ module.exports = function MutateButton({text, result}) {
disabled={result.isLoading}
value={buttonText}
/>
+ {result.isSuccess && "Success!"}
);
};
\ No newline at end of file
diff --git a/web/source/settings/lib/form/bool.jsx b/web/source/settings/lib/form/bool.jsx
new file mode 100644
index 000000000..5553a269b
--- /dev/null
+++ b/web/source/settings/lib/form/bool.jsx
@@ -0,0 +1,49 @@
+/*
+ GoToSocial
+ Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see