Skip to content

Commit

Permalink
Fix style for Page component and badly translated captions
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleguido committed Oct 9, 2023
1 parent 7331ee8 commit 3a287bd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
16 changes: 12 additions & 4 deletions src/components/DocumentImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ import DocumentReference from './DocumentReference'
import DocumentDate from './DocumentDate'
import '../styles/components/DocumentImage.css'
import { useTranslation } from 'react-i18next'
import { useAvailableLanguage } from '../hooks/language'

const DocumentImage = ({ doc = { data: {} }, language = 'en', onClick, className = '' }) => {
const { t } = useTranslation()
const mediumResolution = doc.data.resolutions?.medium?.url
const thumbnailResolution = doc.data.resolutions?.thumbnail?.url
const caption = doc.data.title || doc.title || doc.slug

const { availableLanguage } = useAvailableLanguage({
translatable: doc.data.title,
})
const caption =
typeof doc.data.title === 'object'
? doc.data.title[availableLanguage]
: doc.data.title || doc.title || doc.slug
const references = Array.isArray(doc.documents)
? doc.documents.filter((d) => d.type === 'bibtex')
: null
Expand All @@ -26,12 +34,12 @@ const DocumentImage = ({ doc = { data: {} }, language = 'en', onClick, className
{references !== null ? (
references.map((ref) => <DocumentReference className="" key={ref.id} doc={ref} />)
) : (
<>
<p>
<em>{caption}</em>
<br />
<i>{caption}</i>
{doc.data.creator}
<br />
</>
</p>
)}
<DocumentDate doc={doc} references={references} language={language}>
{t('unkownDate')}
Expand Down
8 changes: 7 additions & 1 deletion src/styles/pages/Page.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
}

.Page h3 {
font-weight: bold;
font-weight: 600;
letter-spacing: 0.055em;
}

.Page h3 em {
font-weight: 750;
font-style: normal;
}

.Page table td {
Expand Down

0 comments on commit 3a287bd

Please sign in to comment.