详细信息侧边栏新增 Location(按文件名解析的城市)
This commit is contained in:
@@ -17,6 +17,8 @@ import { SidebarPhotoCover } from '../AlbumCovers'
|
||||
import { SidebarPhotoShare } from '../Sharing'
|
||||
import SidebarMediaDownload from '../SidebarDownloadMedia'
|
||||
import SidebarHeader from '../SidebarHeader'
|
||||
import { SidebarSection, SidebarSectionTitle } from '../SidebarComponents'
|
||||
import { mediaCaption } from '../../../helpers/mediaCaption'
|
||||
import { sidebarDownloadQuery_media_downloads } from '../__generated__/sidebarDownloadQuery'
|
||||
import ExifDetails from './MediaSidebarExif'
|
||||
import MediaSidebarPeople from './MediaSidebarPeople'
|
||||
@@ -180,6 +182,8 @@ const SidebarContent = ({ media, hidePreview }: SidebarContentProps) => {
|
||||
sidebarMap = <MediaSidebarMap coordinates={mediaCoordinates} />
|
||||
}
|
||||
|
||||
const locationCity = mediaCaption(media.title)?.city
|
||||
|
||||
let albumPath = null
|
||||
const mediaAlbum = media.album
|
||||
if (!isNil(mediaAlbum)) {
|
||||
@@ -227,6 +231,14 @@ const SidebarContent = ({ media, hidePreview }: SidebarContentProps) => {
|
||||
)}
|
||||
</div>
|
||||
<ExifDetails media={media} />
|
||||
{locationCity && !mediaCoordinates && (
|
||||
<SidebarSection>
|
||||
<SidebarSectionTitle>
|
||||
{t('sidebar.location.title', 'Location')}
|
||||
</SidebarSectionTitle>
|
||||
<div className="mx-4 text-base">{locationCity}</div>
|
||||
</SidebarSection>
|
||||
)}
|
||||
{albumPath}
|
||||
<MediaSidebarPeople media={media} />
|
||||
{sidebarMap}
|
||||
|
||||
Reference in New Issue
Block a user