migration additions -- part 3 (adding makeObservable to constructor)

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2021-04-20 13:45:35 +03:00
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"/>