Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/components/Card/TagsDiv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ const TagsDiv = (props: {
return accum;
}, []);
};

const baseTags = props.tags
// Sort tags so that externalJS and archived tags come first
.sort((a) =>
a === t("grid.externalJS") || a === t("grid.archived") ? -1 : 1,
)
.slice(0, MAX_TAGS);
const extraTags = props.tags.slice(MAX_TAGS);
// Sort tags so that externalJS and archived tags come first
let baseTags = props.tags.sort((a) => a === t("grid.externalJS") || a === t("grid.archived") ? -1 : 1);
let extraTags: string[] = [];
// If there are more than one extra tags, slice them and add an expand button
if (baseTags.length - MAX_TAGS > 1) {
extraTags = props.tags.slice(MAX_TAGS);
baseTags = baseTags.slice(0, MAX_TAGS);
}

// Render the tags list and add expand button if there are more tags
return (
Expand Down