mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(threads): let the thread members popout scroll (#3298)
This commit is contained in:
1 parent
b82bbaa2dd
commit
170e12595b
3 files changed
+27
-5
No files matched your search
@@ -6,6 +6,7 @@ import {MEMBERS_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescript
|
|||||||
import {Scroller, type ScrollerHandle} from '@app/features/ui/components/Scroller';
|
import {Scroller, type ScrollerHandle} from '@app/features/ui/components/Scroller';
|
||||||
import KeyboardMode from '@app/features/ui/state/KeyboardMode';
|
import KeyboardMode from '@app/features/ui/state/KeyboardMode';
|
||||||
import {useLingui} from '@lingui/react/macro';
|
import {useLingui} from '@lingui/react/macro';
|
||||||
|
import {clsx} from 'clsx';
|
||||||
import {observer} from 'mobx-react-lite';
|
import {observer} from 'mobx-react-lite';
|
||||||
import type React from 'react';
|
import type React from 'react';
|
||||||
import type {UIEvent} from 'react';
|
import type {UIEvent} from 'react';
|
||||||
@@ -16,6 +17,7 @@ interface MemberListContainerProps {
|
|||||||
channelId: string;
|
channelId: string;
|
||||||
identityKey?: string;
|
identityKey?: string;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
className?: string;
|
||||||
scrollerRef?: React.RefObject<ScrollerHandle | null>;
|
scrollerRef?: React.RefObject<ScrollerHandle | null>;
|
||||||
estimatedContentSize?: number | null;
|
estimatedContentSize?: number | null;
|
||||||
onScroll?: (event: UIEvent<HTMLDivElement>) => void;
|
onScroll?: (event: UIEvent<HTMLDivElement>) => void;
|
||||||
@@ -26,6 +28,7 @@ export const MemberListContainer: React.FC<MemberListContainerProps> = observer(
|
|||||||
channelId,
|
channelId,
|
||||||
identityKey,
|
identityKey,
|
||||||
children,
|
children,
|
||||||
|
className,
|
||||||
scrollerRef,
|
scrollerRef,
|
||||||
estimatedContentSize,
|
estimatedContentSize,
|
||||||
onScroll,
|
onScroll,
|
||||||
@@ -43,7 +46,7 @@ export const MemberListContainer: React.FC<MemberListContainerProps> = observer(
|
|||||||
return (
|
return (
|
||||||
<aside
|
<aside
|
||||||
ref={navigationRef}
|
ref={navigationRef}
|
||||||
className={styles.memberListContainer}
|
className={clsx(styles.memberListContainer, className)}
|
||||||
aria-label={i18n._(MEMBERS_DESCRIPTOR)}
|
aria-label={i18n._(MEMBERS_DESCRIPTOR)}
|
||||||
data-flx="channel.member-list-container.member-list-container"
|
data-flx="channel.member-list-container.member-list-container"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -80,13 +80,28 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.membersPopout {
|
.membersPopout {
|
||||||
|
--thread-members-popout-max-height: 30rem;
|
||||||
|
--thread-members-popout-padding-block: 0.5rem;
|
||||||
|
--thread-members-popout-border-width: 0.0625rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 16.5rem;
|
width: 16.5rem;
|
||||||
max-height: 30rem;
|
max-height: var(--thread-members-popout-max-height);
|
||||||
padding: 0.5rem 0;
|
padding: var(--thread-members-popout-padding-block) 0;
|
||||||
border: 0.0625rem solid var(--background-modifier-accent);
|
border: var(--thread-members-popout-border-width) solid var(--background-modifier-accent);
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
background: var(--background-secondary);
|
background: var(--background-secondary);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.membersPopoutList {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
max-height: calc(
|
||||||
|
var(--thread-members-popout-max-height) -
|
||||||
|
2 *
|
||||||
|
var(--thread-members-popout-padding-block) -
|
||||||
|
2 *
|
||||||
|
var(--thread-members-popout-border-width)
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -61,7 +61,11 @@ const ThreadMembersButton = observer(({thread}: {thread: Channel}) => {
|
|||||||
position="bottom-end"
|
position="bottom-end"
|
||||||
render={() => (
|
render={() => (
|
||||||
<div className={styles.membersPopout} data-flx="threads.thread-side-panel.members-popout">
|
<div className={styles.membersPopout} data-flx="threads.thread-side-panel.members-popout">
|
||||||
<MemberListContainer channelId={thread.id} data-flx="threads.thread-side-panel.member-list-container">
|
<MemberListContainer
|
||||||
|
channelId={thread.id}
|
||||||
|
className={styles.membersPopoutList}
|
||||||
|
data-flx="threads.thread-side-panel.member-list-container"
|
||||||
|
>
|
||||||
<ThreadMembersList thread={thread} data-flx="threads.thread-side-panel.thread-members-list" />
|
<ThreadMembersList thread={thread} data-flx="threads.thread-side-panel.thread-members-list" />
|
||||||
</MemberListContainer>
|
</MemberListContainer>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user