File tree 1 file changed +6
-6
lines changed
components/dashboard/src/user-settings
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import { User } from "@gitpod/gitpod-protocol" ;
8
8
import { BillingMode } from "@gitpod/gitpod-protocol/lib/billing-mode" ;
9
- import { useContext } from "react" ;
9
+ import { useContext , useMemo } from "react" ;
10
10
import { PageWithSubMenu } from "../components/PageWithSubMenu" ;
11
11
import { FeatureFlagContext } from "../contexts/FeatureFlagContext" ;
12
12
import { UserContext } from "../user-context" ;
@@ -33,12 +33,12 @@ export function PageWithSettingsSubMenu({ children }: PageWithAdminSubMenuProps)
33
33
const { userBillingMode, user } = useContext ( UserContext ) ;
34
34
const { enablePersonalAccessTokens } = useContext ( FeatureFlagContext ) ;
35
35
36
+ const settingsMenu = useMemo ( ( ) => {
37
+ return getSettingsMenu ( user , userBillingMode , enablePersonalAccessTokens ) ;
38
+ } , [ user , userBillingMode , enablePersonalAccessTokens ] ) ;
39
+
36
40
return (
37
- < PageWithSubMenu
38
- subMenu = { getSettingsMenu ( user , userBillingMode , enablePersonalAccessTokens ) }
39
- title = "User Settings"
40
- subtitle = "Manage your personal account settings."
41
- >
41
+ < PageWithSubMenu subMenu = { settingsMenu } title = "User Settings" subtitle = "Manage your personal account settings." >
42
42
{ children }
43
43
</ PageWithSubMenu >
44
44
) ;
You can’t perform that action at this time.
0 commit comments