Skip to content

Commit

Permalink
move const
Browse files Browse the repository at this point in the history
  • Loading branch information
scurker committed Aug 9, 2023
1 parent dd4266e commit ab33ec7
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ const TwoColumnPanel = forwardRef<HTMLDivElement, TwoColumnPanelProps>(
const closeButtonRef = useRef<HTMLButtonElement>(null);
const columnLeftRef = useRef<HTMLDivElement>(null);
const columnRightRef = useRef<HTMLDivElement>(null);
const prefersReducedMotion =
'matchMedia' in window &&
matchMedia('(prefers-reduced-motion: reduce)').matches;

const columnLeft = React.Children.toArray(children).find(
child => (child as React.ReactElement<any>).type === ColumnLeft
);

const togglePanel = () => {
const prefersReducedMotion =
'matchMedia' in window &&
matchMedia('(prefers-reduced-motion: reduce)').matches;

if (isCollapsed) {
setShowPanel(true);
} else if (prefersReducedMotion) {
Expand Down

0 comments on commit ab33ec7

Please sign in to comment.