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
2020-10-26 17:59:24 +02:00

27 lines
712 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());
}
registerClusterPage(registry: Registry.ClusterPageRegistry) {
return [
{
path: "/extension-example",
title: "Example Extension",
components: {
Page: () => <ExamplePage extension={this} />,
MenuIcon: ExampleIcon,
}
}
]
}
onDeactivate() {
console.log('EXAMPLE EXTENSION RENDERER: DEACTIVATED', this.getMeta());
}
}