@unitedstatespowersquadrons/components 1.3.13 → 1.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Badges/Checks/Check.tsx +3 -9
- package/Badges/Checks/Run.tsx +7 -2
- package/Badges/Checks/Suite.tsx +8 -1
- package/Badges/types.ts +1 -0
- package/package.json +1 -1
package/Badges/Checks/Check.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { shields } from "../remotes";
|
|
3
3
|
import { badgeify } from "../helpers";
|
|
4
4
|
import { CheckConclusion, CheckStatus } from "../types";
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
|
-
repo?: string | undefined;
|
|
8
7
|
label: string;
|
|
9
8
|
status: CheckStatus;
|
|
10
9
|
conclusion?: CheckConclusion | undefined;
|
|
@@ -12,7 +11,7 @@ interface Props {
|
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
const CheckBadge = (props: Props) => {
|
|
15
|
-
const { conclusion, label,
|
|
14
|
+
const { conclusion, label, skipCi, status } = props;
|
|
16
15
|
|
|
17
16
|
const suiteBadgeColor = () => {
|
|
18
17
|
if (skipCi) return "lightgray";
|
|
@@ -65,12 +64,7 @@ const CheckBadge = (props: Props) => {
|
|
|
65
64
|
};
|
|
66
65
|
const color = suiteBadgeColor();
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
<img src={`${shields}/badge/${badgeify(label)}-${description() || "Unknown"}-${color}?logo=github`} />;
|
|
70
|
-
|
|
71
|
-
if (!repo || conclusion === "success") return img;
|
|
72
|
-
|
|
73
|
-
return <a href={`${github}/${repo}/actions/workflows/main.yml`} rel="noreferrer" target="_blank">{img}</a>;
|
|
67
|
+
return <img src={`${shields}/badge/${badgeify(label)}-${description() || "Unknown"}-${color}?logo=github`} />;
|
|
74
68
|
};
|
|
75
69
|
|
|
76
70
|
export default CheckBadge;
|
package/Badges/Checks/Run.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Check from "./Check";
|
|
3
|
+
import { github } from "../remotes";
|
|
3
4
|
import { CheckRun } from "../types";
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
@@ -12,11 +13,15 @@ const RunBadge = (props: Props) => {
|
|
|
12
13
|
|
|
13
14
|
if (!run || !run.status) return null;
|
|
14
15
|
|
|
15
|
-
const { conclusion, name, status } = run;
|
|
16
|
+
const { conclusion, id, name, status } = run;
|
|
16
17
|
|
|
17
18
|
const skipCi = false;
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
const badge = <Check conclusion={conclusion} label={name} skipCi={skipCi} status={status} />;
|
|
21
|
+
|
|
22
|
+
if (!repo || conclusion === "success") return badge;
|
|
23
|
+
|
|
24
|
+
return <a href={`${github}/${repo}/runs/${id}`} rel="noreferrer" target="_blank">{badge}</a>;
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
export default RunBadge;
|
package/Badges/Checks/Suite.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Check from "./Check";
|
|
3
|
+
import { github } from "../remotes";
|
|
3
4
|
import { CheckSuite } from "../types";
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
@@ -14,7 +15,13 @@ const SuiteBadge = (props: Props) => {
|
|
|
14
15
|
|
|
15
16
|
const { headBranch, conclusion, skipCi, status } = suite;
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
const badge = <Check conclusion={conclusion} label={headBranch} skipCi={skipCi} status={status} />;
|
|
19
|
+
|
|
20
|
+
if (!repo || conclusion === "success") return badge;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<a href={`${github}/${repo}/actions?query=branch:${headBranch}`} rel="noreferrer" target="_blank">{badge}</a>
|
|
24
|
+
);
|
|
18
25
|
};
|
|
19
26
|
|
|
20
27
|
export default SuiteBadge;
|
package/Badges/types.ts
CHANGED