Skip to content

Commit

Permalink
Catching active lens theme (lensapp#11)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
  • Loading branch information
aleksfront authored Nov 27, 2020
1 parent cee0c20 commit cf98955
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
36 changes: 36 additions & 0 deletions styling-emotion-sample/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions styling-emotion-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"@types/react-router": "^5.1.8",
"@types/webpack": "^4.41.17",
"mobx": "^5.15.5",
"mobx-react": "^7.0.5",
"react": "^16.13.1",
"react-dom": "^17.0.1",
"react-open-doodles": "^1.0.5",
"ts-loader": "^8.0.4",
"ts-node": "^9.0.0",
Expand Down
5 changes: 4 additions & 1 deletion styling-emotion-sample/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from "react";
import path from "path";
import styled from "@emotion/styled";
import { LensRendererExtension, Component } from "@k8slens/extensions";
import { observer } from "mobx-react";
import { LensRendererExtension, Component, Theme } from "@k8slens/extensions";
import { CoffeeDoodle } from "react-open-doodles";

const Wrapper = styled.div`
Expand All @@ -24,13 +25,15 @@ export function ExampleIcon(props: Component.IconProps) {
return <Component.Icon {...props} material="pages" tooltip={path.basename(__filename)}/>
}

@observer
export class ExamplePage extends React.Component<{ extension: LensRendererExtension }> {
render() {
return (
<Wrapper>
<div className="doodle-style"><CoffeeDoodle accent="#3d90ce" /></div>
<p>Hello world with Emotion!</p>
<p>File: <i>{__filename}</i></p>
<p>Active theme is {Theme.getActiveTheme().name}</p>
</Wrapper>
);
}
Expand Down

0 comments on commit cf98955

Please sign in to comment.