Skip to content

Commit b198c6d

Browse files
Core render t props (#707)
* CORE: add t prop * CORE: add bool
1 parent 8447cda commit b198c6d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/modules/search-result/search-result.jsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const fullTextStatus = ({ title, fullTextLink } = {}) => {
5454
}
5555

5656
const SearchResult = ({
57+
renderRedirectLink,
5758
children,
5859
id,
5960
className,
@@ -155,7 +156,11 @@ const SearchResult = ({
155156
itemType="https://schema.org/Person"
156157
>
157158
<a
158-
href={`/search?q=author:(${a.name})&t=${searchId}-${workId}`}
159+
href={
160+
renderRedirectLink
161+
? `/search?q=author:(${a.name})&t=${searchId}-${workId}`
162+
: `/search?q=author:(${a.name})`
163+
}
159164
className={styles.link}
160165
>
161166
<span itemProp="name">{a.name.replace(',', ' ')}</span>
@@ -210,7 +215,11 @@ const SearchResult = ({
210215
className={styles.dataProvider}
211216
>
212217
<Link
213-
href={`//core.ac.uk/data-providers/${dataProvider.id}?t=${searchId}-${workId}`}
218+
href={
219+
renderRedirectLink
220+
? `//core.ac.uk/data-providers/${dataProvider.id}?t=${searchId}-${workId}`
221+
: `//core.ac.uk/data-providers/${dataProvider.id}`
222+
}
214223
className={styles.repositoryLink}
215224
>
216225
<span itemProp="name">{dataProvider.name}</span>
@@ -227,6 +236,7 @@ SearchResult.propTypes = {
227236
id: PropTypes.string.isRequired,
228237
searchId: PropTypes.string,
229238
useLogo: PropTypes.bool,
239+
renderRedirectLink: PropTypes.bool,
230240
data: PropTypes.shape({
231241
workId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
232242
title: PropTypes.string,

0 commit comments

Comments
 (0)