2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
24 import React from 'react';
25 import styled from 'styled-components';
26 import MenuBar from '../menu/MenuBar';
27 import Navbar from 'react-bootstrap/Navbar';
28 import logo from './logo.png';
29 import { GlobalClampStyle } from '../../theme/globalStyle.js';
31 import ClosedLoopSvg from '../loop_viewer/svg/ClosedLoopSvg';
32 import ClosedLoopLogs from '../loop_viewer/logs/ClosedLoopLogs';
33 import ClosedLoopStatus from '../loop_viewer/status/ClosedLoopStatus';
35 const ProjectNameStyle = styled.a`
36 vertical-align: middle;
41 const LoopViewDivStyle = styled.div`
47 color: ${props => props.theme.loopViewerFontColor};
48 background-color: ${props => props.theme.loopViewerBackgroundColor};
49 border: 1px solid transparent;
50 border-color: ${props => props.theme.loopViewerHeaderBackgroundColor};
53 const LoopViewHeaderDivStyle = styled.div`
54 background-color: ${props => props.theme.loopViewerHeaderBackgroundColor};
56 color: ${props => props.theme.loopViewerHeaderFontColor};
59 const LoopViewBodyDivStyle = styled.div`
60 background-color: ${props => (props.theme.loopViewerBackgroundColor)};
62 color: ${props => (props.theme.loopViewerHeaderFontColor)};
66 const LoopViewLoopNameSpanStyle = styled.span`
68 color: ${props => (props.theme.loopViewerHeaderFontColor)};
69 background-color: ${props => (props.theme.loopViewerHeaderBackgroundColor)};
72 export default class LoopUI extends React.Component {
74 loopName="Empty (NO loop loaded yet)";
82 renderUserLoggedNavBar() {
85 Signed in as: <a href="login">{localStorage.getItem('user')}</a>
93 <img height="50px" width="234px" src={logo} alt=""/>
94 <ProjectNameStyle>CLAMP</ProjectNameStyle>
102 {this.renderLogoNavBar()}
103 {this.renderMenuNavBar()}
104 {this.renderUserLoggedNavBar()}
109 renderLoopViewHeader() {
111 <LoopViewHeaderDivStyle>
112 Loop Viewer - <LoopViewLoopNameSpanStyle id="loop_name">{this.loopName}</LoopViewLoopNameSpanStyle>
113 </LoopViewHeaderDivStyle>
117 renderLoopViewBody() {
119 <LoopViewBodyDivStyle>
123 </LoopViewBodyDivStyle>
130 {this.renderLoopViewHeader()}
131 {this.renderLoopViewBody()}
140 {this.renderNavBar()}
141 {this.renderLoopViewer()}