Skip to content

Conversation

@violacathrine
Copy link

@HolaCarmensita
Copy link

HolaCarmensita commented May 22, 2025

Så fin app, du ska vars så nöjd och jag vet hur du kämpade, grymt!

Food for thought

API-logik som custom hook?
Det går att flytta fetch/POST-logiken från thoughts.js till en custom hook (t.ex. useThoughts) som kan hantera logiken som GET, POST, returnera thoughts, isLoading, error etc.

React documenation

Mastering Custom Hooks in React

Like-knappen som en mer ansvarstagande komponent?
Du skulle kunna låta LikeButton ta emot thoughtId, isLiked och hearts som props, och låta den sköta sitt eget state samt POST-anrop för lokala uppdateringar.

Global styling med Styled Components?
Ett alternativ är att samla färger, typsnitt och breakpoints i en GlobalStyles eller theme.js för att undvika duplicerad styling i varje komponent, det upplever jag också blir enklare i längden i stylingarbetet

140 character input error handling
When writing a to long message, you rechive a "-10 characters remaining" instead of something like "10 characters to long". A alternativ could be to just not show that line at all after using more than 140 character (display none), and only show the error message just under it saying "Your message is too long".

@HIPPIEKICK HIPPIEKICK self-assigned this May 26, 2025
Copy link
Contributor

@HIPPIEKICK HIPPIEKICK left a comment

Choose a reason for hiding this comment

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

Please update your app with this new link (you can use cmd+shift+F to search for all the instances in a repo).

https://happy-thoughts-api-4ful.onrender.com/

In the meantime, nice to see you’re continuing with styled components 🤩

@violacathrine
Copy link
Author

Please update your app with this new link (you can use cmd+shift+F to search for all the instances in a repo).

https://happy-thoughts-api-4ful.onrender.com/

In the meantime, nice to see you’re continuing with styled components 🤩

Is this new link supposed to be connected to the project in Backend sprint? I think i’m confused if i did it right - since i got alot of console warnings in inspect using the new link.

@HIPPIEKICK
Copy link
Contributor

Is this new link supposed to be connected to the project in Backend sprint? I think i’m confused if i did it right - since i got alot of console warnings in inspect using the new link.

You will build your own Happy Thoughts API during the backend sprint, yes. But right now, the only thing you need to do for this React project is to switch out the old API link in all places to the new one.

@violacathrine
Copy link
Author

violacathrine commented May 28, 2025 via email

Copy link
Contributor

@HIPPIEKICK HIPPIEKICK left a comment

Choose a reason for hiding this comment

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

Apart from that you've only got 90 in Lighthouse score, you're good to go. Rise and I'll approve 🪄

@violacathrine
Copy link
Author

violacathrine commented May 28, 2025 via email

@HIPPIEKICK
Copy link
Contributor

Oh my, I'm so sorry Cathi - I was certain we had that as a requirement 🙈 Well, no harm in improving a11y I guess but sorry for "forcing" you 😅

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