Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33302736
D6662.1768780458.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6662.1768780458.diff
View Options
diff --git a/web/sidebar/community-picker.css b/web/sidebar/community-picker.css
--- a/web/sidebar/community-picker.css
+++ b/web/sidebar/community-picker.css
@@ -51,3 +51,11 @@
align-self: flex-start;
width: 100%;
}
+
+.inboxButtonTitle {
+ font-weight: 500;
+ font-size: var(--l-font-18);
+ line-height: 22px;
+ padding-left: 12px;
+ color: var(--fg);
+}
diff --git a/web/sidebar/community-picker.react.js b/web/sidebar/community-picker.react.js
--- a/web/sidebar/community-picker.react.js
+++ b/web/sidebar/community-picker.react.js
@@ -6,7 +6,10 @@
import SWMansionIcon from 'lib/components/SWMansionIcon.react.js';
-import { updateNavInfoActionType } from '../redux/action-types.js';
+import {
+ clearCalendarCommunityFilter,
+ updateNavInfoActionType,
+} from '../redux/action-types';
import { useSelector } from '../redux/redux-utils.js';
import CommunityDrawer from './community-drawer.react';
import css from './community-picker.css';
@@ -30,15 +33,23 @@
[css.inactiveContainer]: !isSettingsOpen,
});
- const openChat = React.useCallback(
+ const isCalendarOpen = useSelector(state => state.navInfo.tab === 'calendar');
+
+ const onPressInbox = React.useCallback(
(event: SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
- dispatch({
- type: updateNavInfoActionType,
- payload: { tab: 'chat' },
- });
+ if (isCalendarOpen) {
+ dispatch({
+ type: clearCalendarCommunityFilter,
+ });
+ } else {
+ dispatch({
+ type: updateNavInfoActionType,
+ payload: { tab: 'chat' },
+ });
+ }
},
- [dispatch],
+ [dispatch, isCalendarOpen],
);
const isInboxOpen = useSelector(
state =>
@@ -51,10 +62,13 @@
[css.inactiveContainer]: !isInboxOpen,
});
+ const inboxButtonTitle = isCalendarOpen ? 'All communities' : 'Inbox';
+
return (
<div className={css.container}>
- <a className={inboxButtonContainerClass} onClick={openChat}>
+ <a className={inboxButtonContainerClass} onClick={onPressInbox}>
<SWMansionIcon icon="inbox" size={36} />
+ <div className={css.inboxButtonTitle}> {inboxButtonTitle} </div>
</a>
<div className={css.drawerWrapper}>
<CommunityDrawer />
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 18, 11:54 PM (4 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5953477
Default Alt Text
D6662.1768780458.diff (2 KB)
Attached To
Mode
D6662: [web] Add All communities / Inbox button
Attached
Detach File
Event Timeline
Log In to Comment