Skip to content

Commit

Permalink
♻️ more accurate function names
Browse files Browse the repository at this point in the history
  • Loading branch information
timbryandev committed Oct 6, 2023
1 parent cefaa78 commit 056e580
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Resizable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export function Resizable(props: PropsWithChildren<ResizableProps>) {
initialWidth
);

const containerWidth = () =>
const getContainerWidth = () =>
toPixels(props.containerWidth ?? document.body.offsetWidth);

const minWidth = () =>
toPixels(props.minResizableWidth ?? 0, containerWidth());
const getMinWidth = () =>
toPixels(props.minResizableWidth ?? 0, getContainerWidth());

const maxWidth = () =>
toPixels(props.maxResizableWidth ?? "100%", containerWidth());
const getMaxWidth = () =>
toPixels(props.maxResizableWidth ?? "100%", getContainerWidth());

const getWrapperWidth = () =>
toPixels(resizeWrapperRef.current?.style.width ?? 0);
Expand All @@ -56,7 +56,7 @@ export function Resizable(props: PropsWithChildren<ResizableProps>) {
if (resizeWrapperRef.current === null) return;

const newWidth =
keepValueWithinRange(value, minWidth(), maxWidth()) - gutterSize;
keepValueWithinRange(value, getMinWidth(), getMaxWidth()) - gutterSize;

resizeWrapperRef.current.style.width = `${newWidth}px`;
setLastPosition(newWidth);
Expand Down

0 comments on commit 056e580

Please sign in to comment.