Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cli): migrate spinner to typescript #22080

Merged
merged 2 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/gatsby-cli/src/reporter/loggers/ink/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Box, Static } from "ink"
import isTTY from "../../../util/is-tty"
import { trackBuildError } from "gatsby-telemetry"

import Spinner from "../ink/components/spinner"
import { Spinner } from "../ink/components/spinner"
import ProgressBar from "../ink/components/progress-bar"

import { Message } from "../ink/components/messages"
Expand Down
16 changes: 0 additions & 16 deletions packages/gatsby-cli/src/reporter/loggers/ink/components/spinner.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react"
blainekasten marked this conversation as resolved.
Show resolved Hide resolved
import { Box } from "ink"
import InkSpinner from "ink-spinner"

interface IProps {
text: string
statusText?: string
}
export function Spinner({ text, statusText }: IProps): JSX.Element {
blainekasten marked this conversation as resolved.
Show resolved Hide resolved
let label = text
if (statusText) {
label += ` — ${statusText}`
}
blainekasten marked this conversation as resolved.
Show resolved Hide resolved

return (
<Box>
<InkSpinner type="dots" /> {label}
</Box>
)
}