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
+3 -3
View File
@@ -49,15 +49,15 @@ const TitleView: VFC = () => {
} }
return ( return (
<div className={staticClasses.Title} style={titleStyles}> <Focusable className={staticClasses.Title} style={titleStyles}>
<DialogButton <DialogButton
style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }} style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }}
onClick={closeActivePlugin} onClick={closeActivePlugin}
> >
<FaArrowLeft style={{ marginTop: '-4px', display: 'block' }} /> <FaArrowLeft style={{ marginTop: '-4px', display: 'block' }} />
</DialogButton> </DialogButton>
<div style={{ flex: 0.9 }}>{activePlugin.name}</div> {activePlugin?.titleView || <div style={{ flex: 0.9 }}>{activePlugin.name}</div>}
</div> </Focusable>
); );
}; };
+1
View File
@@ -5,6 +5,7 @@ export interface Plugin {
content?: JSX.Element; content?: JSX.Element;
onDismount?(): void; onDismount?(): void;
alwaysRender?: boolean; alwaysRender?: boolean;
titleView?: JSX.Element;
} }
export enum InstallType { export enum InstallType {