chore: run prettier

Co-authored-by: Isaac <contact@eartharoid.me>
This commit is contained in:
alexsparkes
2024-05-21 20:51:33 +01:00
parent bf78a8a9f5
commit 003bf2400a
32 changed files with 229 additions and 184 deletions

View File

@@ -145,16 +145,20 @@ class Quote extends PureComponent {
`https://${
variables.languagecode.split('_')[0]
}.wikipedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:${
authorPage.pageimage
authorPage.pageimage
}&origin=*&format=json`,
)
).json();
const authorImagePage = authorimglicensedata.query.pages[Object.keys(authorimglicensedata.query.pages)[0]];
const authorImagePage =
authorimglicensedata.query.pages[Object.keys(authorimglicensedata.query.pages)[0]];
const metadata = authorImagePage?.imageinfo?.[0]?.extmetadata;
const license = metadata?.LicenseShortName;
const photographer =
this.stripHTML(metadata?.Attribution?.value || metadata?.Artist?.value || '').replace(/ \(talk\)/, '') || // talk page link (if applicable) is only removed for English
this.stripHTML(metadata?.Attribution?.value || metadata?.Artist?.value || '').replace(
/ \(talk\)/,
'',
) || // talk page link (if applicable) is only removed for English
'Unknown';
authorimglicense = `© ${photographer}. ${license.value}`;
authorimglicense = authorimglicense.replace(/copyright\s/i, '').replace(/©\s©\s/, '© ');
@@ -281,7 +285,9 @@ class Quote extends PureComponent {
author: data.author,
authorlink: this.getAuthorLink(data.author),
authorimg: authorimgdata.authorimg,
authorimglicense: authorimgdata.authorimglicense && authorimgdata.authorimglicense.replace(' undefined. ', ' '),
authorimglicense:
authorimgdata.authorimglicense &&
authorimgdata.authorimglicense.replace(' undefined. ', ' '),
quoteLanguage: quoteLanguage,
authorOccupation: data.author_occupation,
};
@@ -455,8 +461,10 @@ class Quote extends PureComponent {
{this.state.authorOccupation !== 'Unknown' && (
<span className="subtitle">{this.state.authorOccupation}</span>
)}
<span className="author-license" title={this.state.authorimglicense}>
{this.state.authorimglicense && (this.state.authorimglicense.substring(0, 40) + (this.state.authorimglicense.length > 40 ? '…' : ''))}
<span className="author-license" title={this.state.authorimglicense}>
{this.state.authorimglicense &&
this.state.authorimglicense.substring(0, 40) +
(this.state.authorimglicense.length > 40 ? '…' : '')}
</span>
</div>
) : (

View File

@@ -102,7 +102,8 @@ h1.quoteauthor {
padding: 20px;
text-align: left;
.title, .subtitle {
.title,
.subtitle {
text-transform: capitalize;
}
}