Notification toasts, nicer loading, add new user support

This commit is contained in:
Jamie Curnow committed 2025-10-02 08:11:14 +10:00
1 parent fadec9751e
commit 61a92906f3
31 files changed
+401 -215

No files matched your search

+3 -2
View File
@@ -8,7 +8,7 @@ import { UserModal } from "src/modals";
import Table from "./Table";
export default function TableWrapper() {
const [editUserId, setEditUserId] = useState(0);
const [editUserId, setEditUserId] = useState(0 as number | "new");
const { isFetching, isLoading, isError, error, data } = useUsers(["permissions"]);
const { data: currentUser } = useUser("me");
@@ -42,7 +42,7 @@ export default function TableWrapper() {
autoComplete="off"
/>
</div>
<Button size="sm" className="btn-orange">
<Button size="sm" className="btn-orange" onClick={() => setEditUserId("new")}>
{intl.formatMessage({ id: "users.add" })}
</Button>
</div>
@@ -54,6 +54,7 @@ export default function TableWrapper() {
isFetching={isFetching}
currentUserId={currentUser?.id}
onEditUser={(id: number) => setEditUserId(id)}
onNewUser={() => setEditUserId("new")}
/>
{editUserId ? <UserModal userId={editUserId} onClose={() => setEditUserId(0)} /> : null}
</div>