forked from imodeljs/imodeljs-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Viewport.tsx
32 lines (29 loc) · 1.33 KB
/
Viewport.tsx
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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import * as React from "react";
import { ViewportComponent, ViewportProps } from "@bentley/ui-components";
import { viewWithUnifiedSelection } from "@bentley/presentation-components";
// create a HOC viewport component that supports unified selection
// tslint:disable-next-line:variable-name
const SimpleViewport = viewWithUnifiedSelection(ViewportComponent);
/** React properties for the viewport component */
export interface SimpleViewportComponentProps extends ViewportProps {
/** ID of the presentation rule set to use for unified selection */
rulesetId: string;
}
/** Viewport component for the viewer app */
export default class SimpleViewportComponent extends React.Component<SimpleViewportComponentProps> {
public render() {
return (
<SimpleViewport
viewportRef={this.props.viewportRef}
imodel={this.props.imodel}
viewDefinitionId={this.props.viewDefinitionId}
viewState={this.props.viewState}
ruleset={this.props.rulesetId}
/>
);
}
}