Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 32c4f31

Browse files
committed
fix: load profile-app without page refresh
href attribute triggers a page refresh which refreshes application states switch to link to avoid page refresh
1 parent a73baab commit 32c4f31

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/components/UserMenu/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Shows logged-in user with user menu with options like log-out.
55
*/
66
import React, { useState, useCallback, Fragment } from "react";
7+
import { Link } from "@reach/router";
78
import Avatar from "../Avatar";
89
import cn from "classnames";
910
import OutsideClickHandler from "react-outside-click-handler";
@@ -63,7 +64,9 @@ const UserMenu = ({ profile }) => {
6364
<div className="user-menu-popover-content">
6465
<ul className="user-menu-list">
6566
<li>
66-
<a href={`/profile/${profile.handle}`}>Profile</a>
67+
<Link to={`/profile/${profile.handle}`} onClick={closeMenu}>
68+
Profile
69+
</Link>
6770
</li>
6871
<li>
6972
<a href={getLogoutUrl()} onClick={onLogoutClick}>

src/constants/apps.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export const APP_CATEGORIES = [
7979
title: "Profile App",
8080
path: "/profile/",
8181
isExact: false,
82+
menu: [],
8283
},
8384
],
8485
},

0 commit comments

Comments
 (0)