diff --git a/web/modals/threads/sidebars/sidebars-modal.css b/web/modals/threads/sidebars/sidebars-modal.css index 8744e7b95..99766e71f 100644 --- a/web/modals/threads/sidebars/sidebars-modal.css +++ b/web/modals/threads/sidebars/sidebars-modal.css @@ -1,83 +1,82 @@ div.sidebarListContainer { display: flex; flex-direction: column; line-height: var(--line-height-text); - width: 383px; - height: 458px; + height: 80vh; } div.sidebarList { overflow: auto; color: var(--sidebars-modal-color); } div.noSidebars { padding: 16px; text-align: center; color: var(--sidebars-modal-color); } button.sidebarContainer { padding: 0 16px; column-gap: 8px; align-items: flex-start; width: 100%; font-size: inherit; text-align: inherit; line-height: inherit; color: inherit; background: inherit; } button.sidebarContainer:hover { color: var(--sidebars-modal-color-hover); } div.sidebarInfo { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 8px 0; } div.avatarContainer { display: flex; align-items: center; gap: 8px; } div.avatarOffset { margin-left: 24px; } div.longTextEllipsis { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } div.lastMessage { display: flex; justify-content: space-between; column-gap: 14px; } div.noMessage { text-align: center; font-style: italic; } div.lastActivity { white-space: nowrap; } div.unread { color: var(--fg); font-weight: var(--semi-bold); } img.sidebarArrow { position: relative; top: -12px; } diff --git a/web/modals/threads/sidebars/sidebars-modal.react.js b/web/modals/threads/sidebars/sidebars-modal.react.js index 90668315d..5a63a0fa1 100644 --- a/web/modals/threads/sidebars/sidebars-modal.react.js +++ b/web/modals/threads/sidebars/sidebars-modal.react.js @@ -1,103 +1,103 @@ // @flow import * as React from 'react'; import { useFilteredChildThreads } from 'lib/hooks/child-threads.js'; import { threadInChatList, threadIsSidebar } from 'lib/shared/thread-utils.js'; import SidebarList from './sidebar-list.react.js'; import css from './sidebars-modal.css'; import Tabs, { type TabData } from '../../../components/tabs.react.js'; import SearchModal from '../../search-modal.react.js'; type SidebarTab = 'All Threads' | 'My Threads'; const tabsData: $ReadOnlyArray> = [ { id: 'All Threads', header: 'All Threads', }, { id: 'My Threads', header: 'My Threads', }, ]; type ContentProps = { +searchText: string, +threadID: string, +defaultTab: SidebarTab, }; function SidebarsModalContent(props: ContentProps): React.Node { const { searchText, threadID, defaultTab } = props; const [tab, setTab] = React.useState(defaultTab); const tabs = React.useMemo( () => , [tab], ); const sidebarList = useFilteredChildThreads(threadID, { predicate: threadIsSidebar, searchText, }); const tabContent = React.useMemo(() => { if (tab === 'All Threads') { return ; } const sidebarsChatListVisibleInChat = sidebarList.filter(chatItem => threadInChatList(chatItem.threadInfo), ); return ; }, [sidebarList, tab]); const sidebarsModalContent = React.useMemo( () => (
{tabs} {tabContent}
), [tabContent, tabs], ); return sidebarsModalContent; } type Props = { +threadID: string, +onClose: () => void, +defaultTab?: SidebarTab, }; function SidebarsModal(props: Props): React.Node { const { threadID, onClose, defaultTab = 'All Threads' } = props; const sidebarsContent = React.useCallback( (searchText: string) => ( ), [defaultTab, threadID], ); return ( {sidebarsContent} ); } export default SidebarsModal;