Sort focal lengths numerically
This commit is contained in:
parent
348e4db25c
commit
35b61a79af
@ -14,6 +14,7 @@ import {
|
||||
} from '@/app/config';
|
||||
import { sortTagsByCount } from '@/tag';
|
||||
import { sortCategoriesByCount } from '@/category';
|
||||
import { sortFocalLengths } from '@/focal';
|
||||
|
||||
export const getDataForCategories = () => [
|
||||
getUniqueCameras()
|
||||
@ -39,7 +40,7 @@ export const getDataForCategories = () => [
|
||||
: [],
|
||||
SHOW_FOCAL_LENGTHS
|
||||
? getUniqueFocalLengths()
|
||||
.then(sortCategoriesByCount)
|
||||
.then(sortFocalLengths)
|
||||
.catch(() => [])
|
||||
: [],
|
||||
] as const;
|
||||
|
||||
@ -65,3 +65,6 @@ export const generateMetaForFocalLength = (
|
||||
),
|
||||
images: absolutePathForFocalLengthImage(focal),
|
||||
});
|
||||
|
||||
export const sortFocalLengths = (focalLengths: FocalLengths) =>
|
||||
focalLengths.sort((a, b) => a.focal - b.focal);
|
||||
|
||||
@ -223,6 +223,7 @@ export default function PhotoGridSidebar({
|
||||
countOnHover={count}
|
||||
type="text-only"
|
||||
prefetch={false}
|
||||
badged
|
||||
/>)}
|
||||
/>
|
||||
: null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user