Skip to content

Commit 38ad515

Browse files
committed
docs: construct navs from routes
1 parent 98644dd commit 38ad515

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

apps/kitchen-sink/src/app/cannon/cannon.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
33
import { extend } from 'angular-three';
44
import * as THREE from 'three';
5+
import routes from './cannon.routes';
56

67
extend(THREE);
78

@@ -33,13 +34,5 @@ extend(THREE);
3334
host: { class: 'cannon' },
3435
})
3536
export default class Cannon {
36-
protected examples = [
37-
'basic',
38-
'kinematic-cube',
39-
'compound',
40-
'chain',
41-
'cube-heap',
42-
'convexpolyhedron',
43-
'monday-morning',
44-
];
37+
protected examples = routes.filter((route) => !!route.path).map((route) => route.path);
4538
}

apps/kitchen-sink/src/app/postprocessing/postprocessing.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
33
import { extend } from 'angular-three';
44
import * as THREE from 'three';
5+
import routes from './postprocessing.routes';
56

67
extend(THREE);
78

@@ -33,5 +34,5 @@ extend(THREE);
3334
host: { class: 'postprocessing' },
3435
})
3536
export default class Postprocessing {
36-
protected examples = ['basic', 'outline'];
37+
protected examples = routes.filter((route) => !!route.path).map((route) => route.path);
3738
}

apps/kitchen-sink/src/app/soba/soba.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
22
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
33
import { extend } from 'angular-three';
44
import * as THREE from 'three';
5+
import routes from './soba.routes';
56

67
extend(THREE);
78

@@ -33,17 +34,5 @@ extend(THREE);
3334
host: { class: 'soba' },
3435
})
3536
export default class Soba {
36-
protected examples = [
37-
'stars',
38-
'basic',
39-
'hud',
40-
'render-texture',
41-
'shaky',
42-
'lod',
43-
'decal',
44-
'html-chart',
45-
'lowpoly-earth',
46-
'skydiving',
47-
'porsche',
48-
];
37+
protected examples = routes.filter((route) => !!route.path).map((route) => route.path);
4938
}

0 commit comments

Comments
 (0)