diff --git a/web/chat/sidebar-modal-item.css b/web/chat/sidebar-modal-item.css new file mode 100644 --- /dev/null +++ b/web/chat/sidebar-modal-item.css @@ -0,0 +1,33 @@ +div.sidebar { + display: flex; + align-items: center; + position: relative; +} + +div.sidebarName { + font-size: var(--l-font-18); + color: var(--sidebar-modal-color); + padding-left: 36px; + padding-top: 2px; + padding-bottom: 2px; +} + +.unread { + color: var(--fg); +} + +.longArrow { + position: absolute; + bottom: 100px; +} + +.arrow { + position: absolute; + bottom: 6px; +} + +ul.sidebarList { + padding-top: 16px; + padding-left: 16px; + list-style: none; +} diff --git a/web/chat/sidebar-modal-item.react.js b/web/chat/sidebar-modal-item.react.js new file mode 100644 --- /dev/null +++ b/web/chat/sidebar-modal-item.react.js @@ -0,0 +1,54 @@ +// @flow + +import classNames from 'classnames'; +import * as React from 'react'; + +import type { SidebarInfo } from 'lib/types/thread-types'; + +import { useOnClickThread } from '../selectors/nav-selectors'; +import css from './sidebar-modal-item.css'; + +type Props = { + +sidebar: SidebarInfo, + +extendArrow?: boolean, +}; + +function SideBarModalItem(props: Props): React.Node { + const { + sidebar: { threadInfo }, + extendArrow = false, + } = props; + const { + currentUser: { unread }, + uiName, + } = threadInfo; + + const onClick = useOnClickThread(threadInfo); + + const sideBarTextCls = classNames(css.sidebarName, { [css.unread]: unread }); + let arrow; + if (extendArrow) { + arrow = ( + + ); + } else { + arrow = ( + + ); + } + + return ( +