Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

LocalStorage, React, Sass

#react#sass/scss
Benja.min 740

@BenjaDotMin

Desktop design screenshot for the Interactive comments section coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hello all! This was fun.

I tried to hit all the bonus challenges listed in the project description:

  • Create, Read, Update, and Delete comments and replies
  • 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 the data.json file, try using timestamps and dynamically track the time since the comment or reply was posted.
  • First-level comments should be ordered by their score, whereas nested replies are ordered by time added.
  • Replying to a comment adds the new reply to the bottom of the nested replies within that comment.
  • A confirmation modal should pop up before a comment or reply is deleted.
  • Adding a new comment or reply uses the currentUser object from within the data.json file.
  • You can only edit or delete your own comments and replies.

Thanks!

Community feedback

Anosha Ahmed 9,340

@anoshaahmed

Posted

To get rid of the accessibility/HTML issues shown in your Report:

  • have at least one <h1> in your code
  • add different alt="" to your <img> tags
  • <button> should have an aria-label ... Click here to read more
  • <input> should have corresponding <label>

Great job! :)

Marked as helpful

1

@BinarySenseiii

Posted

everything is good mate but one problem i found is upvoting user can vote only one time whether it's increment or decrement, in your solution user can increment infinite which make no sense

1

Benja.min 740

@BenjaDotMin

Posted

@BloodySteps Hey! Thank you so much for your feedback. The ability to continually up/down vote the comments are to show the re-ordering of the comments based on their scores. As this is based on localStorage, if I was to limit it to one vote per person, there would be no way to show the ordering functionality (although the inner reply order is based on date created, as per the brief). But in a "real world app" you are absolutely right, that would make no sense.

I appreciate the kind words!

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord