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