Skip to content

Commit d59d544

Browse files
chore(icons): preserve stepper number order
Keep the Stepper gallery rows in 0 through 9 order while leaving the other icon categories alphabetical.
1 parent a311a27 commit d59d544

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

packages/site/views/_data/materialIcons.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,26 @@ const iconsByCategory = categoryOrder
2121
.map((category) => {
2222
const categoryIcons = icons.filter((icon) => icon.category === category);
2323

24-
categoryIcons.sort((a, b) => a.name.localeCompare(b.name));
24+
if (category === 'Stepper') {
25+
const stepperOrder = [
26+
'ListZero',
27+
'ListOne',
28+
'ListTwo',
29+
'ListThree',
30+
'ListFour',
31+
'ListFive',
32+
'ListSix',
33+
'ListSeven',
34+
'ListEight',
35+
'ListNine',
36+
];
37+
38+
categoryIcons.sort((a, b) => {
39+
return stepperOrder.indexOf(a.name) - stepperOrder.indexOf(b.name);
40+
});
41+
} else {
42+
categoryIcons.sort((a, b) => a.name.localeCompare(b.name));
43+
}
2544

2645
return {
2746
category,

0 commit comments

Comments
 (0)