Skip to content

Commit c60383b

Browse files
committed
fix?
1 parent 2e59ab6 commit c60383b

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/components/pageGrid.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,33 @@ import Link from 'next/link';
44

55
import {DocNode, nodeForPath} from 'sentry-docs/docTree';
66
import {serverContext} from 'sentry-docs/serverContext';
7-
8-
import {sortPages} from 'sentry-docs/utils';
9-
7+
import {isTruthy, sortPages} from 'sentry-docs/utils';
108

119
type Props = {
10+
exclude?: string[];
1211
header?: string;
1312
};
1413

15-
1614
export function PageGrid({header, exclude}: Props) {
17-
const {rootNode, path} = serverContext();
15+
const {rootNode, path: nodePath} = serverContext();
1816

1917
const parentNode = nodeForPath(rootNode, nodePath);
2018
if (!parentNode || parentNode.children.length === 0) {
2119
return null;
2220
}
2321

2422
const children: DocNode[] = parentNode.frontmatter.next_steps?.length
25-
? parentNode.frontmatter.next_steps
23+
? (parentNode.frontmatter.next_steps
2624
.map(p => nodeForPath(rootNode, path.join(parentNode.path, p)))
27-
.filter(isTruthy) ?? []
25+
.filter(isTruthy) ?? [])
2826
: parentNode.children;
2927

3028
return (
3129
<nav>
3230
{header && <h2>{header}</h2>}
3331
<ul>
3432
{sortPages(
35-
parentNode.children.filter(
33+
children.filter(
3634
c =>
3735
!c.frontmatter.sidebar_hidden &&
3836
c.frontmatter.title &&

src/utils.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ export function captureException(exception: unknown): void {
101101
}
102102
}
103103

104-
export function isTruthy<T>(value: T | undefined | null): value is T {
105-
return value !== undefined && value !== null;
106-
}
107-
108104
export const isLocalStorageAvailable = () => typeof localStorage !== 'undefined';
109105

110106
export const stripTrailingSlash = (url: string) => {

0 commit comments

Comments
 (0)