mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Clean up
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
44ae3d603d
commit
eb3f49d7f6
@ -99,7 +99,7 @@ class NonInjectedConfigMapDetails extends React.Component<ConfigMapDetailsProps
|
|||||||
<>
|
<>
|
||||||
<DrawerTitle>Data</DrawerTitle>
|
<DrawerTitle>Data</DrawerTitle>
|
||||||
{
|
{
|
||||||
data.map(([name, value]) => (
|
data.map(([name, value = ""]) => (
|
||||||
<div key={name} className="data">
|
<div key={name} className="data">
|
||||||
<div className="name">{name}</div>
|
<div className="name">{name}</div>
|
||||||
<MonacoEditor
|
<MonacoEditor
|
||||||
@ -110,7 +110,7 @@ class NonInjectedConfigMapDetails extends React.Component<ConfigMapDetailsProps
|
|||||||
border: "1px solid var(--borderFaintColor)",
|
border: "1px solid var(--borderFaintColor)",
|
||||||
borderRadius: "4px",
|
borderRadius: "4px",
|
||||||
}}
|
}}
|
||||||
value={value || ""}
|
value={value}
|
||||||
onChange={v => this.data.set(name, v)}
|
onChange={v => this.data.set(name, v)}
|
||||||
setInitialHeight
|
setInitialHeight
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
|
||||||
export type MonacoEditorSize = (linesCount: number) => number;
|
|
||||||
|
|
||||||
const getEditorHeightFromLinesCountInjectable = getInjectable({
|
const getEditorHeightFromLinesCountInjectable = getInjectable({
|
||||||
id: "get-editor-height-from-lines-number",
|
id: "get-editor-height-from-lines-number",
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@ import type { LensTheme } from "../../themes/lens-theme";
|
|||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
import userStoreInjectable from "../../../common/user-store/user-store.injectable";
|
import userStoreInjectable from "../../../common/user-store/user-store.injectable";
|
||||||
import activeThemeInjectable from "../../themes/active.injectable";
|
import activeThemeInjectable from "../../themes/active.injectable";
|
||||||
import type { MonacoEditorSize } from "./get-editor-height-from-lines-number.injectable";
|
|
||||||
import getEditorHeightFromLinesCountInjectable from "./get-editor-height-from-lines-number.injectable";
|
import getEditorHeightFromLinesCountInjectable from "./get-editor-height-from-lines-number.injectable";
|
||||||
|
|
||||||
export type MonacoEditorId = string;
|
export type MonacoEditorId = string;
|
||||||
@ -45,7 +44,7 @@ export interface MonacoEditorProps {
|
|||||||
interface Dependencies {
|
interface Dependencies {
|
||||||
userStore: UserStore;
|
userStore: UserStore;
|
||||||
activeTheme: IComputedValue<LensTheme>;
|
activeTheme: IComputedValue<LensTheme>;
|
||||||
getEditorHeightFromLinesCount: MonacoEditorSize;
|
getEditorHeightFromLinesCount: (linesCount: number) => number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createMonacoUri(id: MonacoEditorId): Uri {
|
export function createMonacoUri(id: MonacoEditorId): Uri {
|
||||||
@ -297,11 +296,11 @@ class NonInjectedMonacoEditor extends React.Component<MonacoEditorProps & Depend
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { className, style, setInitialHeight } = this.props;
|
const { className, style } = this.props;
|
||||||
|
|
||||||
const css: React.CSSProperties = {
|
const css: React.CSSProperties = {
|
||||||
...style,
|
...style,
|
||||||
height: setInitialHeight ? this.initialHeight : style?.height,
|
height: style?.height ?? this.initialHeight,
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user