Replace vars

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-03-28 20:40:33 +02:00
parent 7e1f774867
commit e565a548ee
3 changed files with 7 additions and 18 deletions

View file

@ -20,14 +20,11 @@ export const useAdjustedRelativeSplitValue = (
relativeSplitValue: number
): number =>
useMemo(() => {
let splitValue: number
if (!showLeft && showRight) {
splitValue = 0
return 0
} else if (showLeft && !showRight) {
splitValue = 100
return 100
} else {
splitValue = relativeSplitValue
return Math.min(100, Math.max(0, relativeSplitValue))
}
return Math.min(100, Math.max(0, splitValue))
}, [relativeSplitValue, showLeft, showRight])