Skip to content

Commit

Permalink
Core render t props (#707)
Browse files Browse the repository at this point in the history
* CORE: add t prop

* CORE: add bool
  • Loading branch information
ekachxaidze98 authored Nov 11, 2024
1 parent 8447cda commit b198c6d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/modules/search-result/search-result.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const fullTextStatus = ({ title, fullTextLink } = {}) => {
}

const SearchResult = ({
renderRedirectLink,
children,
id,
className,
Expand Down Expand Up @@ -155,7 +156,11 @@ const SearchResult = ({
itemType="https://schema.org/Person"
>
<a
href={`/search?q=author:(${a.name})&t=${searchId}-${workId}`}
href={
renderRedirectLink
? `/search?q=author:(${a.name})&t=${searchId}-${workId}`
: `/search?q=author:(${a.name})`
}
className={styles.link}
>
<span itemProp="name">{a.name.replace(',', ' ')}</span>
Expand Down Expand Up @@ -210,7 +215,11 @@ const SearchResult = ({
className={styles.dataProvider}
>
<Link
href={`//core.ac.uk/data-providers/${dataProvider.id}?t=${searchId}-${workId}`}
href={
renderRedirectLink
? `//core.ac.uk/data-providers/${dataProvider.id}?t=${searchId}-${workId}`
: `//core.ac.uk/data-providers/${dataProvider.id}`
}
className={styles.repositoryLink}
>
<span itemProp="name">{dataProvider.name}</span>
Expand All @@ -227,6 +236,7 @@ SearchResult.propTypes = {
id: PropTypes.string.isRequired,
searchId: PropTypes.string,
useLogo: PropTypes.bool,
renderRedirectLink: PropTypes.bool,
data: PropTypes.shape({
workId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
title: PropTypes.string,
Expand Down

0 comments on commit b198c6d

Please sign in to comment.