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 TeslaStats from '../components/TeslaStats/TeslaStats'; | |
import { connect } from 'react-redux'; | |
const mapStateToProps = (state) => { | |
return { | |
carstats: state.carstats | |
} | |
} | |
const TeslaStatsContainer = connect(mapStateToProps, null)(TeslaStats) |
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 { speedUp, speedDown } from '../actions' | |
import { counterDefaultVal } from '../constants/counterDefaultVal'; | |
const mapStateToProps = (state) => { | |
return { | |
currentValue: state.config.speed, | |
initValues: counterDefaultVal.speed | |
} |
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 { 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> | |
) |
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'; | |
class TeslaCounter extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
direction: '' | |
} | |
} |