Advertisement
Guest User

Untitled

a guest
Jun 15th, 2022
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. import React from 'react';
  2.  
  3. const localeOptions = {
  4. style:'currency',
  5. currency:'USD',
  6. currencyDisplay:'symbol',
  7. minimumFractionDigits: 0,
  8. maximumFractionDigits: 0,
  9. }
  10.  
  11. export const SimpleCalculatorControls = props => {
  12. return (
  13. <div className="grid__container">
  14. <div className="grid__item">
  15. <span className="grid__item--header">{parseInt(props.deposit).toLocaleString('en-US', localeOptions)}</span>
  16. <input
  17. type="range"
  18. className="grid__item--range-slider"
  19. id="deposit"
  20. min="10000"
  21. max="300000"
  22. step="100"
  23. value={props.deposit}
  24. onChange={(event) =>
  25. props.setDeposit(event.target.value)
  26. } />
  27. <label className="grid__item--label" htmlFor="deposit">Deposit</label>
  28. </div>
  29. <div className="grid__item">
  30. <span className="grid__item--header">{props.interestRate}%</span>
  31. <input
  32. type="range"
  33. className="grid__item--range-slider"
  34. id="interestRate"
  35. min="0"
  36. max="8"
  37. step="1"
  38. value={props.interestRate}
  39. onChange={(event) =>
  40. props.setInterestRate(event.target.value)
  41. } />
  42. <label className="grid__item--label" htmlFor="interestRate">Interest Rate</label>
  43. </div>
  44. <div className="grid__item">
  45. <span className="grid__item--header">{props.duration} Years</span>
  46. <input
  47. type="range"
  48. className="grid__item--range-slider"
  49. id="duration"
  50. min="1"
  51. max="60"
  52. step="1"
  53. value={props.duration}
  54. onChange={(event) =>
  55. props.setDuration(event.target.value)
  56. } />
  57. <label className="grid__item--label" htmlFor="duration">Duration</label>
  58. </div>
  59. </div>
  60. );
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement