Skip to content

Commit d2636ae

Browse files
authored
Render tags in sorted order (#1790)
1 parent b6f6fc4 commit d2636ae

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/shell/components/Head/Head.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,13 @@ export default connect((state, props) => {
7474
</div>
7575

7676
{props.tags.length ? (
77-
props.tags.map((tag, index) => {
78-
return <HeadTag key={index} tag={tag} dispatch={props.dispatch} />;
79-
})
77+
props.tags
78+
.sort((a, b) => (a.sort > b.sort ? 1 : -1))
79+
.map((tag, index) => {
80+
return (
81+
<HeadTag key={index} tag={tag} dispatch={props.dispatch} />
82+
);
83+
})
8084
) : (
8185
<h3 className={cx(styles.headline, styles.NoTags)}>
8286
No head tags have been created for this item.

0 commit comments

Comments
 (0)