mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
9b55a5fd0a
commit
296ba9023f
7 files changed
+29
-28
No files matched your search
@@ -1,13 +1,13 @@
|
||||
import { LensMainExtension, windowManager } from "@k8slens/extensions";
|
||||
import { supportPageURL } from "./src/support.route";
|
||||
import { pageUrl } from "./src/common-vars";
|
||||
|
||||
export default class SupportPageMainExtension extends LensMainExtension {
|
||||
appMenus = [
|
||||
{
|
||||
parentId: "help",
|
||||
label: "Support",
|
||||
click() {
|
||||
windowManager.navigate(supportPageURL());
|
||||
click: () => {
|
||||
windowManager.navigate(this.getPageUrl(pageUrl)); // todo: simplify
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
+6
@@ -26,6 +26,12 @@
|
||||
"integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.14.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz",
|
||||
"integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/prop-types": {
|
||||
"version": "15.7.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
import React from "react";
|
||||
import { Component, LensRendererExtension, Navigation } from "@k8slens/extensions";
|
||||
import { supportPageRoute, supportPageURL } from "./src/support.route";
|
||||
import { Component, Interface, LensRendererExtension, Navigation } from "@k8slens/extensions";
|
||||
import { Support } from "./src/support";
|
||||
import { pageRoute, pageUrl } from "./src/common-vars";
|
||||
|
||||
export default class SupportPageRendererExtension extends LensRendererExtension {
|
||||
// globalPages = [
|
||||
// {
|
||||
// ...supportPageRoute,
|
||||
// url: supportPageURL(),
|
||||
// hideInMenu: true,
|
||||
// components: {
|
||||
// Page: Support,
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
globalPages: Interface.PageRegistration[] = [
|
||||
{
|
||||
routePath: pageRoute,
|
||||
components: {
|
||||
Page: Support,
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
statusBarItems = [
|
||||
{
|
||||
item: (
|
||||
<div
|
||||
className="flex align-center gaps hover-highlight"
|
||||
onClick={() => Navigation.navigate(supportPageURL())}
|
||||
onClick={() => Navigation.navigate(this.getPageUrl(pageUrl))}
|
||||
>
|
||||
<Component.Icon material="help" smallest />
|
||||
<Component.Icon material="help" smallest/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Common variables for both processes (main & renderer)
|
||||
|
||||
export const pageRoute = "/support"
|
||||
export const pageUrl = pageRoute; // same since no special :placeholder-s for react-router's route
|
||||
@@ -1,7 +0,0 @@
|
||||
import type { RouteProps } from "react-router";
|
||||
|
||||
export const supportPageRoute: RouteProps = {
|
||||
path: "/support"
|
||||
}
|
||||
|
||||
export const supportPageURL = () => supportPageRoute.path.toString();
|
||||
Reference in new issue
Block a user