tokmon 0.3.1 → 0.3.2
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/dist/cli.js +9 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import { render } from "ink";
|
|
|
5
5
|
|
|
6
6
|
// src/app.tsx
|
|
7
7
|
import { useState, useEffect, useRef } from "react";
|
|
8
|
-
import { Box, Text, useInput, useStdout } from "ink";
|
|
8
|
+
import { Box, Text, useInput, useStdout, useApp } from "ink";
|
|
9
9
|
|
|
10
10
|
// src/data.ts
|
|
11
11
|
import { readdir, stat as fsStat } from "fs/promises";
|
|
@@ -347,6 +347,7 @@ function App({ interval: cliInterval }) {
|
|
|
347
347
|
clearInterval(id);
|
|
348
348
|
};
|
|
349
349
|
}, [tab, interval2]);
|
|
350
|
+
const { exit } = useApp();
|
|
350
351
|
const isTTY = process.stdin.isTTY === true;
|
|
351
352
|
const settingsItems = 2;
|
|
352
353
|
const cfg = config ?? { interval: 2, clearScreen: true };
|
|
@@ -380,6 +381,10 @@ function App({ interval: cliInterval }) {
|
|
|
380
381
|
}
|
|
381
382
|
return;
|
|
382
383
|
}
|
|
384
|
+
if (input === "q") {
|
|
385
|
+
exit();
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
383
388
|
if (input === "s") {
|
|
384
389
|
setShowSettings(true);
|
|
385
390
|
return;
|
|
@@ -458,7 +463,7 @@ function App({ interval: cliInterval }) {
|
|
|
458
463
|
showSettings ? /* @__PURE__ */ jsx(SettingsView, { config: cfg, cursor: settingsCursor }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
459
464
|
/* @__PURE__ */ jsxs(Box, { marginTop: 1, children: [
|
|
460
465
|
/* @__PURE__ */ jsx(TabBar, { tabs: TABS, active: tab }),
|
|
461
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " Tab
|
|
466
|
+
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " Tab/\u2190\u2192" })
|
|
462
467
|
] }),
|
|
463
468
|
/* @__PURE__ */ jsx(Box, { height: 1 }),
|
|
464
469
|
tab === 0 && /* @__PURE__ */ jsx(DashboardView, { data: dashboard }),
|
|
@@ -473,7 +478,8 @@ function App({ interval: cliInterval }) {
|
|
|
473
478
|
/* @__PURE__ */ jsx(Text, { children: "David Ilie" }),
|
|
474
479
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " (" }),
|
|
475
480
|
/* @__PURE__ */ jsx(Text, { color: "cyan", children: "davidilie.com" }),
|
|
476
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ")" })
|
|
481
|
+
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ") \xB7 " }),
|
|
482
|
+
/* @__PURE__ */ jsx(Text, { dimColor: true, children: "s=settings q=quit" })
|
|
477
483
|
] })
|
|
478
484
|
] });
|
|
479
485
|
}
|