-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcli.res
More file actions
29 lines (24 loc) · 707 Bytes
/
cli.res
File metadata and controls
29 lines (24 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
open Ink
open InkCommunity
module Root = {
@react.component
let make = () => {
let app = useApp()
useInput((input, _) =>
if input == 'q' {
app.exit(None)
}
, ())
<Box display=#flex flexDirection=#column justifyContent=#"space-between">
<BigText text="Hello,\nReScript-Ink!" font={Block(#redBright, #gray)} />
<Link url="https://github.com/cometkim/rescript-ink">
{React.string("Checkout the repository!")}
</Link>
<Text color=#redBright backgroundColor=#black>
{React.string("Press q or Ctrl+C to exit")}
</Text>
</Box>
}
}
let {waitUntilExit} = render(<Root />, ~exitOnCtrlC=true, ())
waitUntilExit()->ignore