+ );
}
-export default ChangeTemperature;
\ No newline at end of file
+export default ChangeTemperature;
diff --git a/src/components/CityDropDown.js b/src/components/CityDropDown.js
index d43df20..1e20041 100644
--- a/src/components/CityDropDown.js
+++ b/src/components/CityDropDown.js
@@ -1,23 +1,24 @@
-import React from 'react';
+import React from "react";
+import store from "../store";
function CityDropDown(props) {
return (
-
;
}
}
-export default Counter;
\ No newline at end of file
+export default Counter;
diff --git a/src/components/CounterButton.js b/src/components/CounterButton.js
index 96eaa08..0d649ee 100644
--- a/src/components/CounterButton.js
+++ b/src/components/CounterButton.js
@@ -1,19 +1,23 @@
-import React from 'react';
-
+import React from "react";
+import store from "../store";
function CounterButton(props) {
return (
-
-
-
-
+
+
+
+
);
}
-export default CounterButton;
\ No newline at end of file
+export default CounterButton;
diff --git a/src/components/CurrentCity.js b/src/components/CurrentCity.js
index a073d8e..89f1279 100644
--- a/src/components/CurrentCity.js
+++ b/src/components/CurrentCity.js
@@ -1,21 +1,21 @@
-import React from 'react';
+import React from "react";
+import store from "../store";
class CurrentCity extends React.Component {
- state={
- text:""
+ state = {
+ text: ""
+ };
+ componentDidMount() {
+ store.subscribe(() => {
+ this.setState({ text: store.getState().currentCity });
+ });
}
render() {
- const {
- props,
- } = this;
+ const { props } = this;
- return (
-
- CurrentCity: {this.state.text}
-
- );
+ return
CurrentCity: {this.state.text}
;
}
}
-export default CurrentCity;
\ No newline at end of file
+export default CurrentCity;
diff --git a/src/components/Modal.js b/src/components/Modal.js
index 1789040..b148701 100644
--- a/src/components/Modal.js
+++ b/src/components/Modal.js
@@ -1,14 +1,18 @@
-import React from 'react';
-import Modal from 'react-modal';
+import React from "react";
+import Modal from "react-modal";
+import store from "../store";
class LoadingModal extends React.Component {
- state={
- isLoading:false
+ state = {
+ isLoading: false
+ };
+ componentDidMount() {
+ store.subscribe(() => {
+ this.setState({ isLoading: store.getState().isLoading });
+ });
}
render() {
- const {
- props,
- } = this;
+ const { props } = this;
return (
-
+
);
}
-export default ScaleVideo;
\ No newline at end of file
+export default ScaleVideo;
diff --git a/src/components/SearchTextBox.js b/src/components/SearchTextBox.js
index 43f3416..df8a74e 100644
--- a/src/components/SearchTextBox.js
+++ b/src/components/SearchTextBox.js
@@ -1,14 +1,17 @@
-import React from 'react';
+import React from "react";
+import store from "../store";
function SearchTextBox(props) {
return (
-
- Search Users on First Name:
- {
-
- }} />
-
+
+ Search Users on First Name:
+ {
+ store.dispatch({ type: "SET_SEARCH_TEXT", value: e.target.value });
+ }}
+ />
+
);
}
-export default SearchTextBox;
\ No newline at end of file
+export default SearchTextBox;
diff --git a/src/components/ShowModal.js b/src/components/ShowModal.js
index 1e73950..06b8f38 100644
--- a/src/components/ShowModal.js
+++ b/src/components/ShowModal.js
@@ -1,15 +1,17 @@
-import React from 'react';
+import React from "react";
+import store from "../store";
function ShowModal(props) {
return (
-
-
-
-
+
+
+
);
}
-export default ShowModal;
\ No newline at end of file
+export default ShowModal;
diff --git a/src/components/SortUsers.js b/src/components/SortUsers.js
index fd6cb04..8586aba 100644
--- a/src/components/SortUsers.js
+++ b/src/components/SortUsers.js
@@ -1,18 +1,22 @@
-import React from 'react';
+import React from "react";
+import store from "../store";
function SortUsers(props) {
return (
-
- Sort Users On:
-
-
+
+ Sort Users On:
+
+
);
}
-export default SortUsers;
\ No newline at end of file
+export default SortUsers;
diff --git a/src/components/SpecialText.js b/src/components/SpecialText.js
index 7d3b5e9..6513209 100644
--- a/src/components/SpecialText.js
+++ b/src/components/SpecialText.js
@@ -1,18 +1,18 @@
-import React from 'react';
+import React from "react";
+import store from "../store";
class SpecialText extends React.Component {
- state={text:""}
+ state = { text: "" };
+ componentDidMount() {
+ store.subscribe(() => {
+ this.setState({ text: store.getState().specialText });
+ });
+ }
render() {
- const {
- props,
- } = this;
+ const { props } = this;
- return (
-
- Special Text: {this.state.text}
-
- );
+ return
Special Text: {this.state.text}
;
}
}
-export default SpecialText;
\ No newline at end of file
+export default SpecialText;
diff --git a/src/components/SpecialTextBox.js b/src/components/SpecialTextBox.js
index 63cb01f..c930c13 100644
--- a/src/components/SpecialTextBox.js
+++ b/src/components/SpecialTextBox.js
@@ -1,15 +1,17 @@
-import React from 'react';
-
+import React from "react";
+import store from "../store";
function SpecialTextBox(props) {
return (
-
- Enter Special Text:
- {
-
- }} />
-
+
+ Enter Special Text:
+ {
+ store.dispatch({ type: "SET_SPECIAL_TEXT", value: e.target.value });
+ }}
+ />
+
);
}
-export default (SpecialTextBox);
+export default SpecialTextBox;
diff --git a/src/components/Thermostat.js b/src/components/Thermostat.js
index 2e43fbe..4638f85 100644
--- a/src/components/Thermostat.js
+++ b/src/components/Thermostat.js
@@ -1,16 +1,20 @@
import React from "react";
import DonutChart from "./ignore/DonutChart";
+import store from "../store";
class Thermostat extends React.Component {
- state={temp:""}
+ state = { temp: "" };
+ componentDidMount() {
+ store.subscribe(() => {
+ this.setState({ temp: store.getState().currentTemp });
+ });
+ }
render() {
- const {
- props,
- } = this;
+ const { props } = this;
- return ()
+ return ;
}
}
-export default Thermostat;
\ No newline at end of file
+export default Thermostat;
diff --git a/src/components/UserButtons.js b/src/components/UserButtons.js
index f857369..c69aff8 100644
--- a/src/components/UserButtons.js
+++ b/src/components/UserButtons.js
@@ -1,27 +1,33 @@
-import React from 'react';
+import React from "react";
+import store from "../store";
function UserButtons(props) {
return (
-
);
}
}
-export default Users;
\ No newline at end of file
+export default Users;
diff --git a/src/components/VideoPlayer.js b/src/components/VideoPlayer.js
index f4fc08b..686fe40 100644
--- a/src/components/VideoPlayer.js
+++ b/src/components/VideoPlayer.js
@@ -1,25 +1,37 @@
-import React from 'react';
+import React from "react";
+import store from "../store";
class VideoPlayer extends React.Component {
- state={scale:0,URL:""}
-
+ state = { scale: 0, URL: "" };
+ componentDidMount() {
+ store.subscribe(() => {
+ this.setState({ URL: store.getState().videoURL });
+ this.setState({ scale: store.getState().videoScale });
+ });
+ }
render() {
- const {
- props,
- } = this;
+ const { props } = this;
let width = 200;
let height = 200;
- if(this.state.scale){
+ if (this.state.scale) {
width = 200 * props.scale;
height = 200 * props.scale;
}
return (
-
+
+
+
);
}
}
-export default VideoPlayer;
\ No newline at end of file
+export default VideoPlayer;
diff --git a/src/components/VideoTextBox.js b/src/components/VideoTextBox.js
index 62cb230..6e59ddc 100644
--- a/src/components/VideoTextBox.js
+++ b/src/components/VideoTextBox.js
@@ -1,16 +1,17 @@
-import React from 'react';
+import React from "react";
+import store from "../store";
function VideoTextBox(props) {
return (
-
- Enter URL of YouTube video
- {
-
- }}
- type="text" />
-
-
+
+ Enter URL of YouTube video
+ {
+ store.dispatch({ type: "SET_VIDEO_URL", value: e.target.value });
+ }}
+ type="text"
+ />
+