Skip to content

Commit a0cfc9e

Browse files
committed
Formatting and lint
1 parent e0d8464 commit a0cfc9e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/gitbook/src/components/DocumentView/Expandable/Details.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import React from 'react';
44

5-
import { ClassValue, tcls } from '@/lib/tailwind';
65
import { useHash } from '@/components/hooks';
6+
import { ClassValue, tcls } from '@/lib/tailwind';
77

88
/**
99
* Details component rendered on client so it can expand dependent on url hash changes.
@@ -31,9 +31,8 @@ export function Details(props: {
3131
return;
3232
}
3333
if (hash === id) {
34-
setAnchorElement(detailsRef.current)
35-
}
36-
else {
34+
setAnchorElement(detailsRef.current);
35+
} else {
3736
const activeElement = document.getElementById(hash);
3837
if (activeElement && detailsRef.current?.contains(activeElement)) {
3938
setAnchorElement(activeElement);

packages/gitbook/src/components/hooks/useHash.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export function useHash() {
1111
global.addEventListener('hashchange', updateHash);
1212
updateHash();
1313
return () => global.removeEventListener('hashchange', updateHash);
14-
// With next.js, the hashchange event is not triggered when the hash changes
15-
// Instead a hack is to use the `useParams` hook to listen to changes in the hash
16-
// https://github.com/vercel/next.js/discussions/49465#discussioncomment-5845312
14+
// With next.js, the hashchange event is not triggered when the hash changes
15+
// Instead a hack is to use the `useParams` hook to listen to changes in the hash
16+
// https://github.com/vercel/next.js/discussions/49465#discussioncomment-5845312
1717
}, [params]);
1818
return hash;
19-
}
19+
}

packages/gitbook/src/components/hooks/useScrollToHash.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
23
import { useHash } from './useHash';
34

45
/**

0 commit comments

Comments
 (0)