Me again…
I have done the majority of the code. I am now working on getting the progress bar to update. Does anyone know if there is an easy way to update the progress bar than doing a huge if statement…?
if (uppercaseLetters < 1) this.setState({ percentage: 5 })
Then that percentage gets passed to a progress bar component. But if I was do to do this for every instance, it would get very repetitive and not the most semantic…
if (uppercaseLetters < 1) this.setState({ percentage: 5 })
if (uppercaseLetters >= 1 && uppercaseLetters <= 5) this.setState({ percentage: 10 })
if (lowercaseLetters <= 10) this.setState({ percentage: 5 })
if (lowercaseLetters >= 10 && uppercaseLetters <= 15) this.setState({ percentage: 10 })
if (numbers <= 1) this.setState({ percentage: 5 })
if (numbers >= 1 && numbers <= 5) this.setState({ percentage: 10 })
As you can see, this is very repetitive…