Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

HeleneWestrin
Copy link

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.

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

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:

  1. Instead of just logging errors, show a user-friendly error message when posting fails.
  2. Add an aria-label to the textarea for screen reader support.

Overall, great work 😊

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