diff --git a/src/components/middle/ReactorListModal.scss b/src/components/middle/ReactorListModal.scss index c2847ed1b..c4d3f14aa 100644 --- a/src/components/middle/ReactorListModal.scss +++ b/src/components/middle/ReactorListModal.scss @@ -14,6 +14,10 @@ } } + .modal-dialog { + overflow: clip; + } + .modal-content { overflow: hidden; display: flex; @@ -24,9 +28,9 @@ } .reactor-list-wrapper { + position: relative; flex-grow: 1; min-height: 0; - border-top: 1px solid var(--color-borders); } .confirm-dialog-button { @@ -53,8 +57,10 @@ .reactor-list { overflow: auto; overflow-x: hidden; + max-height: 100%; - padding: 0 0.5rem; + padding-top: 0.5rem; + padding-inline: 0.5rem; } .reactors-list-item { diff --git a/src/components/middle/ReactorListModal.tsx b/src/components/middle/ReactorListModal.tsx index 4b11ab107..e838f6865 100644 --- a/src/components/middle/ReactorListModal.tsx +++ b/src/components/middle/ReactorListModal.tsx @@ -26,6 +26,7 @@ import useInfiniteScroll from '../../hooks/useInfiniteScroll'; import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useOldLang from '../../hooks/useOldLang'; +import useScrollNotch from '../../hooks/useScrollNotch'; import Avatar from '../common/Avatar'; import FullNameTitle from '../common/FullNameTitle'; @@ -37,6 +38,7 @@ import InfiniteScroll from '../ui/InfiniteScroll'; import ListItem from '../ui/ListItem'; import Loading from '../ui/Loading'; import Modal from '../ui/Modal'; +import Transition from '../ui/Transition'; import './ReactorListModal.scss'; @@ -81,6 +83,7 @@ const ReactorListModal: FC = ({ && reactions.results.length > 1; const chatIdRef = useRef(); const reactionsRef = useRef(); + const containerRef = useRef(); useHorizontalScroll(reactionsRef, !canShowFilters || !isOpen); @@ -128,6 +131,12 @@ const ReactorListModal: FC = ({ return uniqueReactions; }, [reactors]); + const contentActiveKey = useMemo(() => { + if (!chosenTab) return 0; + const index = allReactions.findIndex((r) => isSameReaction(r, chosenTab)); + return index + 1; + }, [chosenTab, allReactions]); + const peerIds = useMemo(() => { if (chosenTab) { return reactors?.reactions @@ -144,6 +153,11 @@ const ReactorListModal: FC = ({ handleLoadMore, peerIds, reactors && reactors.nextOffset === undefined, ); + useScrollNotch({ + containerRef, + selector: '.reactor-list', + }, [contentActiveKey, isOpen]); + useEffect(() => { getMore?.({ direction: LoadMoreDirection.Backwards }); }, [getMore]); @@ -200,74 +214,80 @@ const ReactorListModal: FC = ({ )} -
- {viewportIds?.length ? ( - - {viewportIds?.flatMap( - (peerId) => { - const peer = usersById[peerId] || chatsById[peerId]; +
+ + {viewportIds?.length ? ( + + {viewportIds?.flatMap( + (peerId) => { + const peer = usersById[peerId] || chatsById[peerId]; - const peerReactions = reactors?.reactions.filter((reactor) => reactor.peerId === peerId); - const items: React.ReactNode[] = []; - const seenByUser = seenByDates?.[peerId]; + const peerReactions = reactors?.reactions.filter((reactor) => reactor.peerId === peerId); + const items: React.ReactNode[] = []; + const seenByUser = seenByDates?.[peerId]; - peerReactions?.forEach((r) => { - if (chosenTab && !isSameReaction(r.reaction, chosenTab)) return; + peerReactions?.forEach((r) => { + if (chosenTab && !isSameReaction(r.reaction, chosenTab)) return; - items.push( - handleClick(peerId)} - > - -
- - - - {formatDateAtTime(oldLang, r.addedDate * 1000)} - -
- {r.reaction && ( - handleClick(peerId)} + > + +
+ + + + {formatDateAtTime(oldLang, r.addedDate * 1000)} + +
+ {r.reaction && ( + + )} +
, + ); + }); + + if (!chosenTab && !peerReactions?.length) { + items.push( + handleClick(peerId)} + > + - )} - , - ); - }); - - if (!chosenTab && !peerReactions?.length) { - items.push( - handleClick(peerId)} - > - - , - ); - } - return items; - }, - )} -
- ) : } + , + ); + } + return items; + }, + )} + + ) : } +
); diff --git a/src/styles/_variables.scss b/src/styles/_variables.scss index 82919118a..7173e35f6 100644 --- a/src/styles/_variables.scss +++ b/src/styles/_variables.scss @@ -268,6 +268,7 @@ $color-message-story-mention-to: #74bcff; --z-left-header: 11; --z-middle-header: 11; --z-middle-footer: 11; + --z-scroll-notch: 10; --z-story-ribbon: 10; --z-country-code-input-group: 10; --z-message-select-control: 9; diff --git a/src/styles/index.scss b/src/styles/index.scss index bfe489936..574473782 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -376,7 +376,7 @@ body:not(.is-ios) { content: ""; position: absolute; - z-index: 1; + z-index: var(--z-scroll-notch); top: 0; left: 0;