1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/extensions/example-extension/renderer.tsx
Roman f3a0059355
Extension support page (#1112)
Signed-off-by: Roman <ixrock@gmail.com>
Co-authored-by: Jim Ehrismann <40840436+jim-docker@users.noreply.github.com>
2020-10-24 09:24:54 +03:00

28 lines
774 B
TypeScript

import { LensRendererExtension, Registry } from "@k8slens/extensions";
import { ExamplePage, ExampleIcon } from "./page"
import React from "react"
export default class ExampleExtension extends LensRendererExtension {
onActivate() {
console.log('EXAMPLE EXTENSION RENDERER: ACTIVATED', this.getMeta());
}
registerPages(registry: Registry.PageRegistry) {
this.disposers.push(
registry.add({
type: Registry.PageRegistryType.CLUSTER,
path: "/extension-example",
title: "Example Extension",
components: {
Page: () => <ExamplePage extension={this} />,
MenuIcon: ExampleIcon,
}
})
)
}
onDeactivate() {
console.log('EXAMPLE EXTENSION RENDERER: DEACTIVATED', this.getMeta());
}
}