aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/AntimodeMenu.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-05-05 18:28:35 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-05-05 18:28:35 -0400
commit86f55d8aa12268fe847eaa344e8efbab5d293f34 (patch)
tree6bbc5c6fb6825ef969ed0342e4851667b81577cc /src/client/views/AntimodeMenu.tsx
parent2a9db784a6e3492a8f7d8ce9a745b4f1a0494241 (diff)
parent139600ab7e8a82a31744cd3798247236cd5616fc (diff)
Merge branch 'nathan-starter' of https://github.com/brown-dash/Dash-Web into nathan-starter
Diffstat (limited to 'src/client/views/AntimodeMenu.tsx')
-rw-r--r--src/client/views/AntimodeMenu.tsx26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/client/views/AntimodeMenu.tsx b/src/client/views/AntimodeMenu.tsx
index db7e64deb..303672d90 100644
--- a/src/client/views/AntimodeMenu.tsx
+++ b/src/client/views/AntimodeMenu.tsx
@@ -1,8 +1,9 @@
import { action, makeObservable, observable, runInAction } from 'mobx';
import * as React from 'react';
-import { SettingsManager } from '../util/SettingsManager';
+import { SnappingManager } from '../util/SnappingManager';
import './AntimodeMenu.scss';
import { ObservableReactComponent } from './ObservableReactComponent';
+
export interface AntimodeMenuProps {}
/**
@@ -76,7 +77,7 @@ export abstract class AntimodeMenu<T extends AntimodeMenuProps> extends Observab
};
@action
- protected pointerLeave = (e: React.PointerEvent) => {
+ protected pointerLeave = () => {
if (!this.Pinned && this._canFade) {
this._transitionProperty = 'opacity';
this._transitionDuration = '0.5s';
@@ -87,7 +88,7 @@ export abstract class AntimodeMenu<T extends AntimodeMenuProps> extends Observab
};
@action
- protected pointerEntered = (e: React.PointerEvent) => {
+ protected pointerEntered = () => {
this._transitionProperty = 'opacity';
this._transitionDuration = '0.1s';
this._transitionDelay = '';
@@ -95,8 +96,10 @@ export abstract class AntimodeMenu<T extends AntimodeMenuProps> extends Observab
};
@action
- protected togglePin = (e: React.MouseEvent) => {
- runInAction(() => (this.Pinned = !this.Pinned));
+ protected togglePin = () => {
+ runInAction(() => {
+ this.Pinned = !this.Pinned;
+ });
};
protected dragStart = (e: React.PointerEvent) => {
@@ -114,8 +117,7 @@ export abstract class AntimodeMenu<T extends AntimodeMenuProps> extends Observab
@action
protected dragging = (e: PointerEvent) => {
- const width = this._mainCont.current!.getBoundingClientRect().width;
- const height = this._mainCont.current!.getBoundingClientRect().height;
+ const { width, height } = this._mainCont.current!.getBoundingClientRect();
const left = e.pageX - this._offsetX;
const top = e.pageY - this._offsetY;
@@ -139,9 +141,7 @@ export abstract class AntimodeMenu<T extends AntimodeMenuProps> extends Observab
e.preventDefault();
};
- protected getDragger = () => {
- return <div className="antimodeMenu-dragger" key="dragger" onPointerDown={this.dragStart} style={{ width: '20px' }} />;
- };
+ protected getDragger = () => <div className="antimodeMenu-dragger" key="dragger" onPointerDown={this.dragStart} style={{ width: '20px' }} />;
protected getElement(buttons: JSX.Element, expanded: boolean = false) {
const containerClass = expanded ? 'antimodeMenu-cont expanded' : 'antimodeMenu-cont';
@@ -157,7 +157,7 @@ export abstract class AntimodeMenu<T extends AntimodeMenuProps> extends Observab
left: this._left,
top: this._top,
opacity: this._opacity,
- background: SettingsManager.userBackgroundColor,
+ background: SnappingManager.userBackgroundColor,
transitionProperty: this._transitionProperty,
transitionDuration: this._transitionDuration,
transitionDelay: this._transitionDelay,
@@ -183,7 +183,7 @@ export abstract class AntimodeMenu<T extends AntimodeMenuProps> extends Observab
height: 'inherit',
width: 200,
opacity: this._opacity,
- background: SettingsManager.userBackgroundColor,
+ background: SnappingManager.userBackgroundColor,
transitionProperty: this._transitionProperty,
transitionDuration: this._transitionDuration,
transitionDelay: this._transitionDelay,
@@ -206,7 +206,7 @@ export abstract class AntimodeMenu<T extends AntimodeMenuProps> extends Observab
left: this._left,
top: this._top,
opacity: this._opacity,
- background: SettingsManager.userBackgroundColor,
+ background: SnappingManager.userBackgroundColor,
transitionProperty: this._transitionProperty,
transitionDuration: this._transitionDuration,
transitionDelay: this._transitionDelay,