aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-10-10 12:12:14 -0400
committerbobzel <zzzman@gmail.com>2023-10-10 12:12:14 -0400
commit9f4c6d895eb6ff495a99463e8150c5d1dff26c5b (patch)
tree161d543d60ae4360bd1133cdad5283af8ab4b094 /src/client/views/collections/collectionSchema/SchemaRowBox.tsx
parent3884211ab83db30965a4dc1c4b3133684904ebb9 (diff)
parentc9d83841221620137e89920198ffaeab2677b439 (diff)
merged with master
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaRowBox.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaRowBox.tsx54
1 files changed, 38 insertions, 16 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
index e8e606030..4e418728f 100644
--- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
@@ -16,6 +16,10 @@ import { CollectionSchemaView } from './CollectionSchemaView';
import './CollectionSchemaView.scss';
import { SchemaTableCell } from './SchemaTableCell';
import { Transform } from '../../../util/Transform';
+import { IconButton, Size } from 'browndash-components';
+import { CgClose } from 'react-icons/cg';
+import { FaExternalLinkAlt } from 'react-icons/fa';
+import { emptyFunction, returnFalse, setupMoveUpEvents } from '../../../../Utils';
@observer
export class SchemaRowBox extends ViewBoxBaseComponent<FieldViewProps>() {
@@ -110,22 +114,40 @@ export class SchemaRowBox extends ViewBoxBaseComponent<FieldViewProps>() {
width: CollectionSchemaView._rowMenuWidth,
pointerEvents: !this.props.isContentActive() ? 'none' : undefined,
}}>
- <div
- className="schema-row-button"
- onPointerDown={undoable(e => {
- e.stopPropagation();
- this.props.removeDocument?.(this.rootDoc);
- }, 'Delete Row')}>
- <FontAwesomeIcon icon="times" />
- </div>
- <div
- className="schema-row-button"
- onPointerDown={undoable(e => {
- e.stopPropagation();
- this.props.addDocTab(this.rootDoc, OpenWhere.addRight);
- }, 'Open Doc on Right')}>
- <FontAwesomeIcon icon="external-link-alt" />
- </div>
+ <IconButton
+ tooltip="close"
+ icon={<CgClose size={'16px'} />}
+ size={Size.XSMALL}
+ onPointerDown={e =>
+ setupMoveUpEvents(
+ this,
+ e,
+ returnFalse,
+ emptyFunction,
+ undoable(e => {
+ e.stopPropagation();
+ this.props.removeDocument?.(this.rootDoc);
+ }, 'Delete Row')
+ )
+ }
+ />
+ <IconButton
+ tooltip="open preview"
+ icon={<FaExternalLinkAlt />}
+ size={Size.XSMALL}
+ onPointerDown={e =>
+ setupMoveUpEvents(
+ this,
+ e,
+ returnFalse,
+ emptyFunction,
+ undoable(e => {
+ e.stopPropagation();
+ this.props.addDocTab(this.rootDoc, OpenWhere.addRight);
+ }, 'Open schema Doc preview')
+ )
+ }
+ />
</div>
<div className="row-cells">
{this.schemaView?.columnKeys?.map((key, index) => (