This repository has been archived by the owner on Sep 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathViewport.tsx
40 lines (37 loc) · 1.55 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
33
34
35
36
37
38
39
40
/*---------------------------------------------------------------------------------------------
* Copyright (c) 2019 Bentley Systems, Incorporated. All rights reserved.
* Licensed under the MIT License. See LICENSE.md in the project root for license terms.
*--------------------------------------------------------------------------------------------*/
import * as React from "react";
import { Id64String } from "@bentley/bentleyjs-core";
import { IModelConnection } from "@bentley/imodeljs-frontend";
import { ViewportComponent } from "@bentley/ui-components";
import { viewWithUnifiedSelection } from "@bentley/presentation-components";
import Toolbar from "./Toolbar";
// 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 Props {
/** iModel whose contents should be displayed in the viewport */
imodel: IModelConnection;
/** View definition to use when the viewport is first loaded */
viewDefinitionId: Id64String;
/** 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<Props> {
public render() {
return (
<>
<SimpleViewport
imodel={this.props.imodel}
ruleset={this.props.rulesetId}
viewDefinitionId={this.props.viewDefinitionId}
/>
<Toolbar />
</>
);
}
}