Skip to content

Commit

Permalink
runfix: re-implement indicator on settings button when a new device i…
Browse files Browse the repository at this point in the history
…s added (WPB-9542) (#17763)
  • Loading branch information
V-Gira authored Jul 16, 2024
1 parent 662e10f commit 5b451a1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface ConversationTabProps {
unreadConversations?: number;
dataUieName: string;
isActive?: boolean;
showNotificationBadge?: boolean;
showNotificationsBadge?: boolean;
}

export const ConversationTab = ({
Expand All @@ -44,7 +44,7 @@ export const ConversationTab = ({
unreadConversations = 0,
dataUieName,
isActive = false,
showNotificationBadge = false,
showNotificationsBadge = false,
}: ConversationTabProps) => {
return (
<button
Expand All @@ -60,10 +60,10 @@ export const ConversationTab = ({
>
<span className="conversations-sidebar-btn--text-wrapper">
{Icon}
{(unreadConversations > 0 || showNotificationBadge) && (
{(unreadConversations > 0 || showNotificationsBadge) && (
<span
className={cx('conversations-sidebar-btn--badge', {active: isActive})}
data-uie-name={showNotificationBadge ? 'notification-badge' : 'unread-badge'}
data-uie-name={showNotificationsBadge ? 'notification-badge' : 'unread-badge'}
/>
)}
<span className="conversations-sidebar-btn--text">{label || title}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const ConversationTabs = ({
}}
conversationTabIndex={1}
dataUieName="go-preferences"
showNotificationBadge={showNotificationsBadge}
showNotificationsBadge={showNotificationsBadge}
isActive={currentTab === SidebarTabs.PREFERENCES}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const Conversations: React.FC<ConversationsProps> = ({
const [conversationsFilter, setConversationsFilter] = useState<string>('');
const {classifiedDomains, isTeam} = useKoSubscribableChildren(teamState, ['classifiedDomains', 'isTeam']);
const {connectRequests} = useKoSubscribableChildren(userState, ['connectRequests']);
const {notifications} = useKoSubscribableChildren(preferenceNotificationRepository, ['notifications']);

const {isTemporaryGuest} = useKoSubscribableChildren(selfUser, ['isTemporaryGuest']);

Expand Down Expand Up @@ -264,6 +265,7 @@ const Conversations: React.FC<ConversationsProps> = ({
archivedConversations={archivedConversations}
conversationRepository={conversationRepository}
onClickPreferences={() => onClickPreferences(ContentState.PREFERENCES_ACCOUNT)}
showNotificationsBadge={notifications.length > 0}
/>
</FadingScrollbar>

Expand Down
22 changes: 0 additions & 22 deletions src/style/list/conversations.less
Original file line number Diff line number Diff line change
Expand Up @@ -292,28 +292,6 @@
}
}

.conversations-settings-button {
.button-reset-default;
.button-icon-large;
.focus-border-radius;
position: relative;
outline-offset: 0.2rem;
}

.conversations-settings {
position: relative;

&--badge::after {
.dot-md;
position: absolute;
top: 10px;
right: 10px;
background-color: currentColor;
color: inherit;
content: '';
}
}

.conversations-hint {
position: absolute;
bottom: 0;
Expand Down

0 comments on commit 5b451a1

Please sign in to comment.