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:
Kerry 2023-03-13 09:22:30 +13:00 committed by GitHub
parent 127a3b667c
commit 1e46efe89c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 290 additions and 251 deletions

View file

@ -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>