diff --git a/src/components/FlowerPile.js b/src/components/FlowerPile.js
index fe971cd..7f63a6e 100644
--- a/src/components/FlowerPile.js
+++ b/src/components/FlowerPile.js
@@ -16,7 +16,7 @@ const FlowerPile = ({ flowerCount, setFlowerCount, position, time}) => {
} else {
alert('TIME\'S UP BITCH');
}
- }, [time]);
+ }, [time, position, setFlowerCount]);
return (
{position === 'left' ? : }
diff --git a/src/components/SearchBar.js b/src/components/SearchBar.js
index 03e7529..03aa1b8 100644
--- a/src/components/SearchBar.js
+++ b/src/components/SearchBar.js
@@ -1,4 +1,29 @@
-// import React from 'react';
-// import getUser from '../utils/getUser';
+import React from 'react';
+import { getUserData } from '../utils/getUser';
-// const SearchBar =
\ No newline at end of file
+const SearchBar = ({position, setUserData}) => {
+
+ const [username, setUsername] = React.useState('');
+
+ const handleChange = e => setUsername(e.target.value);
+
+ const handleSubmit = e => {
+ e.preventDefault();
+ if (position === 'left') getUserData(username).then(response => setUserData(response));
+ if (position === 'right') getUserData(username).then(response => setUserData(response))
+ }
+
+ return (
+
+ )
+}
+
+export default SearchBar;
\ No newline at end of file
diff --git a/src/components/TimeBar.js b/src/components/TimeBar.js
index 61ce960..9518abe 100644
--- a/src/components/TimeBar.js
+++ b/src/components/TimeBar.js
@@ -10,7 +10,7 @@ const TimeBar = ({ userData, time, setTime }) => {
if (userData && userData.followers > 10) {
setTime(userData.followers);
}
- }, [userData]);
+ }, [userData, setTime]);
React.useEffect(() => {
if (userData) setBarHeight(time/userData.followers*100);