Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9873 from matrix-org/johannes/polls-dialog-scaling
Browse files Browse the repository at this point in the history
Make create poll dialog scale better (PSG-929)
  • Loading branch information
Johennes authored Jan 10, 2023
2 parents 4627456 + 5dfde12 commit c94a4ab
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
27 changes: 19 additions & 8 deletions res/css/views/dialogs/_CompoundDialog.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ limitations under the License.
}

.mx_CompoundDialog {
.mx_Dialog {
display: flex;
flex-direction: column;
}

.mx_CompoundDialog_header {
padding: 32px 32px 16px 32px;

Expand All @@ -49,6 +54,13 @@ limitations under the License.
}
}

.mx_CompoundDialog_form {
display: flex;
flex-direction: column;
min-height: 0;
max-height: 100%;
}

.mx_CompoundDialog_content {
overflow: auto;
padding: 8px 32px;
Expand All @@ -57,10 +69,6 @@ limitations under the License.
.mx_CompoundDialog_footer {
padding: 20px 32px;
text-align: right;
position: absolute;
bottom: 0;
left: 0;
right: 0;

.mx_AccessibleButton {
margin-left: 24px;
Expand All @@ -69,14 +77,17 @@ limitations under the License.
}

.mx_ScrollableBaseDialog {
display: flex;
flex-direction: column;

width: 544px; /* fixed */
height: 516px; /* fixed */

.mx_CompoundDialog_content {
height: 349px; /* dialogHeight - header - footer */
}
max-width: 100%;
min-height: 0;
max-height: 80%;

.mx_CompoundDialog_footer {
box-shadow: 0px -4px 4px rgba(0, 0, 0, 0.05); /* hardcoded colour for both themes */
z-index: 1; /* needed to make footer & shadow appear above dialog content */
}
}
2 changes: 1 addition & 1 deletion src/components/views/dialogs/ScrollableBaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default abstract class ScrollableBaseModal<
aria-label={_t("Close dialog")}
/>
</div>
<form onSubmit={this.onSubmit}>
<form onSubmit={this.onSubmit} className="mx_CompoundDialog_form">
<div className="mx_CompoundDialog_content">{this.renderContent()}</div>
<div className="mx_CompoundDialog_footer">
<AccessibleButton onClick={this.onCancel} kind="primary_outline">
Expand Down
Loading

0 comments on commit c94a4ab

Please sign in to comment.