aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentButtonBar.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-12-13 21:17:50 -0500
committerbobzel <zzzman@gmail.com>2023-12-13 21:17:50 -0500
commit1cf241544f8063e3d71406238a584299b6ced794 (patch)
treecb2bf6a71abbe76e8e3ab8d6283c0daab850e0a4 /src/client/views/DocumentButtonBar.tsx
parent35f4d108643d310e4e9da107a5839bb74cc6706f (diff)
cleaned up props/_props handling by inherting from ObservableReactComponent
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r--src/client/views/DocumentButtonBar.tsx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index a8ad4150e..50ca3af06 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -28,6 +28,7 @@ import { GoogleRef } from './nodes/formattedText/FormattedTextBox';
import { PinProps } from './nodes/trails';
import { TemplateMenu } from './TemplateMenu';
import * as React from 'react';
+import { ObservableReactComponent } from './ObservableReactComponent';
// import * as higflyout from '@hig/flyout';
// export const { anchorPoints } = higflyout;
// export const Flyout = higflyout.default;
@@ -42,12 +43,11 @@ enum UtilityButtonState {
}
@observer
-export class DocumentButtonBar extends React.Component<{ views: () => (DocumentView | undefined)[]; stack?: any }, {}> {
+export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (DocumentView | undefined)[]; stack?: any }> {
private _dragRef = React.createRef<HTMLDivElement>();
private _pullAnimating = false;
private _pushAnimating = false;
private _pullColorAnimating = false;
-
@observable private pushIcon: IconProp = 'arrow-alt-circle-up';
@observable private pullIcon: IconProp = 'arrow-alt-circle-down';
@observable private pullColor: string = 'white';
@@ -60,12 +60,10 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
public static hasPushedHack = false;
public static hasPulledHack = false;
- @observable _props: { views: () => (DocumentView | undefined)[] };
constructor(props: { views: () => (DocumentView | undefined)[] }) {
super(props);
- this._props = props;
+ DocumentButtonBar.Instance = this;
makeObservable(this);
- runInAction(() => (DocumentButtonBar.Instance = this));
}
public startPullOutcome = action((success: boolean) => {