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

Mortgage Repayment Calculator (ReactJS | Typescript | Vite | Sass)

P
Marc Francisā€¢ 600

@marcfranciss

Desktop design screenshot for the Mortgage repayment calculator coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

Built with

  • Semantic HTML5 markup

  • Flexbox

  • React - JS library

  • Typescript

  • Vite

    npm create vite@latest
    
  • Sass - For styles

    npm install -g sass
    

What challenges did you encounter, and how did you overcome them?

The challenge šŸ’Ŗ

Users should be able to:

  • Input mortgage information and see monthly repayment and total repayment amounts after submitting the form āœ…
  • See form validation messages if any field is incomplete āœ…
  • Complete the form only using their keyboard āœ…
  • View the optimal layout for the interface depending on their device's screen size āœ…
  • See hover and focus states for all interactive elements on the page āœ…

Live Site URL: Solution

What specific areas of your project would you like help with?

Still unsure if this is the proper way to do reset the form. Any advice will be greatly appreciated.

useEffect(() => {
  if (onReset) {
    // resets the data to blank
    setMortgageData({
      amount: "",
      year: "",
      interest: "",
      type: "",
      mMonthly: "",
      mInterestOnly: "",
      mTotal: "",
    });
    // resets the errors to false, so it will not show
    setErrors({
      amount: false,
      year: false,
      interest: false,
      type: false,
    });
    // returns reset button to default state
    setReset(false);
  }
}, [onReset]);

Thank you for taking the time in checking this project. šŸ’•

I hope this somehow help you in what you're looking for. Cheers! šŸ»

Community feedback

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