This is a solution to the Interactive comments section challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
To start the project, you need to install the dependencies with the command yarn
or npm install
and You can also start the fake API with the command yarn api
or npm run api
. The fake API will start on the port 5000. After that, you can start the project with the command yarn start
or npm start
. The project will start on the port 3000.
Users should be able to:
- View the optimal layout for the app depending on their device's screen size
- See hover states for all interactive elements on the page
- Create, Read, Update, and Delete comments and replies
- Upvote and downvote comments
- Bonus: If you're building a purely front-end project, use
localStorage
to save the current state in the browser that persists when the browser is refreshed. - Bonus: Instead of using the
createdAt
strings from thedata.json
file, try using timestamps and dynamically track the time since the comment or reply was posted.
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- React - JS library
- TailwindCSS - For styles
- shadcn/ui - For Components UI
- TanStack Query - For state management
- date-fns - For date formatting
- json-server - For fake API
- react-use - For hooks
I learned how to use the useQuery
and useMutation
hooks from TanStack Query, and also how to use the useMedia
hook from react-use
to verify media query and add styles for media specify. I also learned how to use the json-server
to create a fake API for the project. also learned how to use the date-fns
to format the date. and how to use shadcn/ui to create a beautiful UI.
I want to continue learning about the use of the useQuery
and useMutation
hooks from TanStack Query, and also the use some editor WYSIWYG for the comment and reply input. i also want to learn testing my application with vitest and React Testing Library.
Note: Delete this note and the content within this section and replace with your own plans for continued development.
- Talvez você não precise de estados globais no React (HTTP State) - This helped me for understanding how to use the
useQuery
anduseMutation
hooks from TanStack Query. I'd recommend it to anyone still learning this concept. - PARE de usar o useEffect para fazer API calls! React Query + Next.js - This is an amazing article which helped me finally understand how to use TanStack Query. I'd recommend it to anyone still learning this concept.