Cleanup styling spinner and tui-daemon-combo examples

This commit is contained in:
Christian Rocha
2021-05-14 22:27:10 -04:00
parent 65df16238d
commit 6eabfd726e
2 changed files with 9 additions and 13 deletions

View File

@@ -10,11 +10,8 @@ import (
"github.com/charmbracelet/bubbles/spinner"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
)
var color = termenv.ColorProfile().Color
type errMsg error
type model struct {
@@ -62,8 +59,7 @@ func (m model) View() string {
if m.err != nil {
return m.err.Error()
}
s := termenv.String(m.spinner.View()).Foreground(color("205")).String()
str := fmt.Sprintf("\n\n %s Loading forever...press q to quit\n\n", s)
str := fmt.Sprintf("\n\n %s Loading forever...press q to quit\n\n", m.spinner.View())
if m.quitting {
return str + "\n"
}