Skip to content

Commit 22a9500

Browse files
authored
Fix issue with primary repository icon (#53)
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
1 parent e125018 commit 22a9500

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

web/src/layout/detail/repositories/index.tsx

+21-17
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { VscGithub } from 'react-icons/vsc';
66
import { useLocation, useNavigate } from 'react-router-dom';
77

88
import { CATEGORY_ICONS } from '../../../data';
9-
import { Report, Repository, ScoreType } from '../../../types';
9+
import { Report, Repository, RepositoryKind, ScoreType } from '../../../types';
1010
import ElementWithTooltip from '../../common/ElementWithTooltip';
1111
import ExternalLink from '../../common/ExternalLink';
1212
import RoundScore from '../../common/RoundScore';
@@ -77,19 +77,21 @@ const RepositoriesList = (props: Props) => {
7777
<div className="d-none d-md-block">
7878
<div className={`d-flex flex-row h4 fw-bold mb-2 ${styles.titleWrapper}`}>
7979
<div className="text-truncate">{repo.name}</div>
80-
<ElementWithTooltip
81-
className="lh-1 ms-3"
82-
element={
83-
<small>
84-
<FaCrown className="text-warning" />
85-
</small>
86-
}
87-
tooltipWidth={210}
88-
tooltipClassName={styles.tooltipMessage}
89-
tooltipMessage={<div>Project's primary repository.</div>}
90-
visibleTooltip
91-
active
92-
/>
80+
{repo.kind === RepositoryKind.Primary && (
81+
<ElementWithTooltip
82+
className="lh-1 ms-3"
83+
element={
84+
<small>
85+
<FaCrown className="text-warning" />
86+
</small>
87+
}
88+
tooltipWidth={210}
89+
tooltipClassName={styles.tooltipMessage}
90+
tooltipMessage={<div>Project's primary repository.</div>}
91+
visibleTooltip
92+
active
93+
/>
94+
)}
9395
{getAnchorLink(repo)}
9496
</div>
9597
<ExternalLink href={repo.url}>
@@ -104,9 +106,11 @@ const RepositoriesList = (props: Props) => {
104106
<ExternalLink href={repo.url} className={`fw-bold text-truncate ${styles.repoName}`}>
105107
<div className="text-truncate">{repo.name}</div>
106108
</ExternalLink>
107-
<small>
108-
<FaCrown className="d-block d-md-none text-warning ms-2" />
109-
</small>
109+
{repo.kind === RepositoryKind.Primary && (
110+
<small>
111+
<FaCrown className="d-block d-md-none text-warning ms-2" />
112+
</small>
113+
)}
110114
{getAnchorLink(repo)}
111115
</div>
112116
</div>

0 commit comments

Comments
 (0)