Add Custom TitleView (#512)

* feat(titleView): Add Custom TitleView support

* fix: wrap TitleView in Focusable

* fix: remove root div on TitleView
This commit is contained in:
Beebles
2023-07-27 07:58:21 -06:00
committed by GitHub
parent 5460f95eac
commit c7e4eb1b3f
2 changed files with 4 additions and 3 deletions

View File

@@ -49,15 +49,15 @@ const TitleView: VFC = () => {
}
return (
<div className={staticClasses.Title} style={titleStyles}>
<Focusable className={staticClasses.Title} style={titleStyles}>
<DialogButton
style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }}
onClick={closeActivePlugin}
>
<FaArrowLeft style={{ marginTop: '-4px', display: 'block' }} />
</DialogButton>
<div style={{ flex: 0.9 }}>{activePlugin.name}</div>
</div>
{activePlugin?.titleView || <div style={{ flex: 0.9 }}>{activePlugin.name}</div>}
</Focusable>
);
};

View File

@@ -5,6 +5,7 @@ export interface Plugin {
content?: JSX.Element;
onDismount?(): void;
alwaysRender?: boolean;
titleView?: JSX.Element;
}
export enum InstallType {