|
1 | 1 | import { Command } from "commander"; |
2 | | -import { render } from 'ink'; |
| 2 | +import { render } from "ink"; |
3 | 3 | import { RegisterJourney } from "../ui/journeys/register"; |
4 | 4 | import pc from "picocolors"; |
5 | 5 | import { logo } from ".."; |
6 | 6 | import { AppLayout } from "../ui/app-layout"; |
7 | 7 | import type { TalkativeBot } from "../contracts/talkative-bot-interface"; |
8 | 8 |
|
9 | 9 | type Deps = { |
10 | | - tBot: TalkativeBot |
11 | | -} |
12 | | -export const createRegisterCommand = (deps:Deps): Command => { |
13 | | - const command = new Command("register") |
14 | | - .description("Register to an event.") |
15 | | - .action(async () => { |
16 | | - console.log(pc.dim(logo)); |
17 | | - deps.tBot.say("We can't wait to see you soon! Select one of the events below to register."); |
18 | | - const { waitUntilExit, unmount } = render( |
19 | | - <AppLayout title="Register to an event!"> |
20 | | - <RegisterJourney unmount={() => unmount()} deps={deps} /> |
21 | | - </AppLayout>, |
22 | | - { |
23 | | - exitOnCtrlC: true, |
24 | | - } |
25 | | - ); |
26 | | - await waitUntilExit(); |
27 | | - }); |
28 | | - return command; |
29 | | -} |
| 10 | + tBot: TalkativeBot; |
| 11 | +}; |
| 12 | +export const createRegisterCommand = (deps: Deps): Command => { |
| 13 | + const command = new Command("register") |
| 14 | + .description("Register to an event.") |
| 15 | + .action(async () => { |
| 16 | + console.log(pc.dim(logo)); |
| 17 | + deps.tBot.say( |
| 18 | + "We can't wait to see you soon! Select one of the events below to register.", |
| 19 | + ); |
| 20 | + const { waitUntilExit, unmount } = render( |
| 21 | + <AppLayout title="Register to an event!"> |
| 22 | + <RegisterJourney unmount={() => unmount()} deps={deps} /> |
| 23 | + </AppLayout>, |
| 24 | + { |
| 25 | + exitOnCtrlC: true, |
| 26 | + }, |
| 27 | + ); |
| 28 | + await waitUntilExit(); |
| 29 | + }); |
| 30 | + return command; |
| 31 | +}; |
0 commit comments