Skip to content

Commit

Permalink
fix(fe): useLocation instead of useHistory for settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
ADRFranklin committed Mar 31, 2024
1 parent aa4fc35 commit 2d4ab51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/frontend/src/pages/admin/settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useHistory } from 'react-router';
import { Route, Switch } from 'react-router-dom';
import { useLocation } from "react-router-dom/cjs/react-router-dom.min";

import AdminSettingsSidebar from '../../components/adminSettingsSidebar';
import Meta from '../../components/meta';
Expand All @@ -11,13 +11,13 @@ import SettingsGeneral from './settings-general';
import SettingsNotifications from './settings-notifications';

export default function Settings({ newNotification }) {
const history = useHistory();
const location = useLocation();
return (
<div className={styles.wrap}>
<Meta title="Admin Settings" />
<div className="container">
<div className={styles.inner}>
<AdminSettingsSidebar current={history.location.pathname} />
<AdminSettingsSidebar current={location.pathname} />

<Switch>
<Route exact path="/admin/settings">
Expand Down

0 comments on commit 2d4ab51

Please sign in to comment.