mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
migration additions -- part 3 (adding makeObservable to constructor)
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
95794af5b2
commit
08787dce1f
139 files changed
+732
-147
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import "./page-layout.scss";
|
||||
|
||||
import React from "react";
|
||||
import { makeObservable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import { autobind, cssNames, IClassName } from "../../utils";
|
||||
import { navigation } from "../../navigation";
|
||||
@@ -27,6 +28,11 @@ const defaultProps: Partial<PageLayoutProps> = {
|
||||
export class PageLayout extends React.Component<PageLayoutProps> {
|
||||
static defaultProps = defaultProps as object;
|
||||
|
||||
constructor(props: PageLayoutProps) {
|
||||
super(props);
|
||||
makeObservable(this);
|
||||
}
|
||||
|
||||
@autobind()
|
||||
back(evt?: React.MouseEvent | KeyboardEvent) {
|
||||
if (this.props.back) {
|
||||
@@ -64,7 +70,7 @@ export class PageLayout extends React.Component<PageLayoutProps> {
|
||||
|
||||
return (
|
||||
<div {...elemProps} className={className}>
|
||||
{ navigation && (
|
||||
{navigation && (
|
||||
<nav className="sidebarRegion">
|
||||
<div className="sidebar">
|
||||
{navigation}
|
||||
@@ -76,7 +82,7 @@ export class PageLayout extends React.Component<PageLayoutProps> {
|
||||
{children}
|
||||
</div>
|
||||
<div className="toolsRegion">
|
||||
{ this.props.provideBackButtonNavigation && (
|
||||
{this.props.provideBackButtonNavigation && (
|
||||
<div className="fixedTools">
|
||||
<div className="closeBtn" role="button" aria-label="Close" onClick={this.back}>
|
||||
<Icon material="close"/>
|
||||
|
||||
Reference in new issue
Block a user