Skip to content

Commit

Permalink
feat(Viewscreen): Add the Sensors Grid as a viewscreen card. Closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Anderson committed Mar 20, 2020
1 parent 5585f4d commit 3d83765
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 73 deletions.
Binary file added public/viewscreen/Sensors.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 83 additions & 73 deletions src/components/views/Sensors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class Sensors extends Component {
const {pingMode} = sensors;
const pings = false;
const {hoverContact, ping, pingTime, weaponsRange} = this.state;
const {viewscreen} = this.props;
return (
<div className="cardSensors">
<SubscriptionHelper
Expand All @@ -230,25 +231,26 @@ class Sensors extends Component {
/>
<div>
<Row>
{needScans && (
<Col sm={3}>
<DamageOverlay
message="External Sensors Offline"
system={sensors}
/>
<SensorScans sensors={sensors} client={this.props.client} />
{pings && (
<PingControl
selectPing={this.selectPing}
pingMode={pingMode}
ping={ping}
triggerPing={this.triggerPing}
<Col sm={3}>
{!viewscreen && needScans && (
<>
<DamageOverlay
message="External Sensors Offline"
system={sensors}
/>
)}
<Button onClick={this.showWeaponsRange.bind(this)} block>
Show Weapons Range
</Button>
{/*<Row>
<SensorScans sensors={sensors} client={this.props.client} />
{pings && (
<PingControl
selectPing={this.selectPing}
pingMode={pingMode}
ping={ping}
triggerPing={this.triggerPing}
/>
)}
<Button onClick={this.showWeaponsRange.bind(this)} block>
Show Weapons Range
</Button>
{/*<Row>
<Col className="col-sm-12">
<h4>Contact Coordinates</h4>
</Col>
Expand All @@ -261,8 +263,9 @@ class Sensors extends Component {
</Col>
</Row>
*/}
</Col>
)}
</>
)}
</Col>
<Col
sm={{size: 6, offset: !needScans ? 1 : 0}}
className="arrayContainer"
Expand Down Expand Up @@ -330,59 +333,66 @@ class Sensors extends Component {
/>
</Col>
<Col sm={{size: 3, offset: !needScans ? 1 : 0}} className="data">
<Row className="contact-info">
<Col className="col-sm-12">
<h3>Contact Information</h3>
</Col>
<Col className="col-sm-12">
<div className="card contactPictureContainer">
{hoverContact.picture && (
<div
className="contactPicture"
style={{
backgroundSize: "contain",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
backgroundColor: "black",
backgroundImage: `url('/assets${hoverContact.picture}')`,
}}
/>
)}
</div>
</Col>
<Col className="col-sm-12 contactNameContainer">
<div className="card contactName">{hoverContact.name}</div>
</Col>
</Row>
<Row>
<Col className="col-sm-12">
<h3>Processed Data</h3>
</Col>
<Col className="col-sm-12">
<Card className="processedData">
<CardBody>
<pre>
<Typing keyDelay={20} key={sensors.processedData}>
{sensors.processedData}
</Typing>
</pre>
</CardBody>
</Card>
</Col>
</Row>
{pings && !needScans && (
<PingControl
selectPing={this.selectPing}
pingMode={pingMode}
ping={ping}
triggerPing={this.triggerPing}
/>
)}
{!needScans && (
<Button onClick={this.showWeaponsRange} block>
Show Weapons Range
</Button>
)}
{!viewscreen ? (
<>
<Row className="contact-info">
<Col className="col-sm-12">
<h3>Contact Information</h3>
</Col>
<Col className="col-sm-12">
<div className="card contactPictureContainer">
{hoverContact.picture && (
<div
className="contactPicture"
style={{
backgroundSize: "contain",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
backgroundColor: "black",
backgroundImage: `url('/assets${hoverContact.picture}')`,
}}
/>
)}
</div>
</Col>
<Col className="col-sm-12 contactNameContainer">
<div className="card contactName">
{hoverContact.name}
</div>
</Col>
</Row>

<Row>
<Col className="col-sm-12">
<h3>Processed Data</h3>
</Col>
<Col className="col-sm-12">
<Card className="processedData">
<CardBody>
<pre>
<Typing keyDelay={20} key={sensors.processedData}>
{sensors.processedData}
</Typing>
</pre>
</CardBody>
</Card>
</Col>
</Row>
{pings && !needScans && (
<PingControl
selectPing={this.selectPing}
pingMode={pingMode}
ping={ping}
triggerPing={this.triggerPing}
/>
)}
{!needScans && (
<Button onClick={this.showWeaponsRange} block>
Show Weapons Range
</Button>
)}
</>
) : null}
</Col>
</Row>
</div>
Expand Down
12 changes: 12 additions & 0 deletions src/components/viewscreens/Sensors/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";
import SensorsGrid from "components/views/Sensors";
import {Container} from "helpers/reactstrap";
const Sensors = props => {
return (
<Container fluid style={{paddingTop: "100px"}}>
<SensorsGrid {...props} clientObj={{}} station={{cards: []}} viewscreen />
</Container>
);
};

export default Sensors;
1 change: 1 addition & 0 deletions src/components/viewscreens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export {default as LowPower} from "./LowPower";
export {default as Picture} from "./Picture";
export {default as Objectives} from "./Objectives";
export {default as Tasks} from "./Tasks";
export {default as Sensors} from "./Sensors";

export {default as InformationConfig} from "./Information/config";
export {default as InternalSensorsConfig} from "./InternalSensors/config";
Expand Down

0 comments on commit 3d83765

Please sign in to comment.