e6b3199490
之前遇到几次弹窗的样式不生效,bug 现在在画布agent的删除对话弹窗又出现了, 这个pr把类似的修改集中到最下层的UnifiedModal,适用于所有的modal, 一些特殊的modal有特殊处理. 画布agent的删除对话弹窗  --------- Co-authored-by: 段舒康 <kdletters@qq.com> Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/122 Reviewed-by: 段舒康 <kdletters@qq.com> Co-authored-by: 王德宇 <kvtodev@outlook.com> Co-committed-by: 王德宇 <kvtodev@outlook.com>
68 lines
2.2 KiB
TypeScript
68 lines
2.2 KiB
TypeScript
import { UnifiedModal } from '../common/UnifiedModal';
|
|
import { IMAGE_CANVAS_SHORTCUT_SECTIONS } from './ImageCanvasShortcutModel';
|
|
|
|
type ImageCanvasShortcutDialogViewProps = {
|
|
open: boolean;
|
|
onClose: () => void;
|
|
};
|
|
|
|
export function ImageCanvasShortcutDialogView({
|
|
open,
|
|
onClose,
|
|
}: ImageCanvasShortcutDialogViewProps) {
|
|
// TODO: Remove this override after full dark style support.
|
|
return (
|
|
<UnifiedModal
|
|
open={open}
|
|
title="画布快捷键"
|
|
size="lg"
|
|
portalTheme="light"
|
|
onClose={onClose}
|
|
panelClassName="image-canvas-editor__shortcut-modal"
|
|
bodyClassName="image-canvas-editor__shortcut-modal-body"
|
|
>
|
|
<div className="image-canvas-editor__shortcut-sections">
|
|
{IMAGE_CANVAS_SHORTCUT_SECTIONS.map((section) => (
|
|
<section
|
|
key={section.title}
|
|
className="image-canvas-editor__shortcut-section"
|
|
aria-labelledby={`image-canvas-shortcut-${section.title}`}
|
|
>
|
|
<h3 id={`image-canvas-shortcut-${section.title}`}>
|
|
{section.title}
|
|
</h3>
|
|
<dl className="image-canvas-editor__shortcut-list">
|
|
{section.items.map((item) => (
|
|
<div
|
|
key={`${section.title}-${item.action}`}
|
|
className="image-canvas-editor__shortcut-row"
|
|
>
|
|
<dt>
|
|
{item.action}
|
|
{item.status === 'new' ? <span>新增</span> : null}
|
|
</dt>
|
|
<dd>
|
|
{item.keys.map((key, index) => (
|
|
<span key={`${item.action}-${key}-${index}`}>
|
|
{index > 0 ? (
|
|
<span
|
|
className="image-canvas-editor__shortcut-plus"
|
|
aria-hidden="true"
|
|
>
|
|
+
|
|
</span>
|
|
) : null}
|
|
<kbd>{key}</kbd>
|
|
</span>
|
|
))}
|
|
</dd>
|
|
</div>
|
|
))}
|
|
</dl>
|
|
</section>
|
|
))}
|
|
</div>
|
|
</UnifiedModal>
|
|
);
|
|
}
|