mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-07-20 18:51:47 +00:00
Display images, notes, sources for events as collapsible tabs (#158)
This commit is contained in:
@@ -27,7 +27,9 @@ function formatDate(date: TopolaDate, intl: IntlShape) {
|
||||
formatOptions,
|
||||
).format(dateObject);
|
||||
|
||||
return [translatedQualifier, translatedDate].join(' ');
|
||||
return [translatedQualifier, translatedDate]
|
||||
.filter((dateElement) => dateElement)
|
||||
.join(' ');
|
||||
}
|
||||
|
||||
function formatDateRage(dateRange: DateRange, intl: IntlShape) {
|
||||
|
||||
@@ -291,3 +291,14 @@ export function getFileName(fileEntry: GedcomEntry): string | undefined {
|
||||
|
||||
return fileTitle && fileExtension && fileTitle + '.' + fileExtension;
|
||||
}
|
||||
|
||||
export function getImageFileEntry(
|
||||
objectEntry: GedcomEntry,
|
||||
): GedcomEntry | undefined {
|
||||
return objectEntry.tree.find(
|
||||
(entry) =>
|
||||
entry.tag === 'FILE' &&
|
||||
entry.data.startsWith('http') &&
|
||||
isImageFile(entry.data),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user