pl-fe: fix refs

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-09-20 21:03:14 +02:00
parent 943366b6bf
commit 7072401f18
4 changed files with 8 additions and 1 deletions

View file

@ -58,6 +58,7 @@ const FamiliarFollowersModal: React.FC<BaseModalProps & FamiliarFollowersModalPr
/>
}
onClose={onClickClose}
ref={modalRef}
>
{body}
</Modal>

View file

@ -68,6 +68,7 @@ const FavouritesModal: React.FC<BaseModalProps & FavouritesModalProps> = ({ onCl
<Modal
title={<FormattedMessage id='column.favourites' defaultMessage='Likes' />}
onClose={onClickClose}
ref={modalRef}
>
{body}
</Modal>

View file

@ -1,5 +1,5 @@
import { OrderedSet as ImmutableOrderedSet } from 'immutable';
import React, { useCallback, useEffect } from 'react';
import React, { useCallback, useEffect, useRef } from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import { fetchStatusWithContext } from 'pl-fe/actions/statuses';
@ -16,6 +16,7 @@ interface MentionsModalProps {
}
const MentionsModal: React.FC<BaseModalProps & MentionsModalProps> = ({ onClose, statusId }) => {
const modalRef = useRef<HTMLDivElement>(null);
const dispatch = useAppDispatch();
const intl = useIntl();
const getStatus = useCallback(makeGetStatus(), []);
@ -45,6 +46,8 @@ const MentionsModal: React.FC<BaseModalProps & MentionsModalProps> = ({ onClose,
listClassName='max-w-full'
itemClassName='pb-3'
estimatedSize={42}
useWindowScroll={false}
parentRef={modalRef}
>
{accountIds.map(id =>
<AccountContainer key={id} id={id} />,
@ -57,6 +60,7 @@ const MentionsModal: React.FC<BaseModalProps & MentionsModalProps> = ({ onClose,
<Modal
title={<FormattedMessage id='column.mentions' defaultMessage='Mentions' />}
onClose={onClickClose}
ref={modalRef}
>
{body}
</Modal>

View file

@ -109,6 +109,7 @@ const ReactionsModal: React.FC<BaseModalProps & ReactionsModalProps> = ({ onClos
<Modal
title={<FormattedMessage id='column.reactions' defaultMessage='Reactions' />}
onClose={onClickClose}
ref={modalRef}
>
{body}
</Modal>