File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -4,35 +4,33 @@ import Link from 'next/link';
44
55import { DocNode , nodeForPath } from 'sentry-docs/docTree' ;
66import { serverContext } from 'sentry-docs/serverContext' ;
7-
8- import { sortPages } from 'sentry-docs/utils' ;
9-
7+ import { isTruthy , sortPages } from 'sentry-docs/utils' ;
108
119type Props = {
10+ exclude ?: string [ ] ;
1211 header ?: string ;
1312} ;
1413
15-
1614export 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 &&
Original file line number Diff line number Diff 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-
108104export const isLocalStorageAvailable = ( ) => typeof localStorage !== 'undefined' ;
109105
110106export const stripTrailingSlash = ( url : string ) => {
You can’t perform that action at this time.
0 commit comments