Skip to content

Commit

Permalink
fix: rename isWide to useIsWide
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Aug 21, 2024
1 parent 535b2c5 commit 208613d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/providers/src/ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function useNavOpen(): [boolean, (open: boolean) => void] {
return [state?.isNavOpen ?? false, setOpen];
}

export function isWide(): boolean {
export function useIsWide(): boolean {
const [state, _] = useContext(UiContext) ?? [];

Check warning on line 34 in packages/providers/src/ui.tsx

View workflow job for this annotation

GitHub Actions / lint

'_' is assigned a value but never used
return state?.isWide ?? false;
}
4 changes: 2 additions & 2 deletions packages/site/src/components/Navigation/TableOfContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useSiteManifest,
useGridSystemProvider,
useThemeTop,
isWide,
useIsWide,
} from '@myst-theme/providers';
import { getProjectHeadings } from '@myst-theme/common';
import { Toc } from './TableOfContentsItems.js';
Expand All @@ -15,7 +15,7 @@ export function useTocHeight<T extends HTMLElement = HTMLElement>(top = 0, inset
const container = useRef<T>(null);
const toc = useRef<HTMLDivElement>(null);
const transitionState = useNavigation().state;
const wide = isWide();
const wide = useIsWide();
const setHeight = () => {
if (!container.current || !toc.current) return;
const height = container.current.offsetHeight - window.scrollY;
Expand Down

0 comments on commit 208613d

Please sign in to comment.