Closed ecumene closed 3 years ago
something like:
const CENTER_SPACING_IMPERIAL = 16;
const CENTER_SPACING_METRIC = 406.4;
export default function Calculator() {
const onCenterSpacing = isImperialUnit ? CENTER_SPACING_IMPERIAL : CENTER_SPACING_METRIC;
}
Exactly!
alright, thats done. I also clarified the studOffset const by defining both values as their own constants:
const studOffset = isImperialUnit ? STUD_OFFSET_IMPERIAL : STUD_OFFSET_METRIC;
This one:
https://github.com/Hello-World-Software-Studios/calculator/blob/c4bec9890d695b722df2186732f6c1e14ee283cb/src/components/calculator.jsx#L10
Could come from the top of the file as a
const CENTER_SPACING_IMPERIAL = 16
. Just so it's a little more organized