aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-11-15 10:30:43 -0500
committerbobzel <zzzman@gmail.com>2023-11-15 10:30:43 -0500
commit570e96292219a7c7c9fe496ba0606cc6b9f72abf (patch)
tree4231c09622b38ef4c39ce54bff7bbce448d7412e /src/client/views/collections/collectionSchema/SchemaRowBox.tsx
parent20dba0dcdea12b6a6246973cb578ab5639316bfa (diff)
schema code cleanup
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaRowBox.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaRowBox.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
index ab27aac8f..7346c4f12 100644
--- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
@@ -20,10 +20,13 @@ import { CollectionSchemaView } from './CollectionSchemaView';
import './CollectionSchemaView.scss';
import { SchemaTableCell } from './SchemaTableCell';
+interface SchemaRowBoxProps {
+ rowIndex: number;
+}
@observer
-export class SchemaRowBox extends ViewBoxBaseComponent<FieldViewProps>() {
- public static LayoutString(fieldKey: string) {
- return FieldView.LayoutString(SchemaRowBox, fieldKey);
+export class SchemaRowBox extends ViewBoxBaseComponent<FieldViewProps & SchemaRowBoxProps>() {
+ public static LayoutString(fieldKey: string, rowIndex: number) {
+ return FieldView.LayoutString(SchemaRowBox, fieldKey).replace('fieldKey', `rowIndex={${rowIndex}} fieldKey`);
}
private _ref: HTMLDivElement | null = null;
@@ -169,7 +172,7 @@ export class SchemaRowBox extends ViewBoxBaseComponent<FieldViewProps>() {
transform={() => {
const ind = index === this.schemaView.columnKeys.length - 1 ? this.schemaView.columnKeys.length - 3 : index;
const x = this.schemaView?.displayColumnWidths.reduce((p, c, i) => (i <= ind ? p + c : p), 0);
- const y = (this.props.yPadding ?? 0) * this.props.PanelHeight();
+ const y = (this.props.rowIndex ?? 0) * this.props.PanelHeight();
return new Transform(x + CollectionSchemaView._rowMenuWidth, y, 1);
}}
/>