Changeset View
Changeset View
Standalone View
Standalone View
web/modals/chat/sidebar-list-modal.react.js
Show All 16 Lines | type SidebarModalContentProps = { | ||||
+threadInfo: ThreadInfo, | +threadInfo: ThreadInfo, | ||||
+onClose: () => void, | +onClose: () => void, | ||||
+searchText: string, | +searchText: string, | ||||
}; | }; | ||||
function SidebarModalContent(props: SidebarModalContentProps): React.Node { | function SidebarModalContent(props: SidebarModalContentProps): React.Node { | ||||
const { threadInfo, searchText } = props; | const { threadInfo, searchText } = props; | ||||
const { popModal } = useModalContext(); | const { popModal } = useModalContext(); | ||||
const { listData } = useSearchSidebars(threadInfo, searchText); | const { sidebars } = useSearchSidebars(threadInfo, searchText); | ||||
return ( | return ( | ||||
<ul> | <ul> | ||||
{listData.map(item => ( | {sidebars.map(sideBar => ( | ||||
<li key={item.threadInfo.id} onClick={popModal}> | <li key={sideBar.threadInfo.id} onClick={popModal}> | ||||
<SidebarItem sidebarInfo={item} /> | <SidebarItem sidebarInfo={sideBar} /> | ||||
</li> | </li> | ||||
))} | ))} | ||||
</ul> | </ul> | ||||
); | ); | ||||
} | } | ||||
function SidebarListModal(props: Props): React.Node { | function SidebarListModal(props: Props): React.Node { | ||||
const { popModal } = useModalContext(); | const { popModal } = useModalContext(); | ||||
Show All 26 Lines |