chore: update frontend folder

This commit is contained in:
Steven
2023-08-23 09:13:42 +08:00
parent 40814a801a
commit f5817c575c
129 changed files with 104 additions and 1648 deletions

View File

@@ -0,0 +1,34 @@
import { Checkbox } from "@mui/joy";
import { useEffect, useState } from "react";
import { getWorkspaceProfile, upsertWorkspaceSetting } from "../../helpers/api";
const WorkspaceSection: React.FC = () => {
const [disallowSignUp, setDisallowSignUp] = useState<boolean>(false);
useEffect(() => {
getWorkspaceProfile().then(({ data }) => {
setDisallowSignUp(data.disallowSignUp);
});
}, []);
const handleDisallowSignUpChange = async (value: boolean) => {
await upsertWorkspaceSetting("disallow-signup", JSON.stringify(value));
setDisallowSignUp(value);
};
return (
<div className="w-full flex flex-col justify-start items-start space-y-4">
<p className="text-base font-semibold leading-6 text-gray-900">Workspace settings</p>
<div className="w-full flex flex-col justify-start items-start">
<Checkbox
label="Disable user signup"
checked={disallowSignUp}
onChange={(event) => handleDisallowSignUpChange(event.target.checked)}
/>
<p className="mt-2 text-gray-500">Once disabled, other users cannot signup.</p>
</div>
</div>
);
};
export default WorkspaceSection;