Poll history - make poll history independent from dialogs (#10349)
* move pollhistory from dialogs to polls directory * rename PollHistoryDialog -> PollHistory * rename references to PollHistoryDialog * move title to PollHistory * add option to collapse empty dialog header
This commit is contained in:
parent
127a3b667c
commit
1e46efe89c
25 changed files with 290 additions and 251 deletions
|
@ -151,6 +151,9 @@ export default class BaseDialog extends React.Component<IProps> {
|
|||
lockProps["aria-labelledby"] = "mx_BaseDialog_title";
|
||||
}
|
||||
|
||||
const isHeaderWithCancelOnly =
|
||||
!!cancelButton && !this.props.title && !this.props.headerButton && !this.props.headerImage;
|
||||
|
||||
return (
|
||||
<MatrixClientContext.Provider value={this.matrixClient}>
|
||||
{this.props.screenName && <PosthogScreenTracker screenName={this.props.screenName} />}
|
||||
|
@ -166,16 +169,19 @@ export default class BaseDialog extends React.Component<IProps> {
|
|||
className={classNames("mx_Dialog_header", {
|
||||
mx_Dialog_headerWithButton: !!this.props.headerButton,
|
||||
mx_Dialog_headerWithCancel: !!cancelButton,
|
||||
mx_Dialog_headerWithCancelOnly: isHeaderWithCancelOnly,
|
||||
})}
|
||||
>
|
||||
<Heading
|
||||
size="h2"
|
||||
className={classNames("mx_Dialog_title", this.props.titleClass)}
|
||||
id="mx_BaseDialog_title"
|
||||
>
|
||||
{headerImage}
|
||||
{this.props.title}
|
||||
</Heading>
|
||||
{!!(this.props.title || headerImage) && (
|
||||
<Heading
|
||||
size="h2"
|
||||
className={classNames("mx_Dialog_title", this.props.titleClass)}
|
||||
id="mx_BaseDialog_title"
|
||||
>
|
||||
{headerImage}
|
||||
{this.props.title}
|
||||
</Heading>
|
||||
)}
|
||||
{this.props.headerButton}
|
||||
{cancelButton}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue