-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Happy thoughts by Helene Westrin #90
base: main
Are you sure you want to change the base?
Conversation
… HappyThought component with skeleton loader and some overall styling.
…thought. Added validation for the textarea and a character count.
…main styling. Created Button component.
…to also include CreateHappyThought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, really nice to see you’ve created some custom hooks! They are well-written and do their jobs effectively. One next step could be to potentially smash the useGet and usePost into one useFetch (by adding options with method as a second param) but I’m not convinced it would improve as it’s straight forward as is.
I really like that you disabled the functionality of liking a thought many times - it really shows that you put effort into both the development and the UX of this project 😊
Your code is generally clean and well-structured. One thing to keep in mind is to structure your imports as well. A good order is the following:
// 1. React and core libraries
import { useState } from "react";
// 2. Third-party libraries
import Skeleton, { SkeletonTheme } from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css";
// 3. Custom hooks and utilities
import usePost from "../hooks/usePost";
// 4. Components
import { Button } from "./ui/Button";
import { IconLoading } from "../assets/icons/IconLoading";
// 5. Assets (icons, images, and styles)
import errorIcon from "../assets/icons/error.svg";
import "./CreateHappyThought.css";
And within groups, ordering it alphabetically.
Keep up the good work Helene!
font-family: "IBM Plex Mono", "Courier New", "Courier", sans-serif; | ||
font-size: 1rem; | ||
padding: 0.875rem; | ||
resize: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always really impressed with how well-written and organized is your code.
Some suggestions for improvement could be:
- Instead of just logging errors, show a user-friendly error message when posting fails.
- Add an aria-label to the textarea for screen reader support.
Overall, great work 😊
Netlify link
https://happy-thoughts-by-helene.netlify.app/