cherrypick-interactive 1.10.0 → 1.11.0
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/cli.js +1 -0
- package/package.json +1 -1
- package/src/tui/CommitRow.js +18 -8
package/cli.js
CHANGED
package/package.json
CHANGED
package/src/tui/CommitRow.js
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import { Text, Box
|
|
1
|
+
import { Text, Box } from 'ink';
|
|
2
2
|
import { html } from './html.js';
|
|
3
3
|
|
|
4
4
|
export function CommitRow({ hash, subject, date, isSelected, isCursor }) {
|
|
5
5
|
const checkbox = isSelected ? '☑' : '☐';
|
|
6
6
|
const checkColor = isSelected ? 'green' : 'gray';
|
|
7
7
|
const cursor = isCursor ? '>' : ' ';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
|
|
9
|
+
let subjectColor = 'gray';
|
|
10
|
+
let hashColor = 'dim';
|
|
11
|
+
let dateColor = 'dim';
|
|
12
|
+
if (isCursor) {
|
|
13
|
+
subjectColor = 'white';
|
|
14
|
+
hashColor = 'cyan';
|
|
15
|
+
dateColor = 'gray';
|
|
16
|
+
} else if (isSelected) {
|
|
17
|
+
subjectColor = 'green';
|
|
18
|
+
hashColor = 'green';
|
|
19
|
+
dateColor = 'green';
|
|
20
|
+
}
|
|
10
21
|
|
|
11
22
|
return html`
|
|
12
23
|
<${Box}>
|
|
13
|
-
<${Text} color=${
|
|
24
|
+
<${Text} color=${isCursor ? 'cyan' : undefined}>${cursor} </${Text}>
|
|
14
25
|
<${Text} color=${checkColor}>${checkbox} </${Text}>
|
|
15
|
-
<${Text} color
|
|
16
|
-
<${Text} color=${subjectColor}
|
|
17
|
-
<${
|
|
18
|
-
<${Text} color="dim">${date}</${Text}>
|
|
26
|
+
<${Text} color=${hashColor}>${hash.slice(0, 7)} </${Text}>
|
|
27
|
+
<${Text} color=${subjectColor}>${subject}</${Text}>
|
|
28
|
+
<${Text} color=${dateColor}>${date ? ` (${date})` : ''}</${Text}>
|
|
19
29
|
</${Box}>
|
|
20
30
|
`;
|
|
21
31
|
}
|