8000 style tweaks · githubocto/flat-vscode@66440e8 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Commit 66440e8

Browse files
author
Matt Rothenberg
committed
style tweaks
1 parent 47b37be commit 66440e8

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"dependencies": {
8787
"@octokit/rest": "^18.1.0",
8888
"@octokit/types": "^6.10.0",
89+
"@primer/octicons-react": "^12.1.0",
8990
"@reach/accordion": "^0.13.2",
9091
"connection-string": "^4.3.2",
9192
"cronstrue": "^1.109.0",

src/webview/components/workflow-runs.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from "@reach/accordion";
99
import "@reach/accordion/styles.css";
1010
import { formatRelative } from "date-fns";
11+
import { ChevronDownIcon, ChevronUpIcon } from "@primer/octicons-react";
1112

1213
import { useRun, useWorkflowRuns } from "../hooks";
1314
import { capitalize } from "../lib";
@@ -43,6 +44,24 @@ function RunDetails({ id }) {
4344
);
4445
}
4546

47+
function CustomAccordionButton({ run }) {
48+
const { isExpanded } = useAccordionItemContext();
49+
return (
50+
<AccordionButton className="w-full text-left h-8 focus:outline-none focus:ring">
51+
<div className="flex items-center justify-between">
52+
{makeWorkflowLabel(run)}
53+
<span className="opacity-40">
54+
{isExpanded ? (
55+
<ChevronUpIcon size={16} />
56+
) : (
57+
<ChevronDownIcon size={16} />
58+
)}
59+
</span>
60+
</div>
61+
</AccordionButton>
62+
);
63+
}
64+
4665
export function WorkflowRuns() {
4766
const { data, isLoading, isSuccess } = useWorkflowRuns();
4867

@@ -63,9 +82,7 @@ export function WorkflowRuns() {
6382
{workflow_runs.map((run) => {
6483
return (
6584
<AccordionItem key={run.id}>
66-
<AccordionButton className="w-full text-left h-8 focus:outline-none focus:ring">
67-
{makeWorkflowLabel(run)}
68-
</AccordionButton>
85+
<CustomAccordionButton run={run} />
6986
<AccordionPanel>
7087
<RunDetails id={run.id} />
7188
</AccordionPanel>

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,6 +1599,11 @@
15991599
chrome-trace-event "^1.0.2"
16001600
nullthrows "^1.1.1"
16011601

1602+
"@primer/octicons-react@^12.1.0":
1603+
version "12.1.0"
1604+
resolved "https://registry.yarnpkg.com/@primer/octicons-react/-/octicons-react-12.1.0.tgz#7556450199e0c10e72e99dd02c59f1ac33544767"
1605+
integrity sha512-eb/5Obsp6/pVkyzzGhobK6aPAkKqx6VleF/7HYeihGTYm3rGZc+prL/jhxD5Mo1P6U343YEkHjc2gKuvtENn1g==
1606+
16021607
"@reach/accordion@^0.13.2":
16031608
version "0.13.2"
16041609
resolved "https://registry.yarnpkg.com/@reach/accordion/-/accordion-0.13.2.tgz#0fd6ac089df685bf092233b4a1efcec123fcc377"

0 commit comments

Comments
 (0)
0