Skip to content

Commit

Permalink
add comma-space between author names
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantacruz committed Mar 20, 2022
1 parent ace29ef commit 86673ad
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions static/js/AboutBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ class AboutBox extends Component {

let detailSection = null;
if (d) {
let authorsEn, authorsHe;
let authorsElems = {};
if (d.authors && d.authors.length) {
const authorArrayEn = d.authors.filter((elem) => !!elem.en);
const authorArrayHe = d.authors.filter((elem) => !!elem.he);
authorsEn = authorArrayEn.map(author => <a key={author.slug} href={"/topics/" + author.slug}>{author.en}</a> );
authorsHe = authorArrayHe.map(author => <a key={author.slug} href={"/topics/" + author.slug}>{author.he}</a> );
for (let lang of ['en', 'he']) {
const authorArray = d.authors.filter((elem) => !!elem[lang]);
authorsElems[lang] = authorArray.map((author, iauthor) => <span>{iauthor > 0 ? ", " : ""}<a key={author.slug} href={`/topics/${author.slug}`}>{author[lang]}</a></span> );
}
}
// use compPlaceString and compDateString if available. then use compPlace o/w use pubPlace o/w nothing
let placeTextEn, placeTextHe;
Expand Down Expand Up @@ -154,14 +154,14 @@ class AboutBox extends Component {
<span className="tocCategory">
<ContentText text={{en:category, he:Sefaria.hebrewTerm(category)}}/>
</span>
{ authorsEn && authorsEn.length ?
{ authorsElems?.en?.length ?
<div className="aboutAuthor">
<span className="aboutAuthorInner">
<span className="authorLabel">
<ContentText text={{en:"Author:", he: "מחבר:"}} />
</span>
<span className="authorName">
<ContentText text={{en:authorsEn, he: authorsHe}} />
<ContentText text={authorsElems} />
</span>
</span>
</div> : null
Expand Down

0 comments on commit 86673ad

Please sign in to comment.