+
Date: Sun, 26 Mar 2023 00:02:45 +0100
Subject: [PATCH 08/17] linebreak css
---
code/src/components/Input.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/code/src/components/Input.js b/code/src/components/Input.js
index c281c9aa8..bae19012a 100644
--- a/code/src/components/Input.js
+++ b/code/src/components/Input.js
@@ -37,7 +37,13 @@ export const Input = ({ newPost, setNewPost, thoughts, setThoughts }) => {
}}
/>
-
+
);
From bc799e3c7853abe4f297bd31656aeb54a6793d59 Mon Sep 17 00:00:00 2001
From: dannebrob <65211641+dannebrob@users.noreply.github.com>
Date: Sun, 26 Mar 2023 00:04:29 +0100
Subject: [PATCH 09/17] css fixes
---
code/src/components/Input.css | 12 ++++++++++--
code/src/components/List.css | 5 +++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/code/src/components/Input.css b/code/src/components/Input.css
index 229a4288a..4ef284381 100644
--- a/code/src/components/Input.css
+++ b/code/src/components/Input.css
@@ -40,8 +40,16 @@ textarea {
border-radius: 20px;
margin: 0.5rem 1rem 1rem;
}
+button:hover {
+ cursor: pointer;
+}
-.input-box button:hover,
.input-box button:focus {
- background-color: rgb(229, 3, 3);
+ border: 2px solid black;
+}
+button:disabled,
+button[disabled] {
+ border: 1px solid #999999;
+ background-color: #cccccc;
+ color: #666666;
}
diff --git a/code/src/components/List.css b/code/src/components/List.css
index 3d4d1fdfe..549d5ed42 100644
--- a/code/src/components/List.css
+++ b/code/src/components/List.css
@@ -10,12 +10,17 @@
-moz-box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);
margin: 2rem;
}
+
+.list {
+ width: 80%;
+}
.message-text {
font-family: 'Roboto Mono', monospace;
width: 100%;
font-size: 1.2rem;
font-weight: 700;
padding: 0 0 0 1rem;
+ overflow-wrap: break-word;
}
.stats-container {
width: 100%;
From f028ed56213228f60a33bf339f493da22a24bf7a Mon Sep 17 00:00:00 2001
From: dannebrob <65211641+dannebrob@users.noreply.github.com>
Date: Sun, 26 Mar 2023 00:09:46 +0100
Subject: [PATCH 10/17] css fix
---
code/src/components/List.css | 3 +++
1 file changed, 3 insertions(+)
diff --git a/code/src/components/List.css b/code/src/components/List.css
index 549d5ed42..3ed2a0238 100644
--- a/code/src/components/List.css
+++ b/code/src/components/List.css
@@ -46,6 +46,9 @@
align-items: center;
background-color: rgb(253, 254, 254);
}
+.heart:hover {
+ cursor: pointer;
+}
.time {
display: flex;
From 91202ed197dfc0ec738ebda50891f825a2921118 Mon Sep 17 00:00:00 2001
From: dannebrob <65211641+dannebrob@users.noreply.github.com>
Date: Sun, 26 Mar 2023 00:17:13 +0100
Subject: [PATCH 11/17] readme
---
README.md | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 9ea4e26b3..1e942d060 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,24 @@
# Happy Thoughts
-Replace this readme with your own information about your project.
-
-Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
+A happy twitter-like wall for all you thoughts. Share what you are thinking about right now!
## The problem
-Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?
+### The challenge
+
+In this week's project, you'll be able to practice your React state skills by fetching and posting data to an API.
+
+**What you need to do**
+
+✓ Your page should follow the design as closely as possible
+
+✓ You should list the most recent thoughts at the top and older thoughts at the bottom (sorted)
+
+✓ Your thoughts should show the content of the message and how many likes they've received
+
+✓ You should have a form to post new thoughts
+
+✓ You should implement the heart button to send likes on a thought
## View it live
From 506dc877edd52fb75645837da339dd02810a4bb5 Mon Sep 17 00:00:00 2001
From: dannebrob <65211641+dannebrob@users.noreply.github.com>
Date: Sun, 26 Mar 2023 00:21:27 +0100
Subject: [PATCH 12/17] css fix
---
code/src/components/List.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/code/src/components/List.css b/code/src/components/List.css
index 3ed2a0238..1acf8ecb4 100644
--- a/code/src/components/List.css
+++ b/code/src/components/List.css
@@ -48,6 +48,7 @@
}
.heart:hover {
cursor: pointer;
+ background-color: rgba(255, 0, 0, 0.2);
}
.time {
From 3b571ababcfaacdfe639818ac0f4df457d30ee51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Brob=C3=A4ck?=
<65211641+dannebrob@users.noreply.github.com>
Date: Sun, 26 Mar 2023 00:22:07 +0100
Subject: [PATCH 13/17] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 1e942d060..0282d60d1 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,7 @@ A happy twitter-like wall for all you thoughts. Share what you are thinking abou
### The challenge
+
In this week's project, you'll be able to practice your React state skills by fetching and posting data to an API.
**What you need to do**
@@ -23,3 +24,4 @@ In this week's project, you'll be able to practice your React state skills by fe
## View it live
Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
+https://technigo-happy-thoughts-app.netlify.app/
From dc8ec5506e9a1e1cd8c32f3c6ca60926fd6a9c36 Mon Sep 17 00:00:00 2001
From: dannebrob <65211641+dannebrob@users.noreply.github.com>
Date: Sun, 2 Apr 2023 21:22:13 +0200
Subject: [PATCH 14/17] bug fix: Clear text area after posting
---
code/src/components/Input.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/code/src/components/Input.js b/code/src/components/Input.js
index bae19012a..b6453aad9 100644
--- a/code/src/components/Input.js
+++ b/code/src/components/Input.js
@@ -17,9 +17,11 @@ export const Input = ({ newPost, setNewPost, thoughts, setThoughts }) => {
fetch('https://happy-thoughts-ux7hkzgmwa-uc.a.run.app/thoughts', options)
.then((res) => res.json())
.then((newThought) => {
- console.log(newThought);
setThoughts((prevThoughts) => [newThought, ...prevThoughts]);
})
+ .finally(() => {
+ setNewPost('');
+ })
.catch((error) => console.log(error));
};
return (
From 88eee78b88434efb058801d01569dce3012b9dfd Mon Sep 17 00:00:00 2001
From: dannebrob <65211641+dannebrob@users.noreply.github.com>
Date: Sun, 21 May 2023 19:49:59 +0200
Subject: [PATCH 15/17] updated URLs
---
code/src/App.js | 4 ++--
code/src/components/Input.js | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/code/src/App.js b/code/src/App.js
index bb2dc31ec..b75c90c5e 100644
--- a/code/src/App.js
+++ b/code/src/App.js
@@ -10,7 +10,7 @@ export const App = () => {
const [loading, setLoading] = useState(true);
const fetchThoughts = () => {
- fetch('https://happy-thoughts-ux7hkzgmwa-uc.a.run.app/thoughts')
+ fetch('https://project-happy-thoughts-api-hgwjnnqcva-lz.a.run.app/thoughts')
.then((res) => res.json())
.then((data) => {
setThoughts(data);
@@ -31,7 +31,7 @@ export const App = () => {
}
};
fetch(
- `https://happy-thoughts-ux7hkzgmwa-uc.a.run.app/thoughts/${id}/like`,
+ `https://project-happy-thoughts-api-hgwjnnqcva-lz.a.run.app/thoughts${id}/like`,
options
)
.catch((error) => console.log(error))
diff --git a/code/src/components/Input.js b/code/src/components/Input.js
index b6453aad9..185279042 100644
--- a/code/src/components/Input.js
+++ b/code/src/components/Input.js
@@ -14,7 +14,10 @@ export const Input = ({ newPost, setNewPost, thoughts, setThoughts }) => {
body: JSON.stringify({ message: newPost })
};
- fetch('https://happy-thoughts-ux7hkzgmwa-uc.a.run.app/thoughts', options)
+ fetch(
+ 'https://project-happy-thoughts-api-hgwjnnqcva-lz.a.run.app/thoughts',
+ options
+ )
.then((res) => res.json())
.then((newThought) => {
setThoughts((prevThoughts) => [newThought, ...prevThoughts]);
From ab860de40ff5be58eec81e43509769f8bc61da58 Mon Sep 17 00:00:00 2001
From: dannebrob <65211641+dannebrob@users.noreply.github.com>
Date: Sun, 21 May 2023 19:52:57 +0200
Subject: [PATCH 16/17] bugfix
---
code/src/App.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/src/App.js b/code/src/App.js
index b75c90c5e..5dbfb3360 100644
--- a/code/src/App.js
+++ b/code/src/App.js
@@ -31,7 +31,7 @@ export const App = () => {
}
};
fetch(
- `https://project-happy-thoughts-api-hgwjnnqcva-lz.a.run.app/thoughts${id}/like`,
+ `https://project-happy-thoughts-api-hgwjnnqcva-lz.a.run.app/thoughts/${id}/like`,
options
)
.catch((error) => console.log(error))
From 2a9d9b228a9c0580d8227176a1e595494ee0becf Mon Sep 17 00:00:00 2001
From: dannebrob <65211641+dannebrob@users.noreply.github.com>
Date: Sun, 21 May 2023 19:55:02 +0200
Subject: [PATCH 17/17] bugfix
---
code/src/components/List.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/src/components/List.js b/code/src/components/List.js
index b174ea354..852b8149d 100644
--- a/code/src/components/List.js
+++ b/code/src/components/List.js
@@ -18,7 +18,7 @@ export const List = ({ thoughts, setThoughts, handleLikeChange }) => {
handleLikeChange(thought._id)}>❤️
-
x{thought.hearts}
+
x{thought.heart}