fix layout of story views/replies modal

This commit is contained in:
Jamie Kyle 2023-08-04 17:54:05 -07:00 committed by GitHub
parent e3ffc70389
commit 7b6cd00b3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View file

@ -1,36 +1,34 @@
// Copyright 2022 Signal Messenger, LLC // Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only // SPDX-License-Identifier: AGPL-3.0-only
$tabs-height: 28px;
$tabs-margin-bottom: 16px;
$footer-height: 36px;
.StoryViewsNRepliesModal { .StoryViewsNRepliesModal {
min-width: 320px; min-width: 320px;
min-height: min(400px, 80vh);
max-height: 80vh;
overflow: hidden; overflow: hidden;
&--group { &--group {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: 1; flex: 1;
// explicit height prevents height:auto
// while allowing flex to actually size it
height: 0;
.StoryViewsNRepliesModal__replies { .StoryViewsNRepliesModal__replies {
// at least 400px tall flex: 1;
// but if screen is small, allow it to shrink further overflow: auto;
// 75% - (header + header bottom margin + footer)
min-height: min(
calc(75vh - ($tabs-height + $tabs-margin-bottom + $footer-height)),
400px
);
} }
} }
&__body { &__body {
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; // override modal's overflow: auto
}
&__body_inner {
display: flex;
flex-direction: column;
flex: 1;
} }
&__replies { &__replies {
@ -259,7 +257,7 @@ $footer-height: 36px;
.Tabs.StoryViewsNRepliesModal__tabs { .Tabs.StoryViewsNRepliesModal__tabs {
border-bottom: none; border-bottom: none;
justify-content: center; justify-content: center;
margin-bottom: $tabs-margin-bottom; margin-bottom: 16px;
} }
.Tabs__tab.StoryViewsNRepliesModal__tabs__tab { .Tabs__tab.StoryViewsNRepliesModal__tabs__tab {

View file

@ -254,7 +254,9 @@ export function ModalPage({
)} )}
ref={bodyRef} ref={bodyRef}
> >
<div ref={bodyInnerRef}>{children}</div> <div ref={bodyInnerRef} className={getClassName('__body_inner')}>
{children}
</div>
</div> </div>
{modalFooter && <Modal.ButtonFooter>{modalFooter}</Modal.ButtonFooter>} {modalFooter && <Modal.ButtonFooter>{modalFooter}</Modal.ButtonFooter>}
</div> </div>