diff --git a/src/category/data.ts b/src/category/data.ts index 1cb56b35..9a3e6082 100644 --- a/src/category/data.ts +++ b/src/category/data.ts @@ -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; diff --git a/src/focal/index.ts b/src/focal/index.ts index 4089ff32..8d744a79 100644 --- a/src/focal/index.ts +++ b/src/focal/index.ts @@ -65,3 +65,6 @@ export const generateMetaForFocalLength = ( ), images: absolutePathForFocalLengthImage(focal), }); + +export const sortFocalLengths = (focalLengths: FocalLengths) => + focalLengths.sort((a, b) => a.focal - b.focal); diff --git a/src/photo/PhotoGridSidebar.tsx b/src/photo/PhotoGridSidebar.tsx index 42184192..54fe1b49 100644 --- a/src/photo/PhotoGridSidebar.tsx +++ b/src/photo/PhotoGridSidebar.tsx @@ -223,6 +223,7 @@ export default function PhotoGridSidebar({ countOnHover={count} type="text-only" prefetch={false} + badged />)} /> : null;