Skip to content

Agnes Sjösten- Happy Thoughts Project#42

Open
AgnesSj01 wants to merge 11 commits intoTechnigo:mainfrom
AgnesSj01:main
Open

Agnes Sjösten- Happy Thoughts Project#42
AgnesSj01 wants to merge 11 commits intoTechnigo:mainfrom
AgnesSj01:main

Conversation

@AgnesSj01
Copy link

@AgnesSj01 AgnesSj01 commented Dec 9, 2025

Removed project structure explanation from README.
Updated README.md to include project details, features, API endpoints, technologies used, and installation instructions.
@AgnesSj01
Copy link
Author

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";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to keep styling that is not state controlled in the css file or in styled-components.

@Npahlfer
Copy link

Be careful when generating projects using AI, a lot o learnings are lost doing it that way.
It's better to use AI for repetitive tasks and when changing between formats/structure of some kind. Or as a tutor and code reviewer!

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 }) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the best practise use of the constants here. Very nice!

//Enable Day.js plugin
dayjs.extend(relativeTime);

export const ThoughtCard = ({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants