2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt odlux
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
18 import * as React from 'react';
\r
20 import connect, { Connect } from '../../flux/connect';
\r
22 import { SetTitleAction } from '../../actions/titleActions';
\r
23 import { AddErrorInfoAction } from '../../actions/errorActions';
\r
25 import { IconType } from '../../models/iconDefinition';
\r
27 export interface IAppFrameProps {
\r
34 * Represents a component to wich will embed each single app providing the
\r
35 * functionality to update the title and implement an exeprion border.
\r
37 export class AppFrame extends React.Component<IAppFrameProps & Connect> {
\r
39 public render(): JSX.Element {
\r
41 <div style={{ flex: "1", overflow: "auto", display: "flex", flexDirection: "column" }}>
\r
42 { this.props.children }
\r
47 public componentDidMount() {
\r
48 this.props.dispatch(new SetTitleAction(this.props.title, this.props.icon, this.props.appId));
\r
50 public componentDidCatch(error: Error | null, info: object) {
\r
51 this.props.dispatch(new AddErrorInfoAction({ error, info }));
\r
55 export default connect()(AppFrame);