Skip to content

Commit

Permalink
Delete the extra line break in spinner hint (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanyu66 authored Dec 5, 2022
1 parent 190538a commit 97bf81b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/cli/cluster/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func CreateAndSpinnerWait(d cloud.TiDBCloudClient, projectID string, clusterDefB
}
}

p := tea.NewProgram(ui.InitialSpinnerModel(task, "Waiting for cluster to be ready...\n"))
p := tea.NewProgram(ui.InitialSpinnerModel(task, "Waiting for cluster to be ready"))
createModel, err := p.StartReturningModel()
if err != nil {
return errors.Trace(err)
Expand Down
5 changes: 3 additions & 2 deletions internal/ui/spinner_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package ui

import (
"github.com/charmbracelet/lipgloss"
"github.com/fatih/color"

"github.com/charmbracelet/bubbles/spinner"
Expand All @@ -37,7 +38,7 @@ type Result string
func InitialSpinnerModel(task tea.Cmd, hint string) SpinnerModel {
s := spinner.New()
s.Spinner = spinner.Points
//s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("32"))
return SpinnerModel{spinner: s, Task: task, Output: "", Hint: hint}
}

Expand Down Expand Up @@ -72,7 +73,7 @@ func (m SpinnerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}

func (m SpinnerModel) View() string {
str := color.New(color.FgYellow).Sprintf("%s %s.", m.spinner.View(), m.Hint) + "\n"
str := color.New(color.FgYellow).Sprintf("%s %s.", m.spinner.View(), color.BlueString(m.Hint)) + "\n"
if m.quitting {
return str + "\n"
}
Expand Down

0 comments on commit 97bf81b

Please sign in to comment.