aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/FilterPanel.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-09-19 20:03:49 -0400
committerbobzel <zzzman@gmail.com>2024-09-19 20:03:49 -0400
commit302b9ab98001a50ca2117df823216a99b7c25869 (patch)
treef61c85733b5a1b3f9338948e594b851715c2a2a6 /src/client/views/FilterPanel.tsx
parent3c8af89e3d5370b748fea27c411b3e62758b9a45 (diff)
changed carousel to set #star tags instead of a metaadata field.
Diffstat (limited to 'src/client/views/FilterPanel.tsx')
-rw-r--r--src/client/views/FilterPanel.tsx41
1 files changed, 9 insertions, 32 deletions
diff --git a/src/client/views/FilterPanel.tsx b/src/client/views/FilterPanel.tsx
index a3c8fc383..e34b66963 100644
--- a/src/client/views/FilterPanel.tsx
+++ b/src/client/views/FilterPanel.tsx
@@ -40,38 +40,17 @@ const HotKeyIconButton: React.FC<HotKeyButtonProps> = observer(({ hotKey /*, sel
isEditing: false,
myHotKey: hotKey,
- toggleActive() {
- this.isActive = !this.isActive;
- },
- deactivate() {
- this.isActive = false;
- },
- startEditing() {
- this.isEditing = true;
- },
- stopEditing() {
- this.isEditing = false;
- },
- setHotKey(newHotKey: string) {
- this.myHotKey.title = newHotKey;
- },
- }));
+ toggleActive() { this.isActive = !this.isActive; },
+ deactivate() { this.isActive = false; },
+ startEditing() { this.isEditing = true; },
+ stopEditing() { this.isEditing = false; },
+ setHotKey(newHotKey: string) { this.myHotKey.title = newHotKey; },
+ })); // prettier-ignore
const panelRef = useRef<HTMLDivElement>(null);
const inputRef = useRef<HTMLInputElement>(null);
- const handleClick = () => {
- state.toggleActive();
- };
-
- const buttons = DocCast(Doc.UserDoc().myContextMenuBtns);
-
- /**
- * Removes a hotkey from list
- */
- const removeHotKey = () => {
- Doc.RemFromFilterHotKeys(hotKey);
- };
+ const handleClick = () => state.toggleActive();
/**
* Updates the list of hotkeys based on the users input. replaces the old title with the new one and then assigns this new
@@ -99,9 +78,7 @@ const HotKeyIconButton: React.FC<HotKeyButtonProps> = observer(({ hotKey /*, sel
useEffect(() => {
document.addEventListener('mousedown', handleClickOutside);
- return () => {
- document.removeEventListener('mousedown', handleClickOutside);
- };
+ return () => document.removeEventListener('mousedown', handleClickOutside);
}, []);
const iconOpts = ['star', 'heart', 'bolt', 'satellite', 'palette', 'robot', 'lightbulb', 'highlighter', 'book', 'chalkboard'] as IconProp[];
@@ -172,7 +149,7 @@ const HotKeyIconButton: React.FC<HotKeyButtonProps> = observer(({ hotKey /*, sel
className="hotKey-close"
onClick={(e: React.MouseEvent) => {
e.stopPropagation();
- removeHotKey();
+ Doc.RemFromFilterHotKeys(hotKey);
}}>
<FontAwesomeIcon icon={'x' as IconProp} color={SnappingManager.userColor} />
</button>