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.
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.
Desktop |
---|
Mobile |
- Scss
- Flexbox
- Mobile-first workflow
- React - JS library
- timeago.js - JS Library
- React Context Hook
- TypeScript
-
Use the recently released css unit
dvw
anddvh
to set the width and height to automatically make the element fit in any viewport size. -
Use
createContext
anduseContext()
hook to store and access state in different forms and to control current step and sync with localStorage. -
Call
DeleteModal.confirm()
to bring up the Delete Modal instead of directly controlling the visibility from parent elements. -
Use
setInterval
to rendercreatedAt
every second on the page withtimeago.js
.