ui: reflect readonly mode by hiding controls + various small styling fixes

This commit is contained in:
dswbx
2025-09-05 17:09:50 +02:00
parent 1df87c8a16
commit af573cc79a
18 changed files with 153 additions and 74 deletions

View File

@@ -26,6 +26,7 @@ function AuthRolesEditInternal({ params }) {
const roleName = params.role;
const role = config.roles?.[roleName];
const formRef = useRef<AuthRoleFormRef>(null);
const { readonly } = useBknd();
async function handleUpdate() {
console.log("data", formRef.current?.isValid());
@@ -57,7 +58,7 @@ function AuthRolesEditInternal({ params }) {
absolute: true,
}),
},
{
!readonly && {
label: "Delete",
onClick: handleDelete,
destructive: true,
@@ -67,9 +68,11 @@ function AuthRolesEditInternal({ params }) {
>
<IconButton Icon={TbDots} />
</Dropdown>
!readonly && (
<Button variant="primary" onClick={handleUpdate}>
Update
</Button>
)
</>
}
className="pl-3"