aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/importBox/ImportElementBox.tsx
blob: 7d0086c0c07626cc42bf47d0c2d799c32684cf28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { computed } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { returnFalse } from '../../../../Utils';
import { Doc } from '../../../../fields/Doc';
import { ViewBoxBaseComponent } from '../../DocComponent';
import { DocumentView } from '../DocumentView';
import { FieldView, FieldViewProps } from '../FieldView';

@observer
export class ImportElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
    public static LayoutString(fieldKey: string) {
        return FieldView.LayoutString(ImportElementBox, fieldKey);
    }

    screenToLocalXf = () => this.ScreenToLocalBoxXf().scale(1 * (this._props.NativeDimScaling?.() || 1));
    @computed get mainItem() {
        return (
            <div style={{ backgroundColor: 'pink' }}>
                <DocumentView
                    {...this._props} //
                    LayoutTemplateString={undefined}
                    Document={this.Document}
                    isContentActive={returnFalse}
                    addDocument={returnFalse}
                    ScreenToLocalTransform={this.screenToLocalXf}
                    hideResizeHandles={true}
                />
            </div>
        );
    }
    render() {
        return !(this.Document instanceof Doc) ? null : this.mainItem;
    }
}