Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3393376
D4121.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4121.diff
View Options
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
@@ -1,25 +1,32 @@
// @flow
import * as React from 'react';
+import { useDispatch } from 'react-redux';
import Button from '../components/button.react';
-import UserSettingsModal from '../modals/account/user-settings-modal.react';
-import { useModalContext } from '../modals/modal-provider.react';
import SWMansionIcon from '../SWMansionIcon.react';
+import { updateNavInfoActionType } from '../types/nav-types.js';
import css from './community-picker.css';
function CommunityPicker(): React.Node {
- const { pushModal } = useModalContext();
+ const dispatch = useDispatch();
- const setModalToUserSettings = React.useCallback(() => {
- pushModal(<UserSettingsModal />);
- }, [pushModal]);
+ const openAccountSettings = React.useCallback(
+ (event: SyntheticEvent<HTMLButtonElement>) => {
+ event.preventDefault();
+ dispatch({
+ type: updateNavInfoActionType,
+ payload: { tab: 'settings', settingsSection: 'account' },
+ });
+ },
+ [dispatch],
+ );
return (
<div className={css.container}>
<SWMansionIcon icon="inbox" size={36} />
<div className={css.spacer} />
- <Button variant="round" onClick={setModalToUserSettings}>
+ <Button variant="round" onClick={openAccountSettings}>
<SWMansionIcon icon="settings" size={22} />
</Button>
</div>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 1, 1:33 PM (20 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2605118
Default Alt Text
D4121.diff (1 KB)
Attached To
Mode
D4121: [web] Modify settings button to open account settings
Attached
Detach File
Event Timeline
Log In to Comment