Skip to content

Commit

Permalink
Merge pull request #27 from wlfrdssn/Control-description-sheet
Browse files Browse the repository at this point in the history
Symbols for each column
  • Loading branch information
perliedman authored Dec 28, 2024
2 parents 53a3174 + 7008952 commit 3561a1b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ControlDescriptionSheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ function DescriptionSelector({

function DescriptionList({ selected, onSelect, column }) {
const symbols = useMemo(() => {
const symbols = Object.keys(DefinitionTexts);
const symbols = Object.keys(DefinitionTexts).filter((key) => {
if (column === "E") {
return DefinitionTexts[key].kind === "E" || DefinitionTexts[key].kind === "D";
}
return DefinitionTexts[key].kind === column;
});
symbols.sort((a, b) => {
const aDef = DefinitionTexts[a];
const bDef = DefinitionTexts[b];
const aIsCol = aDef.kind === column ? -1 : 1;
const bIsCol = bDef.kind === column ? -1 : 1;

return compare(aIsCol, bIsCol) || compare(a, b);
return compare(a, b);
});
return symbols;
}, [column]);
Expand Down

0 comments on commit 3561a1b

Please sign in to comment.