From 020ef8af38db3d90033db42be58b597642bab9a6 Mon Sep 17 00:00:00 2001 From: Varun Raj Date: Sat, 30 Nov 2024 12:10:44 +0530 Subject: [PATCH] feat: added options to sort albums Signed-off-by: Varun Raj --- src/components/albums/list/AlbumThumbnail.tsx | 31 ++++++---- src/config/constants/sidebarNavs.tsx | 2 +- src/handlers/api/album.handler.ts | 4 +- src/helpers/string.helper.ts | 19 +++++- src/pages/albums/index.tsx | 61 ++++++++++++++++++- src/pages/api/albums/list.ts | 17 +++++- src/types/album.d.ts | 15 ++--- 7 files changed, 121 insertions(+), 28 deletions(-) diff --git a/src/components/albums/list/AlbumThumbnail.tsx b/src/components/albums/list/AlbumThumbnail.tsx index a8a5007..7ef8b6d 100644 --- a/src/components/albums/list/AlbumThumbnail.tsx +++ b/src/components/albums/list/AlbumThumbnail.tsx @@ -2,7 +2,7 @@ import React, { useMemo } from 'react' import Link from 'next/link'; import { useConfig } from '@/contexts/ConfigContext'; -import { humanizeNumber } from '@/helpers/string.helper'; +import { humanizeBytes, humanizeNumber, pluralize } from '@/helpers/string.helper'; import LazyImage from '@/components/ui/lazy-image'; import { ASSET_THUMBNAIL_PATH } from '@/config/routes'; import { IAlbum } from '@/types/album'; @@ -11,7 +11,7 @@ import { formatDate } from '@/helpers/date.helper'; import { Checkbox } from '@/components/ui/checkbox'; import { differenceInDays } from 'date-fns'; import { FaceIcon } from '@radix-ui/react-icons'; -import { Camera, Image, User } from 'lucide-react'; +import { Calendar, Camera, Image, User } from 'lucide-react'; interface IAlbumThumbnailProps { album: IAlbum; @@ -23,8 +23,8 @@ export default function AlbumThumbnail({ album, onSelect }: IAlbumThumbnailProps }, [album.firstPhotoDate, album.lastPhotoDate]); return ( -
-