Skip to content

Commit

Permalink
chore: removed nested a tag
Browse files Browse the repository at this point in the history
  • Loading branch information
stevekaplan123 committed Jun 27, 2024
1 parent 1fe3983 commit 91e4c50
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions static/js/SearchSheetResult.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ class SearchSheetResult extends Component {
}
formatDate(dateString) {
const date = new Date(dateString);
// Define options for Intl.DateTimeFormat
const options = { year: 'numeric', month: 'long', day: 'numeric' };
// Use Intl.DateTimeFormat to format the date
return new Intl.DateTimeFormat('en-US', options).format(date);
}
render() {
Expand All @@ -43,28 +41,28 @@ class SearchSheetResult extends Component {
const snippetClasses = classNames({snippet: 1, en: snippetMarkup.lang === "en", he: snippetMarkup.lang === "he"});
const ownerIsHe = Sefaria.hebrew.isHebrew(s.owner_name);
const titleIsHe = Sefaria.hebrew.isHebrew(clean_title);
const date = this.formatDate(this.props.metadata.dateCreated);
const dateString = this.formatDate(this.props.metadata.dateCreated);
return (
<div className='result sheetResult'>
<a href={href} onClick={this.handleSheetClick}>
<div className="sheetData sans-serif">
<a className="ownerData sans-serif" href={s.profile_url} onClick={this.handleProfileClick}>
<ProfilePic
url={s.owner_image}
name={s.owner_name}
len={30}
/>
<span className={classNames({
'ownerName': 1,
'in-en': !ownerIsHe,
'in-he': ownerIsHe
})}>{s.owner_name}</span>
<span className="bullet">{'\u2022'}</span>
<span className="date">
{date}
<div className="sheetData sans-serif">
<a className="ownerData sans-serif" href={s.profile_url} onClick={this.handleProfileClick}>
<ProfilePic
url={s.owner_image}
name={s.owner_name}
len={30}
/>
<span className={classNames({
'ownerName': 1,
'in-en': !ownerIsHe,
'in-he': ownerIsHe
})}>{s.owner_name}</span>
<span className="bullet">{'\u2022'}</span>
<span className="date">
{dateString}
</span>
</a>
</div>
</a>
</div>
<a href={href} onClick={this.handleSheetClick}>
<div className={classNames({'result-title': 1, 'in-en': !titleIsHe, 'in-he': titleIsHe})}>
<span dir={titleIsHe ? "rtl" : "ltr"}>{clean_title}</span>
</div>
Expand Down

0 comments on commit 91e4c50

Please sign in to comment.