This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import TeslaCounter from '../components/TeslaCounter/TeslaCounter'; | |
import { connect } from 'react-redux'; | |
import { temperatureUp, temperatureDown } from '../actions' | |
import { counterDefaultVal } from '../constants/counterDefaultVal'; | |
const mapStateToProps = (state) => { | |
return { | |
currentValue: state.config.temperature, | |
initValues: counterDefaultVal.temperature | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import TeslaClimate from '../components/TeslaClimate/TeslaClimate'; | |
import { connect } from 'react-redux'; | |
import { changeClimate } from '../actions' | |
const mapStateToProps = (state) => { | |
return { | |
value: state.config.climate, | |
limit: state.config.temperature > 10 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import TeslaWheels from '../components/TeslaWheels/TeslaWheels'; | |
import { connect } from 'react-redux'; | |
import { changeWheel } from '../actions' | |
const mapStateToProps = (state) => { | |
return { | |
value: state.config.wheels | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { createStore } from 'redux'; | |
import { Provider } from 'react-redux'; | |
import TeslaCarContainer from './containers/TeslaCarContainer'; | |
import TeslaStatsContainer from './containers/TeslaStatsContainer'; | |
import TeslaSpeedCounterContainer from './containers/TeslaSpeedCounterContainer'; | |
import TeslaTempCounterContainer from './containers/TeslaTempCounterContainer'; | |
import TeslaClimateContainer from './containers/TeslaClimateContainer'; | |
import TeslaWheelsContainer from './containers/TeslaWheelsContainer'; | |
import TeslaNotice from './components/TeslaNotice/TeslaNotice'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import './TeslaCounter.css'; | |
const TeslaCounter = ({ initValues, currentValue, increment, decrement }) => ( | |
<div className="tesla-counter"> | |
<p className="tesla-counter__title">{initValues.title}</p> | |
<div className="tesla-counter__container cf"> | |
<div className="tesla-counter__item"> | |
<p className="tesla-counter__number"> | |
{ currentValue } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { counterDefaultVal } from '../constants/counterDefaultVal'; | |
export const speedUp = (value) => { | |
return { | |
type: 'SPEED_UP', | |
value, | |
step: counterDefaultVal.speed.step, | |
maxValue: counterDefaultVal.speed.max | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const counterDefaultVal = { | |
speed: { | |
title: "Speed", | |
unit: "mph", | |
step: 5, | |
min: 45, | |
max: 70 | |
}, | |
temperature: { | |
title: "Outside Temperature", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wrapper { | |
margin: 100px 0 150px; | |
} | |
.tesla-battery { | |
width: 1050px; | |
margin: 0 auto; | |
} | |
.tesla-battery h1 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.header { | |
padding: 25px 0; | |
text-align: center; | |
background: #222; | |
} | |
.header img { | |
width: 100px; | |
height: 13px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import './Header.css'; | |
import logoUrl from '../../assets/logo.svg'; | |
const Header = () => ( | |
<div className="header header-animation"> | |
<img src={logoUrl} alt="Tesla" /> | |
</div> | |
) |