mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Expose a way to reactively control visibility of preference tabs and tray menu items through Extension API (#5789)
This commit is contained in:
1 parent
544bbdc952
commit
eb6cc70143
30 files changed
+1295
-194
No files matched your search
+3
@@ -3,9 +3,12 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { IComputedValue } from "mobx";
|
||||
|
||||
export interface AppPreferenceTabRegistration {
|
||||
title: string;
|
||||
id: string;
|
||||
orderNumber?: number;
|
||||
visible?: IComputedValue<boolean>;
|
||||
}
|
||||
|
||||
+9
-1
@@ -46,7 +46,15 @@ const extensionSpecificTabNavigationItemRegistratorInjectable = getInjectable({
|
||||
parent: "general",
|
||||
orderNumber: tab.orderNumber || 100,
|
||||
navigate: () => navigateToExtensionPreferences(extension.sanitizedExtensionId, tab.id),
|
||||
isVisible: computed(() => true),
|
||||
|
||||
isVisible: computed(() => {
|
||||
if (!tab.visible) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return tab.visible.get();
|
||||
}),
|
||||
|
||||
isActive,
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user