mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-04 11:51:36 +02:00
New interface for adding space panel items
This commit is contained in:
parent
9685775528
commit
446830776f
@ -7,20 +7,31 @@ Please see LICENSE files in the repository root for full details.
|
||||
|
||||
import { JSX } from "react";
|
||||
|
||||
interface SpacePanelItemProps {
|
||||
isPanelCollapsed: boolean;
|
||||
}
|
||||
/**
|
||||
* Any kind of event that can trigger a button
|
||||
* @alpha
|
||||
*/
|
||||
export type ButtonEvent = React.MouseEvent<Element> | React.KeyboardEvent<Element> | React.FormEvent<Element>;
|
||||
|
||||
/**
|
||||
* The type of the function used to render a space panel item.
|
||||
* @alpha
|
||||
*/
|
||||
export type SpacePanelItemRenderFunction = (props: SpacePanelItemProps) => JSX.Element;
|
||||
export interface SpacePanelItemProps {
|
||||
spaceKey?: string;
|
||||
className?: string;
|
||||
icon?: JSX.Element;
|
||||
label: string;
|
||||
contextMenuTooltip?: string;
|
||||
style?: React.CSSProperties;
|
||||
//notificationState?: NotificationState;
|
||||
onClick?(ev?: ButtonEvent): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* API for inserting extra UI into Element Web.
|
||||
* @alpha Subject to change.
|
||||
*/
|
||||
export interface ExtrasApi {
|
||||
addSpacePanelItem(renderer: SpacePanelItemRenderFunction): void;
|
||||
addSpacePanelItem(props: SpacePanelItemProps): void;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user