aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsharkiecodes <lanyi_stroud@brown.edu>2025-06-06 11:10:43 -0400
committersharkiecodes <lanyi_stroud@brown.edu>2025-06-06 11:10:43 -0400
commit6807ed433befd3f90f2dfc4ca359cd9ee8a68e32 (patch)
treee6331ea20fe9263dd5951269e0002d5a1a9b66ba /src
parentcea108a2f0b4a64fedb523a415a1d586ca8d126d (diff)
temp cleanup
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/scrapbook/ScrapbookPicker.scss40
-rw-r--r--src/client/views/nodes/scrapbook/ScrapbookPicker.tsx84
2 files changed, 0 insertions, 124 deletions
diff --git a/src/client/views/nodes/scrapbook/ScrapbookPicker.scss b/src/client/views/nodes/scrapbook/ScrapbookPicker.scss
deleted file mode 100644
index 237274433..000000000
--- a/src/client/views/nodes/scrapbook/ScrapbookPicker.scss
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScrapbookPicker.scss */
-
-.scrapbook-picker-popup {
- background: rgba(255, 0, 0, 0.5); /* semi-transparent red */
- position: absolute; /* ← make it float */
- z-index: 10000; /* so it sits above the overlay‐window’s background */
- border: 1px solid #ccc;
- border-radius: 4px;
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
- padding: 8px;
- min-width: 200px; /* at least give it some size */
-}
-
-.scrapbook-picker-close {
- position: absolute;
- top: 4px;
- right: 8px;
- cursor: pointer;
- font-size: 14px;
-}
-
-.scrapbook-picker-thumbnails {
- margin-top: 24px; /* room under the close button */
- display: flex;
- flex-wrap: wrap;
- gap: 8px;
-}
-
-.scrapbook-picker-thumb {
- cursor: pointer;
- border: 1px solid #ddd;
- border-radius: 2px;
- padding: 4px;
- background: #f9f9f9;
-}
-
-.scrapbook-picker-thumb-inner {
- font-size: 12px;
- text-align: center;
-}
diff --git a/src/client/views/nodes/scrapbook/ScrapbookPicker.tsx b/src/client/views/nodes/scrapbook/ScrapbookPicker.tsx
deleted file mode 100644
index 6054cb98d..000000000
--- a/src/client/views/nodes/scrapbook/ScrapbookPicker.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-// src/client/views/nodes/scrapbook/ScrapbookPicker.tsx
-import * as React from 'react';
-import { observer } from 'mobx-react';
-import { Doc } from '../../../../fields/Doc';
-import { Id } from '../../../../fields/FieldSymbols';
-import { StrCast } from '../../../../fields/Types';
-import './ScrapbookPicker.scss';
-
-export interface ScrapbookPickerProps {
- choices: Doc[];
- x: number;
- y: number;
- onSelect: (index: number) => void;
- onCancel: () => void;
-}
-
-/**
- * A floating popup that shows N “temporary” Scrapbook documents.
- * When the user clicks one thumbnail, we call onSelect(i).
- * When the user clicks × or outside, we call onCancel().
- *
- * This component itself does not control its own visibility; MarqueeView / OverlayView will mount/unmount it.
- */
-@observer
-export class ScrapbookPicker extends React.Component<ScrapbookPickerProps> {
- containerRef = React.createRef<HTMLDivElement>();
-
- // Close when user clicks outside the popup
- handleClickOutside = (e: MouseEvent) => {
- if (
- this.containerRef.current &&
- !this.containerRef.current.contains(e.target as Node)
- ) {
- this.props.onCancel();
- }
- };
-
- componentDidMount() {
- document.addEventListener('mousedown', this.handleClickOutside);
- }
- componentWillUnmount() {
- document.removeEventListener('mousedown', this.handleClickOutside);
- }
-
- render() {
- const { choices, x, y, onSelect, onCancel } = this.props;
- return (
- <div
- className="scrapbook-picker-popup"
- ref={this.containerRef}
- style={{
- top: `${y}px`,
- left: `${x}px`,
- }}
- >
- {/* close icon */}
- <div className="scrapbook-picker-close" onClick={onCancel}>
- ×
- </div>
- <div className="scrapbook-picker-thumbnails">
- {choices.map((doc, i) => {
- // We simply show a small thumbnail representation of each temp scrapbook
- // You could replace this with DocumentThumbnail or a custom mini‐preview.
- return (
- <div
- key={`${doc[Id]}_${i}`}
- className="scrapbook-picker-thumb"
- onClick={() => onSelect(i)}
- >
- {/*
- For a minimal example, use the document’s title or ID as a placeholder.
- In a real version, you might render a proper thumbnail/view of doc.
- */}
- <div className="scrapbook-picker-thumb-inner">
- {StrCast(doc.title)}
- </div>
- </div>
- );
- })}
- </div>
- </div>
- );
- }
-}