Changeset View
Changeset View
Standalone View
Standalone View
web/sidebar/community-drawer.react.js
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | function CommunityDrawer(): React.Node { | ||||
const communitiesComponents = React.useMemo( | const communitiesComponents = React.useMemo( | ||||
() => | () => | ||||
drawerItemsData.map(item => ( | drawerItemsData.map(item => ( | ||||
<CommunityDrawerItemCommunity | <CommunityDrawerItemCommunity | ||||
itemData={item} | itemData={item} | ||||
key={item.threadInfo.id} | key={item.threadInfo.id} | ||||
toggleExpanded={setOpenCommunityOrClose} | toggleExpanded={setOpenCommunityOrClose} | ||||
expanded={item.threadInfo.id === openCommunity} | expanded={item.threadInfo.id === openCommunity} | ||||
paddingLeft={10} | |||||
/> | /> | ||||
)), | )), | ||||
[drawerItemsData, openCommunity, setOpenCommunityOrClose], | [drawerItemsData, openCommunity, setOpenCommunityOrClose], | ||||
); | ); | ||||
return ( | return ( | ||||
<ThreadListProvider> | <ThreadListProvider> | ||||
<div className={css.container}>{communitiesComponents}</div> | <div className={css.container}>{communitiesComponents}</div> | ||||
</ThreadListProvider> | </ThreadListProvider> | ||||
); | ); | ||||
} | } | ||||
export default CommunityDrawer; | export default CommunityDrawer; |