Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

Merge staging features #32

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion api/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const login = async (email, password) => {
return await axios
.post(AUTH_LOGIN, user)
.then(res => res.data)
// .catch(error => this.handleErrorResponse(error));
}

export const logout = () => {
Expand Down
6 changes: 3 additions & 3 deletions components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Header extends React.Component {
Add Apiary
</Button>
}
{user.role === "beelover" &&
{/* {user.role === "beelover" &&
<Button
variant="contained"
color={this.state.isTop ? "secondary" : "white"}
Expand All @@ -118,10 +118,10 @@ class Header extends React.Component {
>
Fundings
</Button>
}
} */}
<Link
variant="button"
href={"/" + user.role}
// href={"/" + user.role}
className={this.state.isTop ? classes.linkBlack : classes.linkWhite}
>
{"Hello " + user.name}
Expand Down
30 changes: 2 additions & 28 deletions components/Hero/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import { Container, Typography } from "@material-ui/core";
import { Container } from "@material-ui/core";
import { makeStyles } from '@material-ui/core/styles';
import Card from "@material-ui/core/Card";
import CardHeader from "@material-ui/core/CardHeader";
import StarIcon from "@material-ui/core/SvgIcon/SvgIcon";
import CardContent from "@material-ui/core/CardContent";
import Grid from "@material-ui/core/Grid";
import React from "react";

import taxiWaiting from '../../assets/images/taxiWaiting.png';
import vector from '../../assets/images/Vector.png';
import Logo from "../../assets/images/logo/black_on_yellow.png";

const useStyles = makeStyles(theme => ({
heroContent: {
Expand All @@ -33,27 +27,7 @@ const useStyles = makeStyles(theme => ({
textAlign: 'center'
}
}));
/*
<Typography
component="h1"
variant="h2"
align="center"
color="textPrimary"
gutterBottom
>
Hero Message
</Typography>
<Typography
variant="h5"
align="center"
color="textSecondary"
component="p"
>
Quickly build an effective pricing table for your potential customers
with this layout. It&apos;s built with default Material-UI components
with little customization.
</Typography>
*/

function Hero() {
const classes = useStyles();
return (
Expand Down
59 changes: 49 additions & 10 deletions components/LineChart/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// <reference path="../Plot/react-vis.d.ts"/>
import React, { Component } from "react";
import Button from "@material-ui/core/Button";
//import "react-vis/dist/style.css";
import {
XYPlot,
XAxis,
Expand All @@ -18,12 +17,16 @@ const styles = theme => ({
ButtonContent: {
padding: theme.spacing(1, 5, 6),
marginTop: 6
},
button: {
margin: theme.spacing(1, 0.5),
alignSelf: "center"
}
});

class LineChart extends Component {
render() {
const { labels, values } = this.props;
const { labels, values, x_axis, y_axis } = this.props;
const { classes } = this.props;
const error =
this.props.labels.length == 0 && this.props.values.length == 0;
Expand All @@ -34,7 +37,7 @@ class LineChart extends Component {
<HorizontalGridLines style={{ stroke: "#B7E9ED" }} />
<VerticalGridLines style={{ stroke: "#B7E9ED" }} />
<XAxis
title="X Axis"
title={this.props.x_axis}
tickFormat={v => labels[v]}
tickLabelAngle={-45}
style={{
Expand All @@ -44,12 +47,13 @@ class LineChart extends Component {
}}
/>

<YAxis title="Y Axis" />
<YAxis title={this.props.y_axis} />
<LineSeries
className="first-series"
data={values}
style={{
strokeLinejoin: "round",
fill: "none",
strokeWidth: 4
}}
/>
Expand All @@ -58,53 +62,88 @@ class LineChart extends Component {
{!error ? (
<Container className={classes.ButtonContent}>
<Button
className={classes.button}
variant="outlined"
color="secondary"
size="small"
onClick={() => this.props.handleChangeData("temperature")}
onClick={() => this.props.handleChangeData("temperature", null)}
>
Temperature
</Button>
<Button
className={classes.button}
variant="outlined"
color="secondary"
size="small"
onClick={() => this.props.handleChangeData("pressure")}
onClick={() => this.props.handleChangeData("pressure", null)}
>
Pressure
</Button>
<Button
className={classes.button}
variant="outlined"
color="secondary"
size="small"
onClick={() => this.props.handleChangeData("light")}
onClick={() => this.props.handleChangeData("light", null)}
>
Light
</Button>
<Button
className={classes.button}
variant="outlined"
color="secondary"
size="small"
onClick={() => this.props.handleChangeData("noise")}
onClick={() => this.props.handleChangeData("noise", null)}
>
Noise
</Button>
<Button
className={classes.button}
variant="outlined"
color="secondary"
size="small"
onClick={() => this.props.handleChangeData("accelerometer")}
onClick={() => this.props.handleChangeData("accelerometer", null)}
>
Accelerometer
</Button>
<Button
className={classes.button}
variant="outlined"
color="secondary"
size="small"
onClick={() => this.props.handleChangeData("humidity")}
onClick={() => this.props.handleChangeData("humidity", null)}
>
Humidity
</Button>
<Container>
<Button
className={classes.button}
variant="contained"
color="secondary"
size="small"
onClick={() => this.props.handleChangeData(null, "hour")}
>
Hour
</Button>
<Button
className={classes.button}
variant="contained"
color="secondary"
size="small"
onClick={() => this.props.handleChangeData(null, "minute")}
>
Minute
</Button>
<Button
className={classes.button}
variant="contained"
color="secondary"
size="small"
onClick={() => this.props.handleChangeData(null, "day")}
>
Day
</Button>
</Container>
</Container>
) : (
""
Expand Down
7 changes: 5 additions & 2 deletions components/OverallChart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class OverallChart extends Component {
this.props.values.length != 0
? this.props.values
: new Array(6).fill("loading");
var status_color = "";
if (this.props.status == "healthy") status_color = "#4bb543";
else status_color = "#ff0000";

const newData = [
{ x: 3.2, y: 2.4, reading: values[0], type: "Temperature", unity: "ºC" },
Expand Down Expand Up @@ -97,9 +100,9 @@ class OverallChart extends Component {
animation
className="hexbin-example"
style={{
stroke: "black",
stroke: status_color,
strokeLinejoin: "round",
strokeWidth: 3
strokeWidth: 2
}}
xOffset={0}
yOffset={0}
Expand Down
Loading