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 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 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 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 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 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 TeslaCar from '../components/TeslaCar/TeslaCar'; | |
import { connect } from 'react-redux'; | |
const mapStateToProps = (state) => { | |
return { | |
wheelsize: state.config.wheels | |
} | |
} | |
const TeslaCarContainer = connect(mapStateToProps, null)(TeslaCar) |
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 appReducer from './teslaRangeApp'; | |
const initialState = { | |
carstats:[ | |
{miles:246, model:"60"}, | |
{miles:250, model:"60D"}, | |
{miles:297, model:"75"}, | |
{miles:306, model:"75D"}, | |
{miles:336, model:"90D"}, | |
{miles:376, model:"P100D"} |
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 { getModelData } from '../services/BatteryService'; | |
const initialState = { | |
carstats: [ | |
{ miles: 246, model: "60" }, | |
{ miles: 250, model: "60D" }, | |
{ miles: 297, model: "75" }, | |
{ miles: 306, model: "75D" }, | |
{ miles: 336, model: "90D" }, | |
{ miles: 376, model: "P100D" } |
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 appReducer from './teslaRangeApp'; | |
const initialState = { | |
carstats:[ | |
{miles:246, model:"60"}, | |
{miles:250, model:"60D"}, | |
{miles:297, model:"75"}, | |
{miles:306, model:"75D"}, | |
{miles:336, model:"90D"}, | |
{miles:376, model:"P100D"} |