Changeset View
Changeset View
Standalone View
Standalone View
web/sidebar/community-drawer-item.react.js
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | const [handler, setHandler] = React.useState({ | ||||
// eslint-disable-next-line no-unused-vars | // eslint-disable-next-line no-unused-vars | ||||
onClick: event => {}, | onClick: event => {}, | ||||
}); | }); | ||||
const { uiName } = useResolvedThreadInfo(threadInfo); | const { uiName } = useResolvedThreadInfo(threadInfo); | ||||
const titleLabel = classnames(css.title, css[labelStyle]); | const titleLabel = classnames(css.title, css[labelStyle]); | ||||
const style = React.useMemo(() => ({ paddingLeft }), [paddingLeft]); | const style = React.useMemo(() => ({ paddingLeft }), [paddingLeft]); | ||||
const threadEntry = classnames({ | |||||
[css.threadEntry]: true, | |||||
[css.active]: handler.isActive, | |||||
}); | |||||
return ( | return ( | ||||
<> | <> | ||||
<Handler setHandler={setHandler} threadInfo={threadInfo} /> | <Handler setHandler={setHandler} threadInfo={threadInfo} /> | ||||
<div className={css.threadEntry} style={style}> | <div className={threadEntry} style={style}> | ||||
{itemExpandButton} | {itemExpandButton} | ||||
<a onClick={handler.onClick} className={css.titleWrapper}> | <a onClick={handler.onClick} className={css.titleWrapper}> | ||||
<div className={titleLabel}>{uiName}</div> | <div className={titleLabel}>{uiName}</div> | ||||
</a> | </a> | ||||
</div> | </div> | ||||
<div className={css.threadListContainer}>{children}</div> | <div className={css.threadListContainer}>{children}</div> | ||||
</> | </> | ||||
); | ); | ||||
Show All 35 Lines |