Skip to content

Commit

Permalink
Add Custom TitleView (#512)
Browse files Browse the repository at this point in the history
* feat(titleView): Add Custom TitleView support

* fix: wrap TitleView in Focusable

* fix: remove root div on TitleView
  • Loading branch information
beebls authored Jul 27, 2023
1 parent 5460f95 commit c7e4eb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/components/TitleView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
};

Expand Down
1 change: 1 addition & 0 deletions frontend/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface Plugin {
content?: JSX.Element;
onDismount?(): void;
alwaysRender?: boolean;
titleView?: JSX.Element;
}

export enum InstallType {
Expand Down

0 comments on commit c7e4eb1

Please sign in to comment.