Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
56 changes: 42 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';
import CounterButton from "./components/CounterButton";
import SpecialTextBox from "./components/SpecialTextBox";
import Counter from "./components/Counter";
import SpecialText from "./components/SpecialText";
import CounterButton from "./containers/CounterBottonContainer";
import SpecialTextBox from "./containers/SpecialTextBoxContainer";
import Counter from "./containers/CounterContainer";
import SpecialText from "./containers/SearchTextBoxContainer";
import UserButtons from "./components/UserButtons";
import Thermostat from "./components/Thermostat";
import Users from "./components/Users";
import ChangeTemperature from "./components/ChangeTemperature";
import VideoPlayer from "./components/VideoPlayer";
import VideoTextBox from "./components/VideoTextBox";
import CurrentCity from "./components/CurrentCity";
import CityDropDown from "./components/CityDropDown";
import SearchTextBox from "./components/SearchTextBox";
import Thermostat from "./containers/ThermostatContainer";
import Users from "./containers/UsersContainer";
import ChangeTemperature from "./containers/ChangeTemperatureContainer";
import VideoPlayer from "./containers/VideoPlayerContainer";
import VideoTextBox from "./containers/VideoTextBoxContainer";
import CurrentCity from "./containers/CurrentCityContainer";
import CityDropDown from "./containers/CityDropDownContainer";
import SearchTextBox from "./containers/SearchTextBoxContainer";
import SortUsers from "./components/SortUsers";
import ScaleVideo from "./components/ScaleVideo";
import Modal from "./components/Modal";
Expand Down
35 changes: 35 additions & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ export function increaseCounter(){
}
}

export function decreaseCounter(){
return {
type:"DECREASE_COUNTER"
}
}

export function setSpecialText(txt){
return {
type:"SET_SPECIAL_TEXT",
Expand All @@ -21,4 +27,33 @@ export function removeUser(){
return {
type:"REMOVE_USER"
}
}

export function setCurrentCity(city) {
return {
type: "SET_CURRENT_CITY",
value: city
}
}

export function setCurrentTemperature(temperature) {
return {
type: "SET_CURRENT_TEMPERATURE",
value: temperature
}
}

export function setVideoUrl(url) {
return {
type: "SET_VIDEO_URL",
value: url
}
}


export function setFirstNameFilter(firstName) {
return {
type: "SET_FIRST_NAME",
value: firstName
}
}
1 change: 1 addition & 0 deletions src/components/CityDropDown.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function CityDropDown(props) {
}
}
}>
<option value="none">---</option>
<option value="Austin">Austin</option>
<option value="New York">New York</option>
<option value="New Olreans">New Olreans</option>
Expand Down
16 changes: 2 additions & 14 deletions src/components/SpecialTextBox.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import {connect} from "react-redux";
import {setSpecialText} from "../actions";

function SpecialTextBox(props) {
export default function SpecialTextBox(props) {
return (
<div>
Enter Special Text:
Expand All @@ -13,14 +11,4 @@ function SpecialTextBox(props) {
}} />
</div>
);
}

function mapDispatchToProps(dispatch){
return {
set:function(txt){
let action = setSpecialText(txt)
dispatch(action);
}
}
}
export default (SpecialTextBox);
}
3 changes: 1 addition & 2 deletions src/components/UserButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ function UserButtons(props) {
if(props.add){
props.add({
"id": 1,
"first_name": "george",
"last_name": "bluth",
"name": "George Bluth",
"address": "4116 Magnolia Drive, Portland, ME 04103",
"phone": 15551234567,
"occupation": "father",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function Users(props) {
(props.firstNameFilter &&
u.name.indexOf(props.firstNameFilter) > -1);
})
usersDivs = usersDivs.map(function(u){
return <div>{u.name}</div>
usersDivs = usersDivs.map(function(u, i){
return <div key={i}>{u.name}</div>
})
}
return (
Expand Down
11 changes: 11 additions & 0 deletions src/containers/ChangeTemperatureContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { connect } from 'react-redux';
import {setCurrentTemperature} from "../actions";
import ChangeTemperature from "../components/ChangeTemperature";


const mapDispatchToProps = {
set:setCurrentTemperature
}


export default connect(null,mapDispatchToProps)(ChangeTemperature);
11 changes: 11 additions & 0 deletions src/containers/CityDropDownContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { connect } from 'react-redux';
import {setCurrentCity} from "../actions";
import CityDropDown from "../components/CityDropDown";


const mapDispatchToProps = {
set:setCurrentCity
}


export default connect(null,mapDispatchToProps)(CityDropDown);
Loading