Add places to about page
This commit is contained in:
parent
d3b1339c69
commit
440c7b3f03
@ -61,6 +61,10 @@ export default async function AboutPage() {
|
|||||||
films,
|
films,
|
||||||
} = categories;
|
} = categories;
|
||||||
|
|
||||||
|
const place = albums
|
||||||
|
.slice()
|
||||||
|
.sort((a, b) => b.count - a.count)[0]?.album.location;
|
||||||
|
|
||||||
const lastModifiedSite = max([
|
const lastModifiedSite = max([
|
||||||
getLastModifiedForCategories(categories, photos),
|
getLastModifiedForCategories(categories, photos),
|
||||||
about?.updatedAt,
|
about?.updatedAt,
|
||||||
@ -80,8 +84,9 @@ export default async function AboutPage() {
|
|||||||
lens={lenses[0]?.lens}
|
lens={lenses[0]?.lens}
|
||||||
recipe={recipes[0]?.recipe}
|
recipe={recipes[0]?.recipe}
|
||||||
film={films[0]?.film}
|
film={films[0]?.film}
|
||||||
album={albums[0]?.album}
|
|
||||||
tag={tags.filter(({ tag }) => tag !== TAG_FAVS)[0]?.tag}
|
tag={tags.filter(({ tag }) => tag !== TAG_FAVS)[0]?.tag}
|
||||||
|
place={place}
|
||||||
|
album={albums[0]?.album}
|
||||||
lastUpdated={lastModifiedSite}
|
lastUpdated={lastModifiedSite}
|
||||||
/>
|
/>
|
||||||
: <PhotosEmptyState />
|
: <PhotosEmptyState />
|
||||||
|
|||||||
@ -24,6 +24,8 @@ import Link from 'next/link';
|
|||||||
import { PATH_ADMIN_ABOUT_EDIT } from '@/app/path';
|
import { PATH_ADMIN_ABOUT_EDIT } from '@/app/path';
|
||||||
import { LuCirclePlus, LuUser } from 'react-icons/lu';
|
import { LuCirclePlus, LuUser } from 'react-icons/lu';
|
||||||
import AdminEmptyState from '@/admin/AdminEmptyState';
|
import AdminEmptyState from '@/admin/AdminEmptyState';
|
||||||
|
import { Place } from '@/place';
|
||||||
|
import PlaceEntity from '@/place/PlaceEntity';
|
||||||
|
|
||||||
export default function AboutPageClient({
|
export default function AboutPageClient({
|
||||||
title,
|
title,
|
||||||
@ -37,8 +39,9 @@ export default function AboutPageClient({
|
|||||||
lens,
|
lens,
|
||||||
recipe,
|
recipe,
|
||||||
film,
|
film,
|
||||||
album,
|
|
||||||
tag,
|
tag,
|
||||||
|
place,
|
||||||
|
album,
|
||||||
lastUpdated,
|
lastUpdated,
|
||||||
}: {
|
}: {
|
||||||
title?: string
|
title?: string
|
||||||
@ -52,8 +55,9 @@ export default function AboutPageClient({
|
|||||||
lens?: Lens
|
lens?: Lens
|
||||||
recipe?: string
|
recipe?: string
|
||||||
film?: string
|
film?: string
|
||||||
album?: Album
|
|
||||||
tag?: string
|
tag?: string
|
||||||
|
place?: Place
|
||||||
|
album?: Album
|
||||||
lastUpdated?: Date
|
lastUpdated?: Date
|
||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
@ -118,14 +122,6 @@ export default function AboutPageClient({
|
|||||||
badged={false}
|
badged={false}
|
||||||
/>,
|
/>,
|
||||||
),
|
),
|
||||||
album && renderItem(
|
|
||||||
appText.about.recentAlbum,
|
|
||||||
<PhotoAlbum
|
|
||||||
album={album}
|
|
||||||
type="text-only"
|
|
||||||
contrast="high"
|
|
||||||
/>,
|
|
||||||
),
|
|
||||||
tag && renderItem(
|
tag && renderItem(
|
||||||
appText.about.popularTag,
|
appText.about.popularTag,
|
||||||
<PhotoTag
|
<PhotoTag
|
||||||
@ -134,6 +130,23 @@ export default function AboutPageClient({
|
|||||||
contrast="high"
|
contrast="high"
|
||||||
/>,
|
/>,
|
||||||
),
|
),
|
||||||
|
place && renderItem(
|
||||||
|
appText.about.popularPlace,
|
||||||
|
<PlaceEntity
|
||||||
|
place={place}
|
||||||
|
type="text-only"
|
||||||
|
contrast="high"
|
||||||
|
badged={false}
|
||||||
|
/>,
|
||||||
|
),
|
||||||
|
album && renderItem(
|
||||||
|
appText.about.recentAlbum,
|
||||||
|
<PhotoAlbum
|
||||||
|
album={album}
|
||||||
|
type="text-only"
|
||||||
|
contrast="high"
|
||||||
|
/>,
|
||||||
|
),
|
||||||
].filter(Boolean), [
|
].filter(Boolean), [
|
||||||
appText.about,
|
appText.about,
|
||||||
photosCount,
|
photosCount,
|
||||||
@ -143,6 +156,7 @@ export default function AboutPageClient({
|
|||||||
recipe,
|
recipe,
|
||||||
film,
|
film,
|
||||||
album,
|
album,
|
||||||
|
place,
|
||||||
tag,
|
tag,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -199,9 +213,9 @@ export default function AboutPageClient({
|
|||||||
<AnimateItems
|
<AnimateItems
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'grid gap-x-2 gap-y-6 grid-cols-2',
|
'grid gap-x-2 gap-y-6 grid-cols-2',
|
||||||
items.length <= 6
|
items.length === 7 || items.length === 8
|
||||||
? 'lg:grid-cols-3'
|
? 'lg:grid-cols-4'
|
||||||
: 'lg:grid-cols-4',
|
: 'lg:grid-cols-3',
|
||||||
)}
|
)}
|
||||||
items={items}
|
items={items}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: 'শীর্ষ ফিল্ম',
|
topFilm: 'শীর্ষ ফিল্ম',
|
||||||
recentAlbum: 'সাম্প্রতিক অ্যালবাম',
|
recentAlbum: 'সাম্প্রতিক অ্যালবাম',
|
||||||
popularTag: 'জনপ্রিয় ট্যাগ',
|
popularTag: 'জনপ্রিয় ট্যাগ',
|
||||||
|
popularPlace: 'জনপ্রিয় স্থান',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'তৈরি হয়েছে',
|
madeWith: 'তৈরি হয়েছে',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: 'Top Film',
|
topFilm: 'Top Film',
|
||||||
recentAlbum: 'Recent Album',
|
recentAlbum: 'Recent Album',
|
||||||
popularTag: 'Popular Tag',
|
popularTag: 'Popular Tag',
|
||||||
|
popularPlace: 'Popular Place',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'Made with',
|
madeWith: 'Made with',
|
||||||
|
|||||||
@ -64,8 +64,9 @@ export const TEXT = {
|
|||||||
topLens: 'Top Lens',
|
topLens: 'Top Lens',
|
||||||
topRecipe: 'Top Recipe',
|
topRecipe: 'Top Recipe',
|
||||||
topFilm: 'Top Film',
|
topFilm: 'Top Film',
|
||||||
recentAlbum: 'Recent Album',
|
|
||||||
popularTag: 'Popular Tag',
|
popularTag: 'Popular Tag',
|
||||||
|
popularPlace: 'Popular Place',
|
||||||
|
recentAlbum: 'Recent Album',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'Made with',
|
madeWith: 'Made with',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: 'Película principal',
|
topFilm: 'Película principal',
|
||||||
recentAlbum: 'Álbum reciente',
|
recentAlbum: 'Álbum reciente',
|
||||||
popularTag: 'Etiqueta popular',
|
popularTag: 'Etiqueta popular',
|
||||||
|
popularPlace: 'Lugar popular',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'Hecho con',
|
madeWith: 'Hecho con',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: 'शीर्ष फिल्म',
|
topFilm: 'शीर्ष फिल्म',
|
||||||
recentAlbum: 'हाल का एल्बम',
|
recentAlbum: 'हाल का एल्बम',
|
||||||
popularTag: 'लोकप्रिय टैग',
|
popularTag: 'लोकप्रिय टैग',
|
||||||
|
popularPlace: 'लोकप्रिय स्थान',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'निर्मित',
|
madeWith: 'निर्मित',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: 'Film teratas',
|
topFilm: 'Film teratas',
|
||||||
recentAlbum: 'Album terbaru',
|
recentAlbum: 'Album terbaru',
|
||||||
popularTag: 'Tag populer',
|
popularTag: 'Tag populer',
|
||||||
|
popularPlace: 'Tempat populer',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'Dibuat dengan',
|
madeWith: 'Dibuat dengan',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: 'Filme principal',
|
topFilm: 'Filme principal',
|
||||||
recentAlbum: 'Álbum recente',
|
recentAlbum: 'Álbum recente',
|
||||||
popularTag: 'Tag popular',
|
popularTag: 'Tag popular',
|
||||||
|
popularPlace: 'Lugar popular',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'Feito com',
|
madeWith: 'Feito com',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: 'Filme principal',
|
topFilm: 'Filme principal',
|
||||||
recentAlbum: 'Álbum recente',
|
recentAlbum: 'Álbum recente',
|
||||||
popularTag: 'Etiqueta popular',
|
popularTag: 'Etiqueta popular',
|
||||||
|
popularPlace: 'Local popular',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'Feito com',
|
madeWith: 'Feito com',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: 'En çok kullanılan film',
|
topFilm: 'En çok kullanılan film',
|
||||||
recentAlbum: 'Son albüm',
|
recentAlbum: 'Son albüm',
|
||||||
popularTag: 'Popüler etiket',
|
popularTag: 'Popüler etiket',
|
||||||
|
popularPlace: 'Popüler yer',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'Hazırlayan:',
|
madeWith: 'Hazırlayan:',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: 'Phim phổ biến',
|
topFilm: 'Phim phổ biến',
|
||||||
recentAlbum: 'Album gần đây',
|
recentAlbum: 'Album gần đây',
|
||||||
popularTag: 'Thẻ phổ biến',
|
popularTag: 'Thẻ phổ biến',
|
||||||
|
popularPlace: 'Địa điểm phổ biến',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: 'Được tạo bằng',
|
madeWith: 'Được tạo bằng',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export const TEXT: I18N = {
|
|||||||
topFilm: '常用胶片',
|
topFilm: '常用胶片',
|
||||||
recentAlbum: '最近相册',
|
recentAlbum: '最近相册',
|
||||||
popularTag: '热门标签',
|
popularTag: '热门标签',
|
||||||
|
popularPlace: '热门地点',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
madeWith: '基于',
|
madeWith: '基于',
|
||||||
|
|||||||
@ -50,7 +50,7 @@ export default function PlaceEntity({
|
|||||||
label={place.nameFormatted || place.name}
|
label={place.nameFormatted || place.name}
|
||||||
path={place.link}
|
path={place.link}
|
||||||
pathTarget="_blank"
|
pathTarget="_blank"
|
||||||
badged
|
badged={props.badged ?? true}
|
||||||
/>
|
/>
|
||||||
</SharedHover>
|
</SharedHover>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user