File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ export default function Menu() {
4242 const team = getCurrentTeam ( location , teams ) ;
4343 const { setCurrency, setIsStudent, setIsChargebeeCustomer } = useContext ( PaymentContext ) ;
4444 const [ teamBillingMode , setTeamBillingMode ] = useState < BillingMode | undefined > ( undefined ) ;
45+ const [ userBillingMode , setUserBillingMode ] = useState < BillingMode | undefined > ( undefined ) ;
4546 const { project, setProject } = useContext ( ProjectContext ) ;
4647 const [ isFeedbackFormVisible , setFeedbackFormVisible ] = useState < boolean > ( false ) ;
4748
@@ -51,6 +52,7 @@ export default function Menu() {
5152 getGitpodService ( )
5253 . server . getUserProjects ( )
5354 . then ( ( projects ) => setHasIndividualProjects ( projects . length > 0 ) ) ;
55+ getGitpodService ( ) . server . getBillingModeForUser ( ) . then ( setUserBillingMode ) ;
5456 } , [ ] ) ;
5557
5658 const match = useRouteMatch < { segment1 ?: string ; segment2 ?: string ; segment3 ?: string } > (
@@ -449,6 +451,14 @@ export default function Menu() {
449451 title : "Settings" ,
450452 link : "/settings" ,
451453 } ,
454+ ...( BillingMode . showUsageBasedBilling ( userBillingMode )
455+ ? [
456+ {
457+ title : "Usage" ,
458+ link : "/usage" ,
459+ } ,
460+ ]
461+ : [ ] ) ,
452462 {
453463 title : "Docs" ,
454464 href : "https://www.gitpod.io/docs/" ,
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import {
1616 settingsPathTeams ,
1717 settingsPathVariables ,
1818 settingsPathSSHKeys ,
19- settingsPathUsage ,
2019} from "./settings.routes" ;
2120
2221export default function getSettingsMenu ( params : { userBillingMode ?: BillingMode } ) {
@@ -81,14 +80,6 @@ function renderBillingMenuEntries(billingMode?: BillingMode) {
8180 title : "Billing" ,
8281 link : [ settingsPathBilling ] ,
8382 } ,
84- ...( BillingMode . showUsageBasedBilling ( billingMode )
85- ? [
86- {
87- title : "Usage" ,
88- link : [ settingsPathUsage ] ,
89- } ,
90- ]
91- : [ ] ) ,
9283 // We need to allow access to "Team Plans" here, at least for owners.
9384 ...( BillingMode . showTeamSubscriptionUI ( billingMode )
9485 ? [
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ export const settingsPathAccount = "/account";
1111export const settingsPathIntegrations = "/integrations" ;
1212export const settingsPathNotifications = "/notifications" ;
1313export const settingsPathBilling = "/billing" ;
14- export const settingsPathUsage = "/usage" ;
1514export const settingsPathPlans = "/plans" ;
1615export const settingsPathPreferences = "/preferences" ;
1716
You can’t perform that action at this time.
0 commit comments