Skip to content

Commit c94707e

Browse files
06180618
andauthored
fix(docs): fix 404 spikes (#2548)
* fix: use getStaticPaths to restrict platform param * fix(docs): remove useCustomRouter * fix(docs): build issue * refactor: add getCustomStaticPath * chore(docs): add comment for getStaticProps * fix(docs): comment syntax * refactor(docs): use preval for getCustomStaticPath * fix(docs): getCustomStaticPath platformsArr * fix(docs): remove figma from unavailable framework nav * fix(docs): use frontmatter to replace preval for supportedFramework * fix(docs): getCustomStaticPath undefined * fix(docs): 404 spikes * fix(docs): specify side nav supported platforms * chore(docs): add types to links Co-authored-by: 0618 <[email protected]>
1 parent 7e14dc6 commit c94707e

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

docs/src/components/Layout/FrameworkChooser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const FrameworkLink = ({
2626
: `/${framework}`;
2727

2828
return (
29-
<Link href={href} passHref>
29+
<Link href={isDisabled ? '' : href} passHref>
3030
<Button
3131
size="small"
3232
className={classNames}

docs/src/data/links.tsx

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { IconType } from 'react-icons/lib';
12
import {
23
MdFormatSize,
3-
MdOutlineCheckBox,
44
MdTextFormat,
55
MdOutlineImage,
66
MdInsertEmoticon,
@@ -12,8 +12,6 @@ import {
1212
MdWarning,
1313
MdNotes,
1414
MdInput,
15-
MdArrowDropDown,
16-
MdArrowDropDownCircle,
1715
MdAddBox,
1816
MdSearch,
1917
MdPassword,
@@ -28,7 +26,6 @@ import {
2826
MdExpand,
2927
MdTableChart,
3028
MdMoreHoriz,
31-
MdHideSource,
3229
MdLink,
3330
MdMenu,
3431
MdTab,
@@ -37,16 +34,17 @@ import {
3734
MdDisabledVisible,
3835
MdRefresh,
3936
MdTune,
40-
MdSystemUpdate,
4137
MdSystemUpdateAlt,
4238
MdCheckCircle,
4339
} from 'react-icons/md';
4440

4541
export interface ComponentNavItem {
4642
href: string;
4743
label: string;
48-
body: string;
44+
body?: string;
45+
platforms: string[];
4946
tertiary?: boolean;
47+
icon?: IconType;
5048
}
5149

5250
const sortByLabel = (a: ComponentNavItem, b: ComponentNavItem) =>
@@ -104,7 +102,7 @@ export const baseComponents: ComponentNavItem[] = [
104102
},
105103
].sort(sortByLabel);
106104

107-
export const connectedComponents = [
105+
export const connectedComponents: ComponentNavItem[] = [
108106
{
109107
href: '/connected-components/authenticator',
110108
label: 'Authenticator',
@@ -137,7 +135,7 @@ export const connectedComponents = [
137135
},
138136
];
139137

140-
export const dataDisplayComponents = [
138+
export const dataDisplayComponents: ComponentNavItem[] = [
141139
{
142140
href: '/components/badge',
143141
label: 'Badge',
@@ -178,7 +176,7 @@ export const feedbackComponents: ComponentNavItem[] = [
178176
},
179177
].sort(sortByLabel);
180178

181-
export const inputComponents = [
179+
export const inputComponents: ComponentNavItem[] = [
182180
{
183181
href: '/components/textareafield',
184182
label: 'TextArea Field',
@@ -272,7 +270,7 @@ export const inputComponents = [
272270
},
273271
].sort(sortByLabel);
274272

275-
export const layoutComponents = [
273+
export const layoutComponents: ComponentNavItem[] = [
276274
{
277275
href: '/components/card',
278276
label: 'Card',
@@ -324,7 +322,7 @@ export const layoutComponents = [
324322
},
325323
].sort(sortByLabel);
326324

327-
export const utilityComponents = [
325+
export const utilityComponents: ComponentNavItem[] = [
328326
{
329327
href: '/components/visuallyhidden',
330328
label: 'Visually Hidden',
@@ -358,7 +356,10 @@ export const navigationComponents: ComponentNavItem[] = [
358356
},
359357
].sort(sortByLabel);
360358

361-
export const primitiveComponents = [
359+
export const primitiveComponents: {
360+
heading?: string;
361+
components: ComponentNavItem[];
362+
}[] = [
362363
{
363364
components: [
364365
{
@@ -398,7 +399,7 @@ export const primitiveComponents = [
398399
},
399400
];
400401

401-
export const legacyComponents = [
402+
export const legacyComponents: ComponentNavItem[] = [
402403
{
403404
href: '/legacy-components/chatbot',
404405
label: 'Chatbot',
@@ -413,10 +414,11 @@ export const legacyComponents = [
413414
},
414415
];
415416

416-
export const guides = [
417+
export const guides: ComponentNavItem[] = [
417418
{
418419
href: '/guides',
419420
label: 'Overview',
421+
platforms: ['react'],
420422
},
421423
{
422424
href: '/guides/css-in-js',
@@ -430,18 +432,21 @@ export const guides = [
430432
},
431433
];
432434

433-
export const gettingStarted = [
435+
export const gettingStarted: ComponentNavItem[] = [
434436
{
435437
href: '/getting-started/introduction',
436438
label: 'Introduction',
439+
platforms: ['react', 'vue', 'angular', 'flutter'],
437440
},
438441
{
439442
href: '/getting-started/installation',
440443
label: 'Installation',
444+
platforms: ['react', 'vue', 'angular', 'flutter'],
441445
},
442446
{
443447
href: '/getting-started/usage',
444448
label: 'Usage',
449+
platforms: ['react', 'vue', 'angular'],
445450
},
446451
{
447452
href: '/getting-started/usage/create-react-app',
@@ -463,6 +468,7 @@ export const gettingStarted = [
463468
{
464469
href: '/getting-started/accessibility',
465470
label: 'Accessibility',
471+
platforms: ['react', 'vue', 'angular'],
466472
},
467473
{
468474
href: '/getting-started/migration',
@@ -476,10 +482,11 @@ export const gettingStarted = [
476482
},
477483
];
478484

479-
export const theming = [
485+
export const theming: ComponentNavItem[] = [
480486
{
481487
href: '/theming',
482488
label: 'Overview',
489+
platforms: ['react', 'vue', 'angular', 'flutter'],
483490
},
484491
{
485492
href: '/theming/responsive',
@@ -512,6 +519,7 @@ export const theming = [
512519
{
513520
href: '/theming/dark-mode',
514521
label: 'Dark mode',
522+
platforms: ['react', 'vue', 'angular', 'flutter'],
515523
},
516524
{
517525
href: '/theming/css-variables',

docs/src/pages/[platform]/getting-started/usage/usage.flutter.mdx

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)