diff --git a/src/course-home/courseware-search/CoursewareSearchResults.jsx b/src/course-home/courseware-search/CoursewareSearchResults.jsx index 4ddcda98f6..537fe25e52 100644 --- a/src/course-home/courseware-search/CoursewareSearchResults.jsx +++ b/src/course-home/courseware-search/CoursewareSearchResults.jsx @@ -31,12 +31,11 @@ const CoursewareSearchResults = ({ intl, results }) => { const key = type.toLowerCase(); const icon = iconTypeMapping[key] || defaultIcon; - const linkProps = { href }; - - if (isExternal) { - linkProps.target = '_blank'; - linkProps.rel = 'nofollow'; - } + const linkProps = isExternal ? { + href, + target: '_blank', + rel: 'nofollow', + } : { href }; return (