React.js + TypeScript + Custom Hook + SCSS Newsletter Sign-up Form
Design comparison
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
- @UnidadePosted about 1 year ago
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@better5afePosted about 1 year ago@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 GitHubJoin 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