Agnes Sjösten- Happy Thoughts Project#42
Conversation
…omponents and data.
Removed project structure explanation from README.
Updated README.md to include project details, features, API endpoints, technologies used, and installation instructions.
|
added ReadMe |
Removed redundant features and installation instructions from README.
src/data/api.js
Outdated
| @@ -0,0 +1,44 @@ | |||
| // Base URL for all API requests | |||
| const API_URL = "https://happy-thoughts-api-4ful.onrender.com/thoughts"; | |||
There was a problem hiding this comment.
This API url should have been imported from data/constants as it's defined there as well.
| <p | ||
| style={{ | ||
| color: thought.length > MAX_THOUGHT_LENGTH ? "red" : "gray", | ||
| fontSize: "12px", |
There was a problem hiding this comment.
Try to keep styling that is not state controlled in the css file or in styled-components.
|
Be careful when generating projects using AI, a lot o learnings are lost doing it that way. Also the URL ttps://app.netlify.com/projects/agnes-happythoughtsproject/overview goes to your application overview in Netlify and not the actual deployed application. |
| import { getRandomThought } from "../data/api"; | ||
| import { ThoughtCard } from "./ThoughtCard"; | ||
|
|
||
| export const RandomThought = ({ isLoggedIn, onLike }) => { |
There was a problem hiding this comment.
Clear naming the components, getThoughts, postThought, likeTgought - making it easy to read and understand
| @@ -0,0 +1,13 @@ | |||
| //Creates two constants (numbers) | |||
| export const MAX_THOUGHT_LENGTH = 140; | |||
There was a problem hiding this comment.
I like the best practise use of the constants here. Very nice!
| //Enable Day.js plugin | ||
| dayjs.extend(relativeTime); | ||
|
|
||
| export const ThoughtCard = ({ |
There was a problem hiding this comment.
Nice and clean code Agnes! Really nice job! :D
Here is just one tip, where you could instead use a spread operator instead of writing out every property, you can pass down all the objects properties only once
https://app.netlify.com/projects/agnes-happythoughtsproject/overview