admin ui: made context overlays scrollable

This commit is contained in:
dswbx
2025-12-22 15:10:36 +01:00
parent 4f7925dfd8
commit 81f3914e7f

View File

@@ -378,11 +378,7 @@ function replaceEntitiesEnum(schema: Record<string, any>, entities: string[]) {
});
}
const Policy = ({
permission,
}: {
permission: TPermission;
}) => {
const Policy = ({ permission }: { permission: TPermission }) => {
const { value } = useDerivedFieldContext("", ({ value }) => ({
effect: (value?.effect ?? "allow") as "allow" | "deny" | "filter",
}));
@@ -503,22 +499,24 @@ const CustomFieldWrapper = ({
className: "max-w-none",
}}
position="bottom-end"
target={() =>
typeof schema.content === "object" ? (
<JsonViewer
className="w-auto max-w-120 bg-background pr-3 text-sm"
json={schema.content}
title={schema.name}
expand={5}
/>
) : (
<CodePreview
code={schema.content}
lang="typescript"
className="w-auto max-w-120 bg-background p-3 text-sm"
/>
)
}
target={() => (
<div className="w-auto max-w-[80vw] md:max-w-120 bg-background overflow-scroll">
{typeof schema.content === "object" ? (
<JsonViewer
className="pr-3 text-sm"
json={schema.content}
title={schema.name}
expand={5}
/>
) : (
<CodePreview
code={schema.content}
lang="typescript"
className="p-3 text-sm"
/>
)}
</div>
)}
>
<Button variant="ghost" size="smaller" IconLeft={TbCodeDots}>
{autoFormatString(schema.name)}