Page MenuHomePhabricator

D4121.diff
No OneTemporary

D4121.diff

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

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)

Event Timeline