1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-10 18:02:51 +00:00

getting ready to ship

This commit is contained in:
2016-09-18 17:13:21 +00:00
parent 11a91412c1
commit 87d941804a
14 changed files with 66 additions and 27 deletions

View File

@@ -2,6 +2,7 @@
flex: 1;
flex-wrap: wrap;
min-width: 0;
min-height: 600px;
.post+ .post {
margin-top: 2em;
}
@@ -14,6 +15,7 @@
width: 7em;
text-align: right;
margin-left: -8em;
line-height: 2.5em;
}
}
.intro {

View File

@@ -7,4 +7,13 @@
border-color: #DADADA;
font-weight: 300;
margin-top: 1em;
display: flex;
padding-right: calc(50% - 997px / 2);
padding-left: calc(50% - 997px / 2);
&:after,
&:before {
content: " ";
width: 1em;
}
}

View File

@@ -0,0 +1,12 @@
.Header {
width: 100%;
background: url("../images/header.jpg");
background-size: cover;
height: 30em;
border-bottom: solid;
border-width: 1px;
border-color: #DADADA;
h1 {
text-align: center;
}
}

View File

@@ -67,7 +67,6 @@ select{
}
}
.Footer,
.Main {
display: flex;
padding-right: calc(50% - 997px / 2);
@@ -83,19 +82,6 @@ select{
padding-top: 1em;
}
.Header {
width: 100%;
background: url("../images/header.jpg");
background-size: cover;
height: 30em;
border-bottom: solid;
border-width: 1px;
border-color: #DADADA;
h1 {
text-align: center;
}
}
.Loading {
display: flex;
flex: 1;

View File

@@ -7,7 +7,7 @@ export default class Footer extends React.Component {
render() {
return (
<div class="Footer">
Site created and maintained by Mitchell Gerber
Site created by Mitchell Gerber
</div>
);
}

View File

@@ -1,6 +1,8 @@
import React from 'react';
import {bubble} from '../../assets/js/bubble';
import '../../assets/scss/Header.scss';
export default class Header extends React.Component {
componentDidMount() {
bubble();

View File

@@ -14,18 +14,20 @@ const LineChart = Chart.Line;
export default class SensorInfo extends React.Component {
componentDidMount() {
componentWillMount() {
let location = this.props.params.location;
this.props.sensorActions.fetchUniqueDates(location);
}
componentWillReceiveProps(nextProps) {
componentWillUpdate(nextProps) {
let currentLocation = this.props.params.location,
nextLocation = nextProps.params.location;
currentLocation !== nextLocation ? this.props.sensorActions.fetchUniqueDates(nextLocation) : null;
if (currentLocation !== nextLocation){
this.props.sensorActions.fetchUniqueDates(nextLocation);
}
}
loadYearOptions = (date, index) => {
return (
<option key={index} value={index}>{date.year}</option>
@@ -64,7 +66,6 @@ export default class SensorInfo extends React.Component {
filterData(data) {
let temp = JSON.parse(JSON.stringify(DataTemplate));
console.log(temp);
for (let d of data) {
let label = `${d.month}/${d.day}`;
temp.labels.push(label);

View File

@@ -4,11 +4,12 @@
flex-direction: column;
align-items: center;
min-width: 0;
min-height: 600px;
width: 80%;
.selector-row{
display: flex;
justify-content: center;
margin-bottom: 1em;
margin-bottom: 2em;
select{
margin-left: 5px;
}

View File

@@ -35,7 +35,12 @@ export default class SensorList extends React.Component {
</div>
<div class="item">
<h3>{sensor.location}</h3>
<span class="date">Updated: {date.toLocaleString('en-us', options)}</span>
<span class="date">Updated: {date.toLocaleString('en-us', options)}
{Date.now() - date < 420000
? <span class="connected"> Connected</span>
: <span class="disconnected"> Disconnected</span>
}
</span>
</div>
</div>
);

View File

@@ -25,4 +25,11 @@
}
}
.connected{
color: green;
}
.disconnected{
color: red;
}
}

View File

@@ -1,4 +1,5 @@
import React from 'react';
import {Link} from 'react-router';
import me from '../../../assets/images/me.jpg';
@@ -12,7 +13,10 @@ export default class AboutMe extends React.Component{
<p>
My name is Mitchell and I have a passion for software development. I am currently a software engineer and enjoy working on personal projects in my free time.
</p>
<p>
<i class="fa fa-home" aria-hidden="true"></i>
<Link to={"/"} class="link"> Home</Link>
</p>
<p>
<i class="fa fa-envelope" aria-hidden="true"></i>
<a class="link" href="mailto:mgerb42@gmail.com"> eMail</a>
@@ -25,10 +29,12 @@ export default class AboutMe extends React.Component{
<i class="fa fa-github" aria-hidden="true"></i>
<a class="link" href="https://github.com/mgerb" target="_blank"> GitHub</a>
</p>
{/*
<p>
<i class="fa fa-wpforms" aria-hidden="true"> </i>
<a href="/resume" class="link"> Resume</a>
</p>
*/}
</div>
);
}

View File

@@ -96,9 +96,14 @@ export function fetchSensorInfoMonth(location, year, month){
}
}
//this is called to initialize the sensor info page
//reloads unique dates and resets indexes
//then fetches new data for chart
export function fetchUniqueDates(location){
return (dispatch) => {
dispatch(fetchingUniqueDates());
dispatch(setSelectedMonthIndex(0));
dispatch(setSelectedYearIndex(0));
return fetch(`/api/uniquedates/${location}`)
.then(response => response.json())
.then(json => {

View File

@@ -6,7 +6,10 @@ import {syncHistoryWithStore} from 'react-router-redux';
import reducers from './reducers/reducers';
const middleware = applyMiddleware(thunk, logger());
const debug = process.env.NODE_ENV !== "production";
//run redux logger if we are in dev mode
const middleware = debug ? applyMiddleware(thunk, logger()) : applyMiddleware(thunk);
//create the new store with default state as an empty object
const store = createStore(reducers, {}, middleware);