Sort labels by name
This commit is contained in:
@ -178,9 +178,11 @@ export function LibraryGridCard(props: LinkedItemCardProps): JSX.Element {
|
||||
minHeight: '35px',
|
||||
}}
|
||||
>
|
||||
{props.item.labels?.map(({ name, color }, index) => (
|
||||
<LabelChip key={index} text={name || ''} color={color} />
|
||||
))}
|
||||
{props.item.labels
|
||||
?.sort((a, b) => a.name.localeCompare(b.name))
|
||||
.map(({ name, color }, index) => (
|
||||
<LabelChip key={index} text={name || ''} color={color} />
|
||||
))}
|
||||
</HStack>
|
||||
<VStack
|
||||
css={{
|
||||
|
||||
@ -118,9 +118,11 @@ export function LibraryListCard(props: LinkedItemCardProps): JSX.Element {
|
||||
display: 'block',
|
||||
}}
|
||||
>
|
||||
{props.item.labels?.map(({ name, color }, index) => (
|
||||
<LabelChip key={index} text={name || ''} color={color} />
|
||||
))}
|
||||
{props.item.labels
|
||||
?.sort((a, b) => a.name.localeCompare(b.name))
|
||||
.map(({ name, color }, index) => (
|
||||
<LabelChip key={index} text={name || ''} color={color} />
|
||||
))}
|
||||
</HStack>
|
||||
</HStack>
|
||||
</VStack>
|
||||
|
||||
Reference in New Issue
Block a user