diff --git a/web/chat/chat-message-list.css b/web/chat/chat-message-list.css --- a/web/chat/chat-message-list.css +++ b/web/chat/chat-message-list.css @@ -84,13 +84,8 @@ span.authorName { color: #777777; font-size: 14px; -} -span.authorNamePositionAvatar { padding: 4px 56px; } -span.authorNamePositionNoAvatar { - padding: 4px 24px; -} div.darkTextMessage { color: white; @@ -128,13 +123,8 @@ position: relative; display: flex; max-width: calc(min(68%, 1000px)); -} -div.messageBoxContainerPositionAvatar { margin: 0 4px; } -div.messageBoxContainerPositionNoAvatar { - margin: 0 4px 0 12px; -} div.fixedWidthMessageBoxContainer { width: 68%; diff --git a/web/chat/chat-thread-composer.react.js b/web/chat/chat-thread-composer.react.js --- a/web/chat/chat-thread-composer.react.js +++ b/web/chat/chat-thread-composer.react.js @@ -18,7 +18,6 @@ import type { InputState } from '../input/input-state.js'; import { updateNavInfoActionType } from '../redux/action-types.js'; import { useSelector } from '../redux/redux-utils.js'; -import { shouldRenderAvatars } from '../utils/avatar-utils.js'; type Props = { +userInfoInputArray: $ReadOnlyArray, @@ -86,13 +85,6 @@ [dispatch, userInfoInputArray], ); - const usernameStyle = React.useMemo( - () => ({ - marginLeft: shouldRenderAvatars ? 8 : 0, - }), - [], - ); - const userSearchResultList = React.useMemo(() => { if ( !userListItemsWithENSNames.length || @@ -111,9 +103,7 @@ >
-
- {userSearchResult.username} -
+
{userSearchResult.username}
{userSearchResult.alertTitle}
@@ -127,7 +117,6 @@ userInfoInputArray.length, userListItemsWithENSNames, usernameInputText, - usernameStyle, ]); const hideSearch = React.useCallback( diff --git a/web/chat/chat-thread-list-item.react.js b/web/chat/chat-thread-list-item.react.js --- a/web/chat/chat-thread-list-item.react.js +++ b/web/chat/chat-thread-list-item.react.js @@ -23,7 +23,6 @@ useOnClickThread, useThreadIsActive, } from '../selectors/thread-selectors.js'; -import { shouldRenderAvatars } from '../utils/avatar-utils.js'; type Props = { +item: ChatThreadItem, @@ -84,12 +83,6 @@ unreadDot =
; } - const { color } = item.threadInfo; - const colorSplotchStyle = React.useMemo( - () => ({ backgroundColor: `#${color}` }), - [color], - ); - const sidebars = item.sidebars.map((sidebarItem, index) => { if (sidebarItem.type === 'sidebar') { const { type, ...sidebarInfo } = sidebarItem; @@ -131,20 +124,13 @@ const { uiName } = useResolvedThreadInfo(threadInfo); - const avatar = React.useMemo(() => { - if (!shouldRenderAvatars) { - return
; - } - return ; - }, [colorSplotchStyle, threadInfo]); - return ( <>
-
+
{unreadDot}
- {avatar} +
diff --git a/web/chat/chat-thread-list.css b/web/chat/chat-thread-list.css --- a/web/chat/chat-thread-list.css +++ b/web/chat/chat-thread-list.css @@ -89,12 +89,11 @@ padding-top: 8px; } -div.spacer, -div.colorSplotch { +div.spacer { width: 42px; border-radius: 1.68px; } -div.colorSplotchContainer { +div.avatarContainer { height: 42px; display: flex; } diff --git a/web/chat/composed-message.react.js b/web/chat/composed-message.react.js --- a/web/chat/composed-message.react.js +++ b/web/chat/composed-message.react.js @@ -20,7 +20,6 @@ import CommIcon from '../CommIcon.react.js'; import UserAvatar from '../components/user-avatar.react.js'; import { type InputState, InputStateContext } from '../input/input-state.js'; -import { shouldRenderAvatars } from '../utils/avatar-utils.js'; import { useMessageTooltip } from '../utils/tooltip-action-utils.js'; import { tooltipPositions } from '../utils/tooltip-utils.js'; @@ -86,8 +85,6 @@ const messageBoxContainerClassName = classNames({ [css.messageBoxContainer]: true, [css.fixedWidthMessageBoxContainer]: this.props.fixedWidth, - [css.messageBoxContainerPositionAvatar]: shouldRenderAvatars, - [css.messageBoxContainerPositionNoAvatar]: !shouldRenderAvatars, }); const messageBoxClassName = classNames({ [css.messageBox]: true, @@ -102,13 +99,8 @@ let authorName = null; const { stringForUser } = this.props; - const authorNameClassName = classNames({ - [css.authorName]: true, - [css.authorNamePositionAvatar]: shouldRenderAvatars, - [css.authorNamePositionNoAvatar]: !shouldRenderAvatars, - }); if (stringForUser) { - authorName = {stringForUser}; + authorName = {stringForUser}; } let deliveryIcon = null; @@ -156,13 +148,13 @@ } let avatar; - if (!isViewer && item.endsCluster && shouldRenderAvatars) { + if (!isViewer && item.endsCluster) { avatar = (
); - } else if (!isViewer && shouldRenderAvatars) { + } else if (!isViewer) { avatar =
; } diff --git a/web/chat/inline-engagement.css b/web/chat/inline-engagement.css --- a/web/chat/inline-engagement.css +++ b/web/chat/inline-engagement.css @@ -21,11 +21,6 @@ margin-left: 31px; } -div.leftContainerNoAvatar { - left: 12px; - margin-right: 12px; -} - a.threadsContainer, a.threadsSplitContainer, a.reactionsContainer, diff --git a/web/chat/inline-engagement.react.js b/web/chat/inline-engagement.react.js --- a/web/chat/inline-engagement.react.js +++ b/web/chat/inline-engagement.react.js @@ -13,7 +13,6 @@ import CommIcon from '../CommIcon.react.js'; import MessageReactionsModal from '../modals/chat/message-reactions-modal.react.js'; import { useOnClickThread } from '../selectors/thread-selectors.js'; -import { shouldRenderAvatars } from '../utils/avatar-utils.js'; type Props = { +threadInfo: ?ThreadInfo, @@ -32,8 +31,6 @@ [css.leftContainer]: positioning === 'left', [css.centerContainer]: positioning === 'center', [css.rightContainer]: positioning === 'right', - [css.leftContainerNoAvatar]: - positioning === 'left' && !shouldRenderAvatars, }, ]); diff --git a/web/chat/thread-top-bar.css b/web/chat/thread-top-bar.css --- a/web/chat/thread-top-bar.css +++ b/web/chat/thread-top-bar.css @@ -16,13 +16,6 @@ overflow: hidden; } -div.threadColorSquare { - width: 24px; - height: 24px; - border-radius: 4px; - flex: 0 0 auto; -} - .threadTitle { font-size: var(--m-font-16); font-weight: var(--bold); diff --git a/web/chat/thread-top-bar.react.js b/web/chat/thread-top-bar.react.js --- a/web/chat/thread-top-bar.react.js +++ b/web/chat/thread-top-bar.react.js @@ -13,7 +13,6 @@ import ThreadAvatar from '../components/thread-avatar.react.js'; import { InputStateContext } from '../input/input-state.js'; import MessageResultsModal from '../modals/chat/message-results-modal.react.js'; -import { shouldRenderAvatars } from '../utils/avatar-utils.js'; type ThreadTopBarProps = { +threadInfo: ThreadInfo, @@ -21,12 +20,6 @@ function ThreadTopBar(props: ThreadTopBarProps): React.Node { const { threadInfo } = props; const { pushModal } = useModalContext(); - const threadBackgroundColorStyle = React.useMemo( - () => ({ - background: `#${threadInfo.color}`, - }), - [threadInfo.color], - ); let threadMenu = null; if (!threadIsPending(threadInfo.id)) { @@ -72,23 +65,11 @@ const { uiName } = useResolvedThreadInfo(threadInfo); - const avatar = React.useMemo(() => { - if (!shouldRenderAvatars) { - return ( -
- ); - } - return ; - }, [threadBackgroundColorStyle, threadInfo]); - return ( <>
- {avatar} +
{uiName}
{threadMenu} diff --git a/web/chat/typeahead-tooltip.css b/web/chat/typeahead-tooltip.css --- a/web/chat/typeahead-tooltip.css +++ b/web/chat/typeahead-tooltip.css @@ -69,7 +69,3 @@ span.username { margin-left: 8px; } - -span.usernameNoAvatar { - margin-left: 0; -} diff --git a/web/components/avatar.react.js b/web/components/avatar.react.js --- a/web/components/avatar.react.js +++ b/web/components/avatar.react.js @@ -6,7 +6,6 @@ import type { ResolvedClientAvatar } from 'lib/types/avatar-types'; import css from './avatar.css'; -import { shouldRenderAvatars } from '../utils/avatar-utils.js'; type Props = { +avatarInfo: ResolvedClientAvatar, @@ -64,7 +63,7 @@ emojiSizeClassName, ]); - return shouldRenderAvatars ? avatar : null; + return avatar; } export default Avatar; diff --git a/web/modals/chat/message-reactions-modal.react.js b/web/modals/chat/message-reactions-modal.react.js --- a/web/modals/chat/message-reactions-modal.react.js +++ b/web/modals/chat/message-reactions-modal.react.js @@ -7,7 +7,6 @@ import css from './message-reactions-modal.css'; import UserAvatar from '../../components/user-avatar.react.js'; -import { shouldRenderAvatars } from '../../utils/avatar-utils.js'; import Modal from '../modal.react.js'; type Props = { @@ -20,27 +19,18 @@ const messageReactionsList = useMessageReactionsList(reactions); - const usernameStyle = React.useMemo( - () => ({ - marginLeft: shouldRenderAvatars ? 8 : 0, - }), - [], - ); - const reactionsList = React.useMemo( () => messageReactionsList.map(messageReactionUser => (
-
- {messageReactionUser.username} -
+
{messageReactionUser.username}
{messageReactionUser.reaction}
)), - [messageReactionsList, usernameStyle], + [messageReactionsList], ); return ( diff --git a/web/modals/components/add-members-item.react.js b/web/modals/components/add-members-item.react.js --- a/web/modals/components/add-members-item.react.js +++ b/web/modals/components/add-members-item.react.js @@ -7,7 +7,6 @@ import css from './add-members.css'; import Button from '../../components/button.react.js'; import UserAvatar from '../../components/user-avatar.react.js'; -import { shouldRenderAvatars } from '../../utils/avatar-utils.js'; type AddMembersItemProps = { +userInfo: UserListItem, @@ -38,13 +37,6 @@ } }, [canBeAdded, userAdded, userInfo.alertTitle]); - const usernameStyle = React.useMemo( - () => ({ - marginLeft: shouldRenderAvatars ? 8 : 0, - }), - [], - ); - return ( diff --git a/web/modals/threads/sidebars/sidebar.react.js b/web/modals/threads/sidebars/sidebar.react.js --- a/web/modals/threads/sidebars/sidebar.react.js +++ b/web/modals/threads/sidebars/sidebar.react.js @@ -14,7 +14,6 @@ import ThreadAvatar from '../../../components/thread-avatar.react.js'; import { getDefaultTextMessageRules } from '../../../markdown/rules.react.js'; import { useOnClickThread } from '../../../selectors/thread-selectors.js'; -import { shouldRenderAvatars } from '../../../utils/avatar-utils.js'; type Props = { +sidebar: ChatThreadItem, @@ -43,10 +42,10 @@ [css.unread]: unread, }); - const previewTextClassName = classNames({ - [css.longTextEllipsis]: true, - [css.avatarOffset]: shouldRenderAvatars, - }); + const previewTextClassName = classNames([ + css.longTextEllipsis, + css.avatarOffset, + ]); const lastActivity = React.useMemo( () => shortAbsoluteDate(lastUpdatedTime), diff --git a/web/modals/threads/subchannels/subchannel.react.js b/web/modals/threads/subchannels/subchannel.react.js --- a/web/modals/threads/subchannels/subchannel.react.js +++ b/web/modals/threads/subchannels/subchannel.react.js @@ -4,7 +4,6 @@ import * as React from 'react'; import { useModalContext } from 'lib/components/modal-provider.react.js'; -import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { type ChatThreadItem } from 'lib/selectors/chat-selectors.js'; import { useMessagePreview } from 'lib/shared/message-utils.js'; import { shortAbsoluteDate } from 'lib/utils/date-utils.js'; @@ -15,7 +14,6 @@ import ThreadAvatar from '../../../components/thread-avatar.react.js'; import { getDefaultTextMessageRules } from '../../../markdown/rules.react.js'; import { useOnClickThread } from '../../../selectors/thread-selectors.js'; -import { shouldRenderAvatars } from '../../../utils/avatar-utils.js'; type Props = { +chatThreadItem: ChatThreadItem, @@ -77,16 +75,9 @@ const { uiName } = useResolvedThreadInfo(threadInfo); - const avatar = React.useMemo(() => { - if (!shouldRenderAvatars) { - return ; - } - return ; - }, [threadInfo]); - return (
diff --git a/web/navigation-panels/nav-state-info-bar.css b/web/navigation-panels/nav-state-info-bar.css --- a/web/navigation-panels/nav-state-info-bar.css +++ b/web/navigation-panels/nav-state-info-bar.css @@ -7,14 +7,6 @@ overflow: hidden; } -div.threadColorSquare { - width: 24px; - height: 24px; - border-radius: 4px; - flex: 0 0 auto; - margin: 0 12px 0 16px; -} - div.avatarContainer { margin: 0 12px 0 16px; } diff --git a/web/navigation-panels/nav-state-info-bar.react.js b/web/navigation-panels/nav-state-info-bar.react.js --- a/web/navigation-panels/nav-state-info-bar.react.js +++ b/web/navigation-panels/nav-state-info-bar.react.js @@ -8,7 +8,6 @@ import ThreadAncestors from './chat-thread-ancestors.react.js'; import css from './nav-state-info-bar.css'; import ThreadAvatar from '../components/thread-avatar.react.js'; -import { shouldRenderAvatars } from '../utils/avatar-utils.js'; type NavStateInfoBarProps = { +threadInfo: ThreadInfo, @@ -16,32 +15,11 @@ function NavStateInfoBar(props: NavStateInfoBarProps): React.Node { const { threadInfo } = props; - const threadBackgroundColorStyle = React.useMemo( - () => ({ - background: `#${threadInfo.color}`, - }), - [threadInfo.color], - ); - - const avatar = React.useMemo(() => { - if (!shouldRenderAvatars) { - return ( -
- ); - } - return ( + return ( + <>
- ); - }, [threadBackgroundColorStyle, threadInfo]); - - return ( - <> - {avatar} ); diff --git a/web/settings/account-settings.react.js b/web/settings/account-settings.react.js --- a/web/settings/account-settings.react.js +++ b/web/settings/account-settings.react.js @@ -20,7 +20,6 @@ import Button from '../components/button.react.js'; import UserAvatar from '../components/user-avatar.react.js'; import { useSelector } from '../redux/redux-utils.js'; -import { shouldRenderAvatars } from '../utils/avatar-utils.js'; function AccountSettings(): React.Node { const sendLogoutRequest = useServerCall(logOut); @@ -58,13 +57,6 @@ const currentUserInfo = useSelector(state => state.currentUserInfo); const stringForUser = useStringForUser(currentUserInfo); - const contentStyle = React.useMemo( - () => ({ - marginTop: shouldRenderAvatars ? 32 : 0, - }), - [], - ); - if (!currentUserInfo || currentUserInfo.anonymous) { return null; } @@ -88,7 +80,7 @@

My Account

-
+
  • diff --git a/web/settings/relationship/block-list-row.react.js b/web/settings/relationship/block-list-row.react.js --- a/web/settings/relationship/block-list-row.react.js +++ b/web/settings/relationship/block-list-row.react.js @@ -10,27 +10,17 @@ import MenuItem from '../../components/menu-item.react.js'; import Menu from '../../components/menu.react.js'; import UserAvatar from '../../components/user-avatar.react.js'; -import { shouldRenderAvatars } from '../../utils/avatar-utils.js'; function BlockListRow(props: UserRowProps): React.Node { const { userInfo, onMenuVisibilityChange } = props; const { unblockUser } = useRelationshipCallbacks(userInfo.id); const editIcon = ; - const usernameContainerStyle = React.useMemo( - () => ({ - marginLeft: shouldRenderAvatars ? 8 : 0, - }), - [], - ); - return (

    -
    - {userInfo.username} -
    +
    {userInfo.username}
    diff --git a/web/settings/relationship/friend-list-row.react.js b/web/settings/relationship/friend-list-row.react.js --- a/web/settings/relationship/friend-list-row.react.js +++ b/web/settings/relationship/friend-list-row.react.js @@ -12,7 +12,6 @@ import MenuItem from '../../components/menu-item.react.js'; import Menu from '../../components/menu.react.js'; import UserAvatar from '../../components/user-avatar.react.js'; -import { shouldRenderAvatars } from '../../utils/avatar-utils.js'; const dangerButtonColor = { color: 'var(--btn-bg-danger)', @@ -80,20 +79,11 @@ onMenuVisibilityChange, ]); - const usernameContainerStyle = React.useMemo( - () => ({ - marginLeft: shouldRenderAvatars ? 8 : 0, - }), - [], - ); - return (
    -
    - {userInfo.username} -
    +
    {userInfo.username}
    {buttons}
    diff --git a/web/sidebar/community-drawer-item.react.js b/web/sidebar/community-drawer-item.react.js --- a/web/sidebar/community-drawer-item.react.js +++ b/web/sidebar/community-drawer-item.react.js @@ -15,7 +15,6 @@ } from './community-drawer-utils.react.js'; import ThreadAvatar from '../components/thread-avatar.react.js'; import type { NavigationTab } from '../types/nav-types.js'; -import { shouldRenderAvatars } from '../utils/avatar-utils.js'; export type DrawerItemProps = { +itemData: CommunityDrawerItemData, @@ -89,13 +88,6 @@ const style = React.useMemo(() => ({ paddingLeft }), [paddingLeft]); - const titleStyle = React.useMemo( - () => ({ - marginLeft: shouldRenderAvatars ? 8 : 0, - }), - [], - ); - return ( <> @@ -103,9 +95,7 @@ {itemExpandButton} -
    - {uiName} -
    +
    {uiName}
    {children}
    diff --git a/web/utils/avatar-utils.js b/web/utils/avatar-utils.js deleted file mode 100644 --- a/web/utils/avatar-utils.js +++ /dev/null @@ -1,5 +0,0 @@ -// @flow - -const shouldRenderAvatars: boolean = true; - -export { shouldRenderAvatars }; diff --git a/web/utils/typeahead-utils.js b/web/utils/typeahead-utils.js --- a/web/utils/typeahead-utils.js +++ b/web/utils/typeahead-utils.js @@ -9,7 +9,6 @@ import type { SetState } from 'lib/types/hook-types.js'; import type { RelativeMemberInfo } from 'lib/types/thread-types.js'; -import { shouldRenderAvatars } from './avatar-utils.js'; import { typeaheadStyle } from '../chat/chat-constants.js'; import css from '../chat/typeahead-tooltip.css'; import Button from '../components/button.react.js'; @@ -138,11 +137,6 @@ setChosenPositionInOverlay(idx); }; - const usernameClassName = classNames({ - [css.username]: shouldRenderAvatars, - [css.usernameNoAvatar]: !shouldRenderAvatars, - }); - return ( ); });