mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:40:01 +00:00
text-field exports
This commit is contained in:
parent
9f8603de31
commit
a4f0fb9e25
1 changed files with 22 additions and 13 deletions
|
@ -67,6 +67,13 @@ module.exports = function ImportExport() {
|
||||||
reader.readAsText(e.target.files[0]);
|
reader.readAsText(e.target.files[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (exportResult.isSuccess) {
|
||||||
|
form.domains.setter(exportResult.data);
|
||||||
|
}
|
||||||
|
/* eslint-disable-next-line react-hooks/exhaustive-deps */
|
||||||
|
}, [exportResult]);
|
||||||
|
|
||||||
const [_location, setLocation] = useLocation();
|
const [_location, setLocation] = useLocation();
|
||||||
|
|
||||||
if (updateFromFile) {
|
if (updateFromFile) {
|
||||||
|
@ -98,15 +105,15 @@ module.exports = function ImportExport() {
|
||||||
{parseResult.isSuccess && <Redirect to={`${baseUrl}/list`} />}
|
{parseResult.isSuccess && <Redirect to={`${baseUrl}/list`} />}
|
||||||
<h2>Import / Export suspended domains</h2>
|
<h2>Import / Export suspended domains</h2>
|
||||||
|
|
||||||
<form onSubmit={submitParse}>
|
<div>
|
||||||
<TextArea
|
<form onSubmit={submitParse}>
|
||||||
field={form.domains}
|
<TextArea
|
||||||
label="Domains, one per line (plaintext) or JSON"
|
field={form.domains}
|
||||||
placeholder={`google.com\nfacebook.com`}
|
label="Domains, one per line (plaintext) or JSON"
|
||||||
rows={8}
|
placeholder={`google.com\nfacebook.com`}
|
||||||
/>
|
rows={8}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="row">
|
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<MutationButton label="Import" result={parseResult} showError={false} />
|
<MutationButton label="Import" result={parseResult} showError={false} />
|
||||||
<button type="button" className="with-padding">
|
<button type="button" className="with-padding">
|
||||||
|
@ -116,9 +123,11 @@ module.exports = function ImportExport() {
|
||||||
</label>
|
</label>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
|
<form onSubmit={submitExport}>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<MutationButton form="export-form" name="export" label="Export" result={exportResult} showError={false} />
|
<MutationButton name="export" label="Export" result={exportResult} showError={false} />
|
||||||
<MutationButton form="export-form" name="export-file" label="Export file" result={exportResult} showError={false} />
|
<MutationButton name="export-file" label="Export file" result={exportResult} showError={false} />
|
||||||
<Select
|
<Select
|
||||||
field={form.exportType}
|
field={form.exportType}
|
||||||
options={<>
|
options={<>
|
||||||
|
@ -127,10 +136,10 @@ module.exports = function ImportExport() {
|
||||||
</>}
|
</>}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
{parseResult.error && <Error error={parseResult.error} />}
|
{parseResult.error && <Error error={parseResult.error} />}
|
||||||
</form>
|
{exportResult.error && <Error error={exportResult.error} />}
|
||||||
<form id="export-form" onSubmit={submitExport} />
|
</div>
|
||||||
</Route>
|
</Route>
|
||||||
</Switch>
|
</Switch>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue