Changeset View
Changeset View
Standalone View
Standalone View
web/sidebar/community-drawer-item.react.js
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | function CommunityDrawerItem(props: DrawerItemProps): React.Node { | ||||
const { uiName } = useResolvedThreadInfo(threadInfo); | const { uiName } = useResolvedThreadInfo(threadInfo); | ||||
const titleLabel = classnames({ | const titleLabel = classnames({ | ||||
[css[labelStyle]]: true, | [css[labelStyle]]: true, | ||||
[css.activeTitle]: handler.isActive, | [css.activeTitle]: handler.isActive, | ||||
}); | }); | ||||
const style = React.useMemo(() => ({ paddingLeft }), [paddingLeft]); | const style = React.useMemo(() => ({ paddingLeft }), [paddingLeft]); | ||||
const threadEntry = classnames({ | |||||
[css.threadEntry]: true, | |||||
[css.active]: handler.isActive, | |||||
}); | |||||
const titleStyle = React.useMemo( | const titleStyle = React.useMemo( | ||||
() => ({ | () => ({ | ||||
marginLeft: shouldRenderAvatars ? 8 : 0, | marginLeft: shouldRenderAvatars ? 8 : 0, | ||||
}), | }), | ||||
[], | [], | ||||
); | ); | ||||
return ( | return ( | ||||
<> | <> | ||||
<Handler setHandler={setHandler} threadInfo={threadInfo} /> | <Handler setHandler={setHandler} threadInfo={threadInfo} /> | ||||
<div className={threadEntry} style={style}> | <div className={css.threadEntry} style={style}> | ||||
{itemExpandButton} | {itemExpandButton} | ||||
<a onClick={handler.onClick} className={css.titleWrapper}> | <a onClick={handler.onClick} className={css.titleWrapper}> | ||||
<ThreadAvatar size="micro" threadInfo={threadInfo} /> | <ThreadAvatar size="micro" threadInfo={threadInfo} /> | ||||
<div className={titleLabel} style={titleStyle}> | <div className={titleLabel} style={titleStyle}> | ||||
{uiName} | {uiName} | ||||
</div> | </div> | ||||
</a> | </a> | ||||
</div> | </div> | ||||
Show All 16 Lines |