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(); - }, [pushModal]); + const openAccountSettings = React.useCallback( + (event: SyntheticEvent) => { + event.preventDefault(); + dispatch({ + type: updateNavInfoActionType, + payload: { tab: 'settings', settingsSection: 'account' }, + }); + }, + [dispatch], + ); return (
-