-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gatsby): migrate spinner to typescript (#22080)
- Loading branch information
1 parent
f0d02dc
commit 33de224
Showing
3 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
packages/gatsby-cli/src/reporter/loggers/ink/components/spinner.js
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
packages/gatsby-cli/src/reporter/loggers/ink/components/spinner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react" | ||
import { Box } from "ink" | ||
import InkSpinner from "ink-spinner" | ||
|
||
interface IProps { | ||
text: string | ||
statusText?: string | ||
} | ||
export function Spinner({ text, statusText }: IProps): JSX.Element { | ||
let label = text | ||
if (statusText) { | ||
label += ` — ${statusText}` | ||
} | ||
|
||
return ( | ||
<Box> | ||
<InkSpinner type="dots" /> {label} | ||
</Box> | ||
) | ||
} |