Skip to content

Commit b4c6426

Browse files
committed
feat: added condition to step sec and deps dev links
1 parent 1d5d5c6 commit b4c6426

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

src/components/ProjectDetails.tsx

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Collapsible from "./Collapsable";
88
import Loading from "./Loading";
99

1010
import { ScoreElement } from "../types";
11+
import { GITHUB } from "../constants/platforms";
1112

1213
import "../styles/ProjectDetails.css";
1314

@@ -61,26 +62,31 @@ function ProjectDetails() {
6162
{`(${data.repo.commit.substring(0, 8)})`}
6263
</a>
6364
</p>
64-
<p data-testid="deps-dev">
65-
Additional info at{" "}
66-
<a
67-
href={`https://deps.dev/project/github/${org}%2F${repo}`}
68-
target="_blank"
69-
rel="noreferrer"
70-
>
71-
deps.dev
72-
</a>
73-
</p>
74-
<p data-testid="step-security">
75-
Improve your scoring with{" "}
76-
<a
77-
href={`https://app.stepsecurity.io/securerepo?repo=${org}/${repo}`}
78-
target="_blank"
79-
rel="noreferrer"
80-
>
81-
StepSecurity
82-
</a>
83-
</p>
65+
{platform === GITHUB && (
66+
<>
67+
<p data-testid="deps-dev">
68+
Additional info at{" "}
69+
<a
70+
href={`https://deps.dev/project/github/${org}%2F${repo}`}
71+
target="_blank"
72+
rel="noreferrer"
73+
>
74+
deps.dev
75+
</a>
76+
</p>
77+
<p data-testid="step-security">
78+
Improve your scoring with{" "}
79+
<a
80+
href={`https://app.stepsecurity.io/securerepo?repo=${org}/${repo}`}
81+
target="_blank"
82+
rel="noreferrer"
83+
>
84+
StepSecurity
85+
</a>
86+
</p>
87+
</>
88+
)}
89+
8490
<hr />
8591
{data.checks.map((element: ScoreElement) => (
8692
<>

src/constants/platforms.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const GITHUB = 'github.com'

0 commit comments

Comments
 (0)