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 React from 'react';
20 import { connect, Connect } from '../../flux/connect';
22 import { SetTitleAction } from '../../actions/titleActions';
23 import { AddErrorInfoAction } from '../../actions/errorActions';
25 import { IconType } from '../../models/iconDefinition';
27 export interface IAppFrameProps {
34 * Represents a component to wich will embed each single app providing the
35 * functionality to update the title and implement an exeprion border.
37 export class AppFrame extends React.Component<IAppFrameProps & Connect> {
39 public render(): JSX.Element {
41 <div style={{ flex: "1", overflow: "hidden", display: "flex", flexDirection: "column" }}>
42 { this.props.children }
47 public componentDidMount() {
48 this.props.dispatch(new SetTitleAction(this.props.title, this.props.icon, this.props.appId));
50 public componentDidCatch(error: Error | null, info: object) {
51 this.props.dispatch(new AddErrorInfoAction({ error, info }));
55 export default connect()(AppFrame);