Modal height fix on author page

This commit is contained in:
kvakazyambra 2023-09-07 01:50:54 +03:00
parent 404de31301
commit 490af4cbbb
3 changed files with 11 additions and 3 deletions

View File

@ -339,7 +339,7 @@ export const AuthorCard = (props: AuthorCardProps) => {
</div>
<Show when={props.followers}>
<Modal variant="wide" name="followers">
<Modal variant="wide" name="followers" maxHeight>
<>
<h2>{t('Followers')}</h2>
<div class={styles.listWrapper}>
@ -366,7 +366,7 @@ export const AuthorCard = (props: AuthorCardProps) => {
</Show>
<Show when={props.subscriptions}>
<Modal variant="wide" name="subscriptions">
<Modal variant="wide" name="subscriptions" maxHeight>
<>
<h2>{t('Subscriptions')}</h2>
<ul class="view-switcher">

View File

@ -74,3 +74,9 @@
.noPadding {
padding: 0 2rem;
}
.maxHeight {
display: flex;
flex-direction: column;
height: 90vh;
}

View File

@ -13,6 +13,7 @@ interface ModalProps {
children: JSX.Element
onClose?: () => void
noPadding?: boolean
maxHeight?: boolean
}
export const Modal = (props: ModalProps) => {
@ -39,7 +40,8 @@ export const Modal = (props: ModalProps) => {
<div
class={clsx(styles.modal, {
[styles.narrow]: props.variant === 'narrow',
[styles.noPadding]: props.noPadding
[styles.noPadding]: props.noPadding,
[styles.maxHeight]: props.maxHeight
})}
onClick={(event) => event.stopPropagation()}
>