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

React.js + TypeScript + Custom Hook + SCSS Newsletter Sign-up Form

Better5afeβ€’ 850

@better5afe

Desktop design screenshot for the Newsletter sign-up form with success message coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Summary:

a) Upon submit, the form is checked by a custom hook which vefifies value provided in the input.

b) If an email is successfully submitted, it's saved within the Local Storage.

c) Users will receive an appropriate error message in the following scenarios:

  • The input is empty.
  • Provided value is not a valid email address.
  • The email has already been provided and it's present in the Local Storage.

d) The validity check is slighly delayed using a setTimeout() method which imitates sending a request to an external server and allows users to see a loading modal.

e) Loading modal is rendered in a separate div using React Portal.

f) Application state is managed by React Context.

g) Users can view the optimal layout for the interface depending on their device's screen size as well as see hover and focus states for all interactive elements on the page.

No questions from my side, however I will be grateful for any feedback.

Happy coding! πŸŽƒ

Community feedback

Dario Rodriguesβ€’ 160

@Unidade

Posted

I loved your animations; they were such a great addition to the challenge. Overall, I think it's a pretty solid implementation, and in terms of code, it's well-written and easy to navigate.

I'm curious about how much time you spent on this challenge

0

Better5afeβ€’ 850

@better5afe

Posted

@Unidade Hi, thanks for your feedback and I'm glad you liked it! ☺️ It took me approximately 4 hours to complete this challenge - I spent about 2 hours yesterday on creating and styling the components and today I was implementing the core functionalities and animations for another 2 hours. Not sure if this is a lot of time or not, I'm doing these challenges mainly as a practice so I definitely take my time with them. :)

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