1
Fork 0

Fix timeline ordering (#531) + layout fixes for AlbumBox

This commit is contained in:
viktorstrate 2021-09-26 13:42:00 +02:00
parent df070309f8
commit 68b6a49638
No known key found for this signature in database
GPG Key ID: 3F855605109C1E8A
2 changed files with 7 additions and 4 deletions

View File

@ -20,7 +20,8 @@ func (r *queryResolver) MyTimeline(ctx context.Context, paginate *models.Paginat
Order("YEAR(media.date_shot) DESC").
Order("MONTH(media.date_shot) DESC").
Order("DAY(media.date_shot) DESC").
Order("albums.title ASC")
Order("albums.title ASC").
Order("TIME(media.date_shot) DESC")
if fromDate != nil {
query = query.Where("media.date_shot < ?", fromDate)

View File

@ -25,7 +25,7 @@ const AlbumBoxImage = ({ src, ...props }: AlbumBoxImageProps) => {
let placeholder = null
if (!loaded) {
placeholder = (
<div className="bg-gray-100 animate-pulse w-full h-full rounded-lg absolute"></div>
<div className="bg-gray-100 animate-pulse w-full h-full rounded-lg absolute top-0"></div>
)
}
@ -44,7 +44,7 @@ type AlbumBoxProps = {
export const AlbumBox = ({ album, customLink, ...props }: AlbumBoxProps) => {
const wrapperClasses =
'inline-block text-center text-gray-900 mx-3 my-2 xs:h-60'
'inline-block text-center text-gray-900 mx-3 my-2 xs:h-60 xs:w-[220px]'
if (album) {
return (
@ -54,7 +54,9 @@ export const AlbumBox = ({ album, customLink, ...props }: AlbumBoxProps) => {
{...props}
>
<AlbumBoxImage src={album.thumbnail?.thumbnail?.url} />
<p>{album.title}</p>
<p className="whitespace-nowrap overflow-hidden overflow-ellipsis">
{album.title}
</p>
</Link>
)
}