Skip to content

Commit

Permalink
fix(docs): sorting nav items objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Mar 2, 2021
1 parent d892ea7 commit ff2975c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/docs/generate-components-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ function generateComponentsNavigation(components) {
packageName: key,
groups: Object.entries(groups).map(([ key, value ]) => ({
group: key,
items: value.sort((a, b) => a.localeCompare(b))
items: value.sort((a, b) => {
const firsTitle = typeof a === 'object' ? a.title : a;
const secondTitle = typeof b === 'object' ? b.title : b
return firsTitle.localeCompare(secondTitle);
})
})).sort((a, b) => a.group.localeCompare(b.group))
})).sort((a, b) => a.packageName.localeCompare(b.packageName));
}
Expand Down

0 comments on commit ff2975c

Please sign in to comment.