mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-28 14:04:43 -04:00
Replace vars
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
7e1f774867
commit
e565a548ee
3 changed files with 7 additions and 18 deletions
|
@ -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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue