diff --git a/web/navigation-panels/chat-thread-ancestors.css b/web/navigation-panels/chat-thread-ancestors.css --- a/web/navigation-panels/chat-thread-ancestors.css +++ b/web/navigation-panels/chat-thread-ancestors.css @@ -1,51 +1,48 @@ -div.ancestorThreadsContainer { +.container { font-size: var(--xs-font-12); display: flex; align-items: center; - column-gap: 5px; + column-gap: 12px; + overflow: hidden; } -div.ancestorName { - display: flex; - align-items: center; - padding: 2px 6px; - border-radius: 2px; - box-sizing: border-box; - line-height: 1.5; -} - -button.seeFullStructure { - background-color: transparent; - border: none; - cursor: pointer; +.communityName { + color: var(--thread-ancestor-color); + font-size: var(--l-font-18); + font-weight: var(--semi-bold); + white-space: nowrap; } -div.ancestorKeyserver { +.ancestorThreadsContainer { + border: 1px solid var(--topbar-lines); + border-radius: 8px; display: flex; - align-items: center; + padding: 7px 12px; + margin-right: 16px; + overflow: hidden; } -div.ancestorKeyserverName { - border-radius: 0 2px 2px 0; +.ancestorName { + color: var(--thread-ancestor-color); + font-size: var(--xs-font-12); + font-weight: var(--semi-bold); + line-height: 1.5; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + flex-shrink: 1; } -svg.ancestorSeparator { - color: var(--thread-ancestor-separator-color); +.chatName { + flex-shrink: 0.5; } -div.ancestorKeyserverOperator { - display: flex; - column-gap: 5px; - padding: 0 5px; - align-items: center; - border: 1px solid var(--thread-ancestor-keyserver-border); - border-radius: 2px 0 0 2px; - height: 22px; - box-sizing: border-box; +svg.chevronRight { + color: var(--thread-ancestor-separator-color); + flex-shrink: 0; } -button.seeFullAncestor { - font-size: var(--xs-font-12); - font-weight: var(--semi-bold); - cursor: pointer; +svg.ancestorSeparator { + align-self: center; + padding: 0 8px; } diff --git a/web/navigation-panels/chat-thread-ancestors.react.js b/web/navigation-panels/chat-thread-ancestors.react.js --- a/web/navigation-panels/chat-thread-ancestors.react.js +++ b/web/navigation-panels/chat-thread-ancestors.react.js @@ -1,126 +1,71 @@ // @flow -import classNames from 'classnames'; +import classnames from 'classnames'; import * as React from 'react'; +import { ChevronRight } from 'react-feather'; -import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { useAncestorThreads } from 'lib/shared/ancestor-threads.js'; -import { colorIsDark } from 'lib/shared/thread-utils.js'; -import { useKeyserverAdmin } from 'lib/shared/user-utils.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; import css from './chat-thread-ancestors.css'; -import CommIcon from '../CommIcon.react.js'; - -const SHOW_SEE_FULL_STRUCTURE = false; type ThreadAncestorsProps = { +threadInfo: ThreadInfo, }; function ThreadAncestors(props: ThreadAncestorsProps): React.Node { const { threadInfo } = props; - const { color: threadColor } = threadInfo; - const darkColor = colorIsDark(threadColor); - const threadColorStyle = React.useMemo( - () => ({ - backgroundColor: `#${threadColor}`, - color: darkColor - ? 'var(--thread-ancestor-color-light)' - : 'var(--thread-ancestor-color-dark)', - }), - [darkColor, threadColor], - ); - const fullStructureButtonColorStyle = React.useMemo( - () => ({ color: `#${threadColor}` }), - [threadColor], - ); - const ancestorThreads = useAncestorThreads(threadInfo); - - const community = ancestorThreads[0] ?? threadInfo; - const keyserverAdmin = useKeyserverAdmin(community); - const keyserverOwnerUsername = keyserverAdmin?.username; + const ancestorThreadsWithCommunity = useAncestorThreads(threadInfo); + const community = ancestorThreadsWithCommunity[0] ?? threadInfo; const resolvedCommunity = useResolvedThreadInfo(community); - const keyserverInfo = React.useMemo( - () => ( -
{uiName}