Skip to content

Commit

Permalink
Merge pull request #13859 from newrelic/sunny/fix-nav-quirky
Browse files Browse the repository at this point in the history
fix nav collapser quirk
  • Loading branch information
sunnyzanchi authored Jul 17, 2023
2 parents dfdf651 + 9fcc381 commit db0d374
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 472 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const NavCollapseIcon = (props) => {
const [rectSpring] = useSpring(
() => ({
delay: 280,
from: { x: '0' },
from: { x: '0px' },
to: { x: '14px' },
reverse: sidebar,
config: RECT_SPRING,
Expand Down
9 changes: 9 additions & 0 deletions src/components/MainLayoutContext.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { createContext, useContext } from 'react';

export const MainLayoutContext = createContext();
/**
* exposes whether the site's left nav sidebar is currently open
*
* @example
*
* ```js
* const [sidebar] = useMainLayoutContext(); // true | false
* ```
*/
export const useMainLayoutContext = () => useContext(MainLayoutContext);
Loading

0 comments on commit db0d374

Please sign in to comment.