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
6,912 changes: 3,456 additions & 3,456 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
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 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 SortUsers from "./components/SortUsers";
import ScaleVideo from "./components/ScaleVideo";
import Modal from "./components/Modal";
import ShowModal from "./components/ShowModal";
import CounterButton from "./containers/CounterButtonContainer";
import SpecialTextBox from "./containers/SpecialTextBoxContainer";
import Counter from "./containers/CounterContainer";
import SpecialText from "./containers/SpecialTextContainer";
import UserButtons from "./containers/UserButtonsContainer";
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 "./containers/SortUsersContainer";
import ScaleVideo from "./containers/ScaleVideoContainer";
//import Modal from "./containers/ModalContainer";
import ShowModal from "./containers/ShowModalContainer";

function App() {
return (
Expand Down Expand Up @@ -53,12 +53,13 @@ function App() {
<VideoPlayer />
<br />


</div>
<div className="container">
<Users />
</div>
<Modal />



</div>
);
}
Expand Down
61 changes: 58 additions & 3 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ export function increaseCounter(){
}
}

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

export function setSpecialText(text){
return {
type:"SET_SPECIAL_TEXT",
value:txt
value:text
}
}

Expand All @@ -21,4 +27,53 @@ export function removeUser(){
return {
type:"REMOVE_USER"
}
}
}
export function setSearchText(text){
return {
type:"SET_SEARCH_TEXT",
value:text
}
}

export function isLoading(state=false,action){
if(action.type==="SET_IS_LOADING") {
return action.value;
}
return state;
}

export function setTemp(temp){
return{
type:"SET_TEMP",
value: temp
}
}

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

export function setVideoURL(URL){
return{
type:"SET_VIDEO_URL",
value: URL
}
}

export function setCurrentUserSort(sort){
return{
type:"SET_CURRENT_USER_SORT",
value: sort
}
}

export function setVideoScale(scale){
return{
type:"SET_VIDEO_SCALE",
value: scale
}
}

2 changes: 0 additions & 2 deletions src/components/SpecialTextBox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React from 'react';
import {connect} from "react-redux";
import {setSpecialText} from "../actions";

function SpecialTextBox(props) {
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 {setTemp} from "../actions";
import ChangeTemperature from '../components/ChangeTemperature';


const mapDispatchToProps = {
set: setTemp
}


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);
12 changes: 12 additions & 0 deletions src/containers/CounterButtonContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {connect} from 'react-redux';
import {increaseCounter, decreaseCounter} from "../actions";
import CounterButton from '../components/CounterButton';


const mapDispatchToProps = {
increase: increaseCounter,
decrease: decreaseCounter
}


export default connect(null,mapDispatchToProps)(CounterButton);
10 changes: 10 additions & 0 deletions src/containers/CounterContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {connect} from 'react-redux';
import Counter from "../components/Counter";

function mapStateToProps(state){
return {
count: state.currentCount
}
}

export default connect(mapStateToProps)(Counter);
10 changes: 10 additions & 0 deletions src/containers/CurrentCityContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {connect} from 'react-redux';
import CurrentCity from "../components/CurrentCity";

function mapStateToProps(state){
return {
text: state.currentCity
}
}

export default connect(mapStateToProps)(CurrentCity);
15 changes: 15 additions & 0 deletions src/containers/ModalContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {connect} from 'react-redux';
import LoadingModal from '../components/Modal';
import {isLoading} from '../actions/index';

function mapStateToProps(state) {
return {
isLoading: state.isLoading
}
}

const mapDispatchToProps = {
isLoading: isLoading
}

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


const mapDispatchToProps = {
set: setVideoScale
}


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


const mapDispatchToProps = {
set: setSearchText
}


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


const mapDispatchToProps = {
isLoading: isLoading
}


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


const mapDispatchToProps = {
set: setCurrentUserSort
}


export default connect(null,mapDispatchToProps)(SortUsers);
2 changes: 1 addition & 1 deletion src/containers/SpecialTextBoxContainer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { connect } from 'react-redux';
import {connect} from 'react-redux';
import {setSpecialText} from "../actions";
import SpecialTextBox from "../components/SpecialTextBox";

Expand Down
4 changes: 1 addition & 3 deletions src/containers/SpecialTextContainer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { connect } from 'react-redux';
import {setCurrentUser} from "../actions";
import {connect} from 'react-redux';
import SpecialText from "../components/SpecialText";

//map a prop called text to the state specialText
function mapStateToProps(state){
return {
text: state.specialText
Expand Down
10 changes: 10 additions & 0 deletions src/containers/ThermostatContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {connect} from 'react-redux';
import Thermostat from "../components/Thermostat";

function mapStateToProps(state){
return {
temp: state.currentTemp
}
}

export default connect(mapStateToProps)(Thermostat);
12 changes: 12 additions & 0 deletions src/containers/UserButtonsContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {connect} from 'react-redux';
import {addUser, removeUser} from "../actions";
import UserButtons from "../components/UserButtons";


const mapDispatchToProps = {
add: addUser,
remove: removeUser
}


export default connect(null,mapDispatchToProps)(UserButtons);
12 changes: 12 additions & 0 deletions src/containers/UsersContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {connect} from 'react-redux';
import Users from '../components/Users';

function mapStateToProps(state){
return{
users: state.users,
firstNameFilter: state.searchText,
sortOn: state.currentUserSort
}
}

export default connect(mapStateToProps)(Users)
11 changes: 11 additions & 0 deletions src/containers/VideoPlayerContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {connect} from 'react-redux';
import VideoPlayer from "../components/VideoPlayer";

function mapStateToProps(state){
return {
URL: state.videoURL,
scale: state.videoScale
}
}

export default connect(mapStateToProps)(VideoPlayer);
11 changes: 11 additions & 0 deletions src/containers/VideoTextBoxContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {connect} from 'react-redux';
import {setVideoURL} from "../actions";
import VideoTextBox from '../components/VideoTextBox';


const mapDispatchToProps = {
set: setVideoURL
}


export default connect(null,mapDispatchToProps)(VideoTextBox);
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.css';
import {Provider} from 'react-redux';
import store from './store'


ReactDOM.render(
<App />,
<Provider store={store}><App /></Provider>,
document.getElementById('root')
);
Loading