aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocComponent.tsx
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2023-03-23 15:16:40 -0400
committermehekj <mehek.jethani@gmail.com>2023-03-23 15:16:40 -0400
commit5c22004907c210951154017609746e86362c4fb5 (patch)
tree108371dccd171c6bd523a01dc3f39a657d85ad96 /src/client/views/DocComponent.tsx
parent016e51965ae2d0a83ca2d4e17000d57a40aac264 (diff)
parent923f0fdb0f039a923e4e6f870158bd2f2ba32db0 (diff)
Merge branch 'master' into schema-mehek
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r--src/client/views/DocComponent.tsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx
index 7c81d92d4..0b92fd864 100644
--- a/src/client/views/DocComponent.tsx
+++ b/src/client/views/DocComponent.tsx
@@ -16,6 +16,7 @@ import { Touchable } from './Touchable';
/// DocComponent returns a generic React base class used by views that don't have 'fieldKey' props (e.g.,CollectionFreeFormDocumentView, DocumentView)
export interface DocComponentProps {
Document: Doc;
+ fieldKey?: string;
LayoutTemplate?: () => Opt<Doc>;
LayoutTemplateString?: string;
}
@@ -37,6 +38,10 @@ export function DocComponent<P extends DocComponentProps>() {
@computed get dataDoc() {
return this.props.Document[DataSym] as Doc;
}
+ // key where data is stored
+ @computed get fieldKey() {
+ return this.props.fieldKey;
+ }
protected _multiTouchDisposer?: InteractionUtils.MultiTouchEventDisposer;
}